Re: [HACKERS] Making serial survive pg_dump

2002-06-14 Thread Rod Taylor
> > I think that when SERIAL is used, the sequence should be tied > > inextricably to the table which created it, and it should be hidden from > > use for other purposes (perhaps similar to the way a toast table is). If > > you *want* to use a sequence across several tables, then you don't use > >

Re: [HACKERS] Making serial survive pg_dump

2002-06-13 Thread Christopher Kings-Lynne
> I think that when SERIAL is used, the sequence should be tied > inextricably to the table which created it, and it should be hidden from > use for other purposes (perhaps similar to the way a toast table is). If > you *want* to use a sequence across several tables, then you don't use > SERIA

Re: [HACKERS] Making serial survive pg_dump

2002-06-13 Thread Joe Conway
Tom Lane wrote: > "Rod Taylor" <[EMAIL PROTECTED]> writes: > >>>What happens is the sequence is shared between several tables (eg. >>>invoice numbers or something) >> > >>You cannot accomplish this situation by strictly using the SERIAL >>type. > > > But Chris is correct that there are borderl

Re: [HACKERS] Making serial survive pg_dump

2002-06-13 Thread Tom Lane
"Rod Taylor" <[EMAIL PROTECTED]> writes: >> What happens is the sequence is shared between several tables (eg. >> invoice numbers or something) > You cannot accomplish this situation by strictly using the SERIAL > type. But Chris is correct that there are borderline cases where we might do the w

Re: [HACKERS] Making serial survive pg_dump

2002-06-13 Thread Rod Taylor
> What happens is the sequence is shared between several tables (eg. invoice > numbers or something) You cannot accomplish this situation by strictly using the SERIAL type. ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http:

Re: [HACKERS] Making serial survive pg_dump

2002-06-13 Thread Christopher Kings-Lynne
> Currently serial is dumped as a sequence and appropriate default > statement. > > With my upcoming dependency patch serials depend on the appropriate > column. Drop the column (or table) and the sequence goes with it. > The depencency information does not survive the pg_dump / restore > process

Re: [HACKERS] Making serial survive pg_dump

2002-06-13 Thread Josh Berkus
Folks, > No. IMHO, if we change the naming convention for serial sequences (which > seems unlikely, except that it might be indirectly affected by changing > NAMEDATALEN), then we'd *want* the new naming convention to take effect, > not to have pg_dump scripts force an old naming convention to

Re: [HACKERS] Making serial survive pg_dump

2002-06-13 Thread Rod Taylor
]> Cc: "Hackers List" <[EMAIL PROTECTED]> Sent: Thursday, June 13, 2002 6:05 PM Subject: Re: [HACKERS] Making serial survive pg_dump > "Rod Taylor" <[EMAIL PROTECTED]> writes: > > If we have sequences pick new names automatically, it may not pick the

Re: [HACKERS] Making serial survive pg_dump

2002-06-13 Thread Tom Lane
"Rod Taylor" <[EMAIL PROTECTED]> writes: > If we have sequences pick new names automatically, it may not pick the > same name after dump / restore as it had earlier -- especially across > versions (see TODO entry). > So don't we need a way to suggest the *right* name to SERIAL? No. IMHO, if we c

Re: [HACKERS] Making serial survive pg_dump

2002-06-13 Thread Rod Taylor
e" <[EMAIL PROTECTED]> To: "Rod Taylor" <[EMAIL PROTECTED]> Cc: "Hackers List" <[EMAIL PROTECTED]> Sent: Thursday, June 13, 2002 5:52 PM Subject: Re: [HACKERS] Making serial survive pg_dump > "Rod Taylor" <[EMAIL PROTECTED]> writes: > &g

Re: [HACKERS] Making serial survive pg_dump

2002-06-13 Thread Rod Taylor
-- Rod - Original Message - From: "Tom Lane" <[EMAIL PROTECTED]> To: "Rod Taylor" <[EMAIL PROTECTED]> Cc: "Hackers List" <[EMAIL PROTECTED]> Sent: Thursday, June 13, 2002 9:46 AM Subject: Re: [HACKERS] Making serial survive pg_dump >

Re: [HACKERS] Making serial survive pg_dump

2002-06-13 Thread Rod Taylor
sage - From: "Tom Lane" <[EMAIL PROTECTED]> To: "Rod Taylor" <[EMAIL PROTECTED]> Cc: "Hackers List" <[EMAIL PROTECTED]> Sent: Thursday, June 13, 2002 5:41 PM Subject: Re: [HACKERS] Making serial survive pg_dump > "Rod Taylor" <[

Re: [HACKERS] Making serial survive pg_dump

2002-06-13 Thread Tom Lane
"Rod Taylor" <[EMAIL PROTECTED]> writes: > Normally I'd agree, but I've found a few people who use normal > sequence operations with serial sequences. That is, they track down > the name and use it. Sure. But what's this have to do with what pg_dump should emit? regards

Re: [HACKERS] Making serial survive pg_dump

2002-06-13 Thread Tom Lane
"Rod Taylor" <[EMAIL PROTECTED]> writes: > Ok, keeping the setval is appropriate. Are there any problems with a > SERIAL() implementation? What for? The sequence name is an implementation detail, not something we want to expose (much less let users modify). regards, tom

Re: [HACKERS] Making serial survive pg_dump

2002-06-13 Thread Tom Lane
"Rod Taylor" <[EMAIL PROTECTED]> writes: > Store sequence information in the SERIAL creation statement: > CREATE TABLE tab (col1 SERIAL(, )); This is wrong because it loses the separation between schema and data. I do agree that it would be nice if pg_dump recognized serial columns and dumped the