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

Commit350410b

Browse files
committed
Add missing quote_identifier calls for CREATE TRIGGER ... REFERENCING.
Mixed-case names for transition tables weren't dumped correctly.Oversight in commit8c48375, per bug #15440 from Karl Czajkowski.In passing, I couldn't resist a bit of code beautification.Back-patch to v10 where this was introduced.Discussion:https://postgr.es/m/15440-02d1468e94d63d76@postgresql.org
1 parent197e4af commit350410b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎src/backend/utils/adt/ruleutils.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -954,22 +954,24 @@ pg_get_triggerdef_worker(Oid trigid, bool pretty)
954954
value=fastgetattr(ht_trig,Anum_pg_trigger_tgoldtable,
955955
tgrel->rd_att,&isnull);
956956
if (!isnull)
957-
tgoldtable=NameStr(*((NameData*)DatumGetPointer(value)));
957+
tgoldtable=NameStr(*DatumGetName(value));
958958
else
959959
tgoldtable=NULL;
960960
value=fastgetattr(ht_trig,Anum_pg_trigger_tgnewtable,
961961
tgrel->rd_att,&isnull);
962962
if (!isnull)
963-
tgnewtable=NameStr(*((NameData*)DatumGetPointer(value)));
963+
tgnewtable=NameStr(*DatumGetName(value));
964964
else
965965
tgnewtable=NULL;
966966
if (tgoldtable!=NULL||tgnewtable!=NULL)
967967
{
968968
appendStringInfoString(&buf,"REFERENCING ");
969969
if (tgoldtable!=NULL)
970-
appendStringInfo(&buf,"OLD TABLE AS %s ",tgoldtable);
970+
appendStringInfo(&buf,"OLD TABLE AS %s ",
971+
quote_identifier(tgoldtable));
971972
if (tgnewtable!=NULL)
972-
appendStringInfo(&buf,"NEW TABLE AS %s ",tgnewtable);
973+
appendStringInfo(&buf,"NEW TABLE AS %s ",
974+
quote_identifier(tgnewtable));
973975
}
974976

975977
if (TRIGGER_FOR_ROW(trigrec->tgtype))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp