Re: [PATCHES] Non-colliding auto generated names

Поиск
Список
Период
Сортировка
Искать
От
Rod Taylor
Тема
Re: [PATCHES] Non-colliding auto generated names
Дата
Msg-id
1046880424.19527.7.camel@jester
Ответ на
Список
Дерево обсуждения
Re: [PATCHES] Non-colliding auto generated names "Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: [PATCHES] Non-colliding auto generated names Bruce Momjian <pgman@candle.pha.pa.us>
Re: [PATCHES] Non-colliding auto generated names Rod Taylor <rbt@rbt.ca>
Re: [PATCHES] Non-colliding auto generated names Bruce Momjian <pgman@candle.pha.pa.us>
Re: [PATCHES] Non-colliding auto generated names Rod Taylor <rbt@rbt.ca>
Re: [PATCHES] Non-colliding auto generated names Bruce Momjian <pgman@candle.pha.pa.us>
Re: [PATCHES] Non-colliding auto generated names Tom Lane <tgl@sss.pgh.pa.us>
On Wed, 2003-03-05 at 10:36, Bruce Momjian wrote:
> Ewe.  There would no longer be a guaranteed name for the serial column
> sequence.  Of course, pg_depend has the information, but how do you get
> at that when you create the dump file, and be _sure_ you are going to
> hit the right name, especially if you restore only part of the dump.
> 
> Seems this kills the idea of this patch.  With 64-byte names, let's see
> if we still get complaints about name conflicts.

We are :)

CREATE TABLE tab (col SERIAL);

ALTER TABLE tab RENAME TO tab2;

CREATE TABLE tab (col SERIAL);


There is a chance we could do something like:

ALTER SEQUENCE ON table(col) RESTART WITH 

instead of

SELECT setval("", );


The ALTER SEQUENCE syntax isn't any worse than setval...  I'd be willing
to implement the feature in order to get this patch accepted.

Oh, and welcome back!

> ---------------------------------------------------------------------------
> 
> Christopher Kings-Lynne wrote:
> > OK,
> > 
> > I have discovered a problem with my auto-naming patch.  It's do to with
> > dumping serial columns with pg_dump, eg:
> > 
> > --
> > -- TOC entry 2 (OID 1004551)
> > -- Name: users_users; Type: TABLE; Schema: public; Owner: chriskl
> > --
> > 
> > CREATE TABLE users_users (
> >     userid serial NOT NULL,
> >     firstname character varying(255) NOT NULL,
> >     lastname character varying(255) NOT NULL,
> >     email character varying(255) NOT NULL
> > );
> > 
> > -- DATA DUMPED HERE
> > 
> > --
> > -- TOC entry 4 (OID 1004305)
> > -- Name: users_users_userid_seq; Type: SEQUENCE SET; Schema: public; Owner:
> > chriskl
> > --
> > 
> > SELECT pg_catalog.setval ('users_users_userid_seq', 126, true);
> > 
> > 
> > How do we fix this problem??  Perhaps instead of a hard-coded sequence
> > string, we can sub-SELECT for it...?
> > 
> > Chris
> > 
> > 
> > 
-- 
Rod Taylor 

PGP Key: http://www.rbt.ca/rbtpub.asc
В списке pgsql-hackers по дате отправления
От: Ross J. Reedstrom
Дата:
Сообщение: Re: Error codes revisited
От: Rod Taylor
Дата:
Сообщение: Re: Updateable views...
FAQ