| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Sim Zacks <sim(at)compulab(dot)co(dot)il> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: alter table schema, default sequences stay the same |
| Date: | 2010-06-30 14:22:55 |
| Message-ID: | 9547.1277907775@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Sim Zacks <sim(at)compulab(dot)co(dot)il> writes:
>> I haven't consumed enough caffeine today to recall the details, but
>> I think you could have ended up with default expressions like the above
>> if the database had been dumped and reloaded from 8.0 or earlier.
>> nextval(regclass) was introduced in 8.1 precisely to solve this type
>> of problem.
> My first database was an 8.0 and at some point we upgraded to 8.2 so
> that must have caused the ?corruption?
Yeah, that would fit. The upgrade process was intentionally designed to
work that way, because the pre-8.1 behavior of DEFAULT nextval('foo')
was that it always referred to the sequence currently named foo, because
'foo' was just a text constant. We didn't want to risk breaking things
for anyone who was depending on that behavior. But now you have to
explicitly put in ::text if that's how you want it to behave ---
otherwise you get a regclass constant, which will track the original
sequence's identity despite renamings.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Merlin Moncure | 2010-06-30 14:46:55 | Re: Problem with temporary tables |
| Previous Message | sam mulube | 2010-06-30 14:20:35 | Re: Postgresql partitioning - single hot table or distributed |