Received: from lists.unixathome.org (lists.unixathome.org [210.48.103.158]) by postgresql.org (Postfix) with ESMTP id EEE024767FE; Mon, 4 Mar 2002 15:43:45 -0500 (EST) Received: from wocker (lists.unixathome.org [210.48.103.158]) by lists.unixathome.org (8.11.6/8.11.6) with ESMTP id g24Khek80028; Tue, 5 Mar 2002 09:43:41 +1300 (NZDT) (envelope-from dan@lists.unixathome.org) Message-Id: <200203042043.g24Khek80028@lists.unixathome.org> From: "Dan Langille" Organization: DVL Software Limited To: Tom Lane Date: Mon, 4 Mar 2002 15:43:38 -0500 MIME-Version: 1.0 Subject: Re: Uniqueness of rule, constraint, and trigger names Reply-To: dan@langille.org Cc: pgsql-hackers@postgreSQL.org, pgsql-sql@postgreSQL.org References: <200203042004.g24K4lk79699@lists.unixathome.org> In-reply-to: <7581.1015274302@sss.pgh.pa.us> X-mailer: Pegasus Mail for Windows (v4.01) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Archive-Number: 200203/42 X-Sequence-Number: 6924 On 4 Mar 2002 at 15:38, Tom Lane wrote: > "Dan Langille" writes: > > On 4 Mar 2002 at 14:24, Tom Lane wrote: > >> ... but I'm a little worried about the possibility of errors > >> in loading schemas from existing databases, where there might be > >> non-unique constraint names. > > > Create a tool to generate unique constraint names during a dump. > > And then all we need is a time machine, so we can make existing > instances of pg_dump contain the tool? It's not that easy ... *sigh* You don't have to modify all previous versions of pg_dump. They use this tool if they want to upgrade to this version. There is no perfect solution. Even a script to check for uniqueness might help. I'm just trying to help the best way I can; by providing suggestions. As requested. > I am not sure that there's really a problem here, because I don't > think duplicate constraint names will be generated during plain > CREATE operations. However, an ALTER TABLE might leave you with > a problem. Hard to tell if this is critical enough to worry about. It would be easily detected at load time. Then you direct the user to the tool mentioned above. -- Dan Langille The FreeBSD Diary - http://freebsddiary.org/ - practical examples