Обсуждение: BUG #4061: after backup/restore pg_attrdef.adsrc column lacks schema name.

Поиск
Список
Период
Сортировка

BUG #4061: after backup/restore pg_attrdef.adsrc column lacks schema name.

От
"Julius Tuskenis"
Дата:
The following bug has been logged online:

Bug reference:      4061
Logged by:          Julius Tuskenis
Email address:      julius@nsoft.lt
PostgreSQL version: 8.2.7
Operating system:   WinXp
Description:        after backup/restore pg_attrdef.adsrc column lacks
schema name.
Details:

Problem with backup/restore databases with schemas other than public. After
restoring pg_attrdef.adsrc doesn't contain schema name of the sequence -
only sequence itself. It is big problem then using Zeos lib components for
Delphi, becouse they get wrong default values and no insert is possible
then.

To replicate the bug do the folowing:

1. create DB and new schema in it (not public).
2. create table in new schema with column of datatype serial;
3. go to pg_attrdef and find the desciption of default value of the new
column (adsrc). See it contains NEXTVAL('schema.sequence').
4. do backup/restore (using pg_dump binary backup)
5. after restoring see the column pg_attrdef.adsrc of the new database.
6. See it contains NEXTVAL('sequence');

Re: BUG #4061: after backup/restore pg_attrdef.adsrc column lacks schema name.

От
Tom Lane
Дата:
"Julius Tuskenis" <julius@nsoft.lt> writes:
> Problem with backup/restore databases with schemas other than public. After
> restoring pg_attrdef.adsrc doesn't contain schema name of the sequence -
> only sequence itself. It is big problem then using Zeos lib components for
> Delphi, becouse they get wrong default values and no insert is possible
> then.

You need to file this bug against Zeos; if they are expecting adsrc to
contain anything very reliable then they are broken.  They shouldn't
be depending on it at all.  Note the comment at the bottom of
http://developer.postgresql.org/pgdocs/postgres/catalog-pg-attrdef.html

            regards, tom lane