Re: sequences and pg_upgrade

Поиск
Список
Период
Сортировка
От Anastasia Lubennikova
Тема Re: sequences and pg_upgrade
Дата
Msg-id 20160914135251.1520.67697.pgcf@coridan.postgresql.org
обсуждение исходный текст
Ответ на Re: sequences and pg_upgrade  (Andres Freund <andres@anarazel.de>)
Ответы Re: sequences and pg_upgrade  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
The following review has been posted through the commitfest application:
make installcheck-world:  tested, passed
Implements feature:       tested, passed
Spec compliant:           tested, passed
Documentation:            tested, failed

Thank you for the patch.
As I see there are no objections in the discussion, all the patches look clear.

Could you clarify, please, why do we dump sequence in schemaOnly mode?
+    if (dopt.schemaOnly && dopt.sequence_data)
+        getSequenceData(&dopt, tblinfo, numTables, dopt.oids);

Example: 
postgres=# create table t(i serial, data text);
postgres=# insert into t(data) values ('aaa');
pg_dump -d postgres --sequence-data --schema-only > ../reviews/dump_pg

Then restore it into newdb and add new value.
newdb=# insert into t(data) values ('aaa');
INSERT 0 1
newdb=# select * from t;i | data 
---+------2 | aaa

I'm not an experienced user, but I thought that while doing dump/restore
of schema of database we reset all the data. Why should the table in newly
created (via pg_restore) database have non-default sequence value?

I also did some other tests and all of them were passed.

One more thing to do is a documentation for the new option.
You should update help() function in pg_dump.c and also add some
notes to pg_dump.sgml and probably to pgupgrade.sgml.

The new status of this patch is: Waiting on Author

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Rahila Syed
Дата:
Сообщение: Re: Surprising behaviour of \set AUTOCOMMIT ON
Следующее
От: Robert Haas
Дата:
Сообщение: Re: condition variables