diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-07-07 19:28:00 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-07-07 19:28:00 +0000 |
commit | fc9dd12da061680d4b3a884080fc7d43318f7993 (patch) | |
tree | 7d13f259d4e3a896e1a29680218cfa988f15c852 /src | |
parent | 987281274f7257c1fe3304309f0ba3f39e96532f (diff) | |
download | postgresql-fc9dd12da061680d4b3a884080fc7d43318f7993.tar.gz postgresql-fc9dd12da061680d4b3a884080fc7d43318f7993.zip |
Query in SQL function still not schema-safe; add a couple
more pg_catalog. qualifications.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/catalog/information_schema.sql | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/catalog/information_schema.sql b/src/backend/catalog/information_schema.sql index 946d1bc8eaf..09d2ccef219 100644 --- a/src/backend/catalog/information_schema.sql +++ b/src/backend/catalog/information_schema.sql @@ -4,7 +4,7 @@ * * Copyright (c) 2003-2009, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.55 2009/07/07 18:23:13 petere Exp $ + * $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.56 2009/07/07 19:28:00 tgl Exp $ */ /* @@ -106,7 +106,8 @@ $$SELECT CASE WHEN $1 IN (25, 1042, 1043) /* text, char, varchar */ THEN CASE WHEN $2 = -1 /* default typmod */ THEN CAST(2^30 AS integer) - ELSE information_schema._pg_char_max_length($1, $2) * pg_catalog.pg_encoding_max_length((SELECT encoding FROM pg_database WHERE datname = current_database())) + ELSE information_schema._pg_char_max_length($1, $2) * + pg_catalog.pg_encoding_max_length((SELECT encoding FROM pg_catalog.pg_database WHERE datname = pg_catalog.current_database())) END ELSE null END$$; |