Re: [COMMITTERS] pgsql-server: Clean up generation of default names - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject Re: [COMMITTERS] pgsql-server: Clean up generation of default names
Date
Msg-id 40C929E2.1060605@familyhealth.com.au
Whole thread Raw
In response to Re: [COMMITTERS] pgsql-server: Clean up generation of default names  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [COMMITTERS] pgsql-server: Clean up generation of default
List pgsql-hackers
> Yeah, I know ... we ought to find some way around that, but I dunno
> what yet ...

My idea, which I tried hacking, but gave up was to do the following:

1. Extend this command:

ALTER SEQUENCE seqname RESTART WITH 17;

to allow:

ALTER SEQUENCE ON table(col) RESTART WITH 17...
or
ALTER SEQUENCE ON table.col RESTART WITH 17...

2. Overload nextval, curval and setval:

SELECT SETVAL('"schema.table"', 'col', 17, false);

3. Or even create a pg_get_sequence() function:

SELECT SETVAL(pg_get_sequence(schema.table, col), 17);

etc.

Chris






pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [pgsql-hackers-win32] Tablespaces
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: [COMMITTERS] pgsql-server: Clean up generation of default