Skip to content

Commit fc9dd12

Browse files
committed
Query in SQL function still not schema-safe; add a couple
more pg_catalog. qualifications.
1 parent 9872812 commit fc9dd12

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/catalog/information_schema.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright (c) 2003-2009, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.55 2009/07/07 18:23:13 petere Exp $
7+
* $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.56 2009/07/07 19:28:00 tgl Exp $
88
*/
99

1010
/*
@@ -106,7 +106,8 @@ $$SELECT
106106
CASE WHEN $1 IN (25, 1042, 1043) /* text, char, varchar */
107107
THEN CASE WHEN $2 = -1 /* default typmod */
108108
THEN CAST(2^30 AS integer)
109-
ELSE information_schema._pg_char_max_length($1, $2) * pg_catalog.pg_encoding_max_length((SELECT encoding FROM pg_database WHERE datname = current_database()))
109+
ELSE information_schema._pg_char_max_length($1, $2) *
110+
pg_catalog.pg_encoding_max_length((SELECT encoding FROM pg_catalog.pg_database WHERE datname = pg_catalog.current_database()))
110111
END
111112
ELSE null
112113
END$$;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy