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

Commit6ee2a3b

Browse files
committed
Fix pg_dump to not crash if -t or a similar switch is used to select a serial
sequence for dumping without also selecting its owning table. Make it not tryto emit ALTER SEQUENCE OWNED BY in this situation.Per report from Michael Nolan.
1 parentde9effb commit6ee2a3b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/bin/pg_dump/pg_dump.c

Lines changed: 4 additions & 4 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.466 2007/04/02 03:49:39 tgl Exp $
15+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.467 2007/04/16 18:42:10 tgl Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -8654,8 +8654,8 @@ dumpSequence(Archive *fout, TableInfo *tbinfo)
86548654
*
86558655
* Add a CREATE SEQUENCE statement as part of a "schema" dump (use
86568656
* last_val for start if called is false, else use min_val for start_val).
8657-
* Also, if the sequence is owned by a column, add an ALTER SEQUENCE SET
8658-
* OWNED command for it.
8657+
* Also, if the sequence is owned by a column, add an ALTER SEQUENCE
8658+
* OWNEDBYcommand for it.
86598659
*
86608660
* Add a 'SETVAL(seq, last_val, iscalled)' as part of a "data" dump.
86618661
*/
@@ -8723,7 +8723,7 @@ dumpSequence(Archive *fout, TableInfo *tbinfo)
87238723
{
87248724
TableInfo*owning_tab=findTableByOid(tbinfo->owning_tab);
87258725

8726-
if (owning_tab)
8726+
if (owning_tab&&owning_tab->dobj.dump)
87278727
{
87288728
resetPQExpBuffer(query);
87298729
appendPQExpBuffer(query,"ALTER SEQUENCE %s",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp