Re: BUG #2245: pg_dump doesn't dump expressions with sequence in DEFAULT setting for some column in table - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #2245: pg_dump doesn't dump expressions with sequence in DEFAULT setting for some column in table
Date
Msg-id 6604.1139323069@sss.pgh.pa.us
Whole thread Raw
In response to BUG #2245: pg_dump doesn't dump expressions with sequence in DEFAULT setting for some column in table  ("Nikolay Samokhvalov" <samokhvalov@gmail.com>)
List pgsql-bugs
"Nikolay Samokhvalov" <samokhvalov@gmail.com> writes:
> I use some expression as DEFAULT setting for some column of some table. For
> example, nextval('myseq') * 10.
> Then, I pg_dump my database and restore it. I see 'nextval('myseq')' (w/o
> '*10').

You mustn't fool with the default expression for a serial column.  You
should have declared this as a plain integer column with a handmade
default expression.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Nikolay Samokhvalov"
Date:
Subject: BUG #2245: pg_dump doesn't dump expressions with sequence in DEFAULT setting for some column in table
Next
From: Tom Lane
Date:
Subject: Re: BUG #2242: Inconsistent casting in query with literal vs query with parameter