Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0c6e97d

Browse files
committed
Always schema-qualify the name of a function referenced in CREATE CAST.
The former coding failed if the cast function was not in the pg_catalogschema. How'd this escape detection?
1 parent351cf4d commit0c6e97d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

‎src/bin/pg_dump/pg_dump.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*by PostgreSQL
1313
*
1414
* IDENTIFICATION
15-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.365 2004/02/24 03:35:19 tgl Exp $
15+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.366 2004/03/02 21:14:44 tgl Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -5080,8 +5080,16 @@ dumpCast(Archive *fout, CastInfo *cast)
50805080
if (!OidIsValid(cast->castfunc))
50815081
appendPQExpBuffer(defqry,"WITHOUT FUNCTION");
50825082
else
5083-
appendPQExpBuffer(defqry,"WITH FUNCTION %s",
5083+
{
5084+
/*
5085+
* Always qualify the function name, in case it is not in pg_catalog
5086+
* schema (format_function_signature won't qualify it).
5087+
*/
5088+
appendPQExpBuffer(defqry,"WITH FUNCTION %s.",
5089+
fmtId(funcInfo->pronamespace->nspname));
5090+
appendPQExpBuffer(defqry,"%s",
50845091
format_function_signature(funcInfo,NULL, true));
5092+
}
50855093

50865094
if (cast->castcontext=='a')
50875095
appendPQExpBuffer(defqry," AS ASSIGNMENT");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp