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

Commit2446937

Browse files
committed
Update patch for DEFAULT on Views.
Apparently, you need to make two calls to appendPQExpBuffer() touse fmtId() twice, because it uses a static buffer (thanks forspotting this Tom).Another revision of the patch is attached.Neil Conway <neilconway@rogers.com>
1 parent19b31e0 commit2446937

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎src/bin/pg_dump/pg_dump.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*
2323
*
2424
* IDENTIFICATION
25-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.252 2002/04/24 02:38:58 momjian Exp $
25+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.253 2002/04/24 02:42:27 momjian Exp $
2626
*
2727
*-------------------------------------------------------------------------
2828
*/
@@ -4376,10 +4376,12 @@ dumpTables(Archive *fout, TableInfo *tblinfo, int numTables,
43764376
*/
43774377
for (j=0;j<tblinfo[i].numatts;j++)
43784378
{
4379-
if (tblinfo[i].adef_expr[j]!=NULL&&tblinfo[i].inhAttrDef[j]==0)
4380-
appendPQExpBuffer(q,"ALTER TABLE %s ALTER COLUMN %s SET DEFAULT %s;\n",
4381-
tblinfo[i].relname,tblinfo[i].attnames[j],
4379+
if (tblinfo[i].adef_expr[j]!=NULL&&tblinfo[i].inhAttrDef[j]==0) {
4380+
appendPQExpBuffer(q,"ALTER TABLE %s ",fmtId(tblinfo[i].relname,force_quotes));
4381+
appendPQExpBuffer(q,"ALTER COLUMN %s SET DEFAULT %s;\n",
4382+
fmtId(tblinfo[i].attnames[j],force_quotes),
43824383
tblinfo[i].adef_expr[j]);
4384+
}
43834385
}
43844386

43854387
commentDeps=malloc(sizeof(char*)*2);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp