Re: Default value of serial fields changes after restore

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Luiz Damim <luizvd(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Default value of serial fields changes after restore
Date: 2012-07-19 19:13:08
Message-ID: 11202.1342725188@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Luiz Damim <luizvd(at)gmail(dot)com> writes:
> Today I found a strange behavior after restoring a PostgreSQL database: the
> schema of all serialfields default values are trimmed out.

I don't think anything's being "trimmed out". It's the normal behavior
of regclass literals to not print the schema if the table (or sequence
in this case) is visible in the current search_path.

> After restore, default_value changes to
> nextval('testtable_id_seq'::regclass) and INSERT's start to fail as the
> sequence cant be found on it's schema.

This claim is utter nonsense. If you are having a problem it's not due
to the way regclass literals print. Please show a complete example of
something failing.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2012-07-19 19:19:18 Re: Default value of serial fields changes after restore
Previous Message Adrian Klaver 2012-07-19 19:13:00 Re: Trouble with NEW