Re: Should this require CASCADE?

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Should this require CASCADE?
Date: 2002-07-12 03:12:19
Message-ID: GNELIHDDFBOCMGBFGEFOGEBLCDAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > Also, when talking about whether or not the index supporting a
> constraint
> > should be sort of 'hidden' from the user, should not we change
> pg_dump to
> > dump unique indices using the ALTER TABLE syntax, rather than the CREATE
> > UNIQUE INDEX syntax? Otherwise this information will be lost.
>
> I thought we did that already.

Nope: (CVS-HEAD)

test=# create table test (a int4 unique);
NOTICE: CREATE TABLE / UNIQUE will create implicit index 'test_a_key' for
table 'test'
CREATE TABLE
test=# \q
chriskl(at)alpha:~$ pg_dump test
--
-- Selected TOC Entries:
--
\connect - chriskl

SET search_path = public, pg_catalog;

--
-- TOC Entry ID 2 (OID 16575)
--
-- Name: test Type: TABLE Schema: public Owner: chriskl
--

CREATE TABLE "test" (
"a" integer
);

--
-- Data for TOC Entry ID 4 (OID 16575)
--
-- Name: test Type: TABLE DATA Schema: public Owner: chriskl
--

COPY "test" FROM stdin;
\.
--
-- TOC Entry ID 3 (OID 16577)
--
-- Name: test_a_key Type: INDEX Schema: public Owner: chriskl
--

CREATE UNIQUE INDEX test_a_key ON test USING btree (a);

I think that if an index is unique and uses btree, it should be dumped as an
alter table statement?

Chris

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-07-12 03:22:01 Re: I am being interviewed by OReilly
Previous Message Vince Vielhaber 2002-07-12 03:09:25 Re: Jan's Name (Was: Re: I am being interviewed by OReilly)