Skip site navigation (1) Skip section navigation (2)

Re: [PATCHES] Non-colliding auto generated names

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Non-colliding auto generated names
Date: 2003-03-05 15:36:06
Message-ID: 200303051536.h25Fa6P08845@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
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.

---------------------------------------------------------------------------

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
> 
> 
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

Responses

pgsql-hackers by date

Next:From: Eric D NielsenDate: 2003-03-05 15:39:02
Subject: Re: Updateable views...
Previous:From: Tom LaneDate: 2003-03-05 15:33:17
Subject: Re: Updateable views...

pgsql-patches by date

Next:From: Bruce MomjianDate: 2003-03-05 15:43:55
Subject: Re: contrib/dbmirror
Previous:From: Rod TaylorDate: 2003-03-05 04:22:07
Subject: Re: [PATCHES] ALTER SEQUENCE

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group