Re: constraint defaults still print

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: constraint defaults still print
Date: 2003-02-03 15:16:42
Message-ID: 200302031516.h13FGgb19096@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


OK, NO ACTION (the default) no longer prints for foreign key constraints:

regression=> \d clstr_tst
Table "public.clstr_tst"
Column | Type | Modifiers
--------+---------+----------------------------------------------------------
a | integer | not null default nextval('public.clstr_tst_a_seq'::text)
b | integer |
c | text |
d | text |
Indexes: clstr_tst_pkey primary key btree (a),
clstr_tst_b btree (b),
clstr_tst_b_c btree (b, c),
clstr_tst_c btree (c),
clstr_tst_c_b btree (c, b)
Foreign Key constraints: clstr_tst_con FOREIGN KEY (b) REFERENCES clstr_tst_s(rf_a)

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

Christopher Kings-Lynne wrote:
> I vote for not showing 'NO ACTION', so long as it's the SQL standard
> default...
>
> Chris
>
> On Sat, 18 Jan 2003, Bruce Momjian wrote:
>
> > Remember how we made DEFERRABLE/DEFERRED not print if the constraint was
> > the default. Shouldn't we do the same for MATCH and ON UPDATE/ON DELETE
> > sections of the constraint in pg_get_constraintdef()?
> >
> > Doing \d I see:
> >
> > test=> \d sales
> > Table "public.sales"
> > Column | Type | Modifiers
> > -------------------+---------+-----------
> > product_id | integer | not null
> > store_id | integer | not null
> > quantity_sold | integer | not null
> > date_time_of_sale | date | not null
> > Foreign Key constraints: $1 FOREIGN KEY (product_id) REFERENCES
> > products(product_id) ON UPDATE NO ACTION ON DELETE NO ACTION,
> > $2 FOREIGN KEY (store_id) REFERENCES
> > stores(store_id) ON UPDATE NO ACTION ON DELETE NO ACTION
> >
> > If NO ACTION is the default, is there a need to print them? This would
> > also shorten pg_dump output.
> >
> > --
> > 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
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> > (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
> >
>
>

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

Attachment Content-Type Size
unknown_filename text/plain 2.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-02-03 15:17:44 Re: targetlist functions part 1 (was [HACKERS] targetlist
Previous Message Joe Conway 2003-02-03 14:57:49 Re: targetlist functions part 1 (was [HACKERS] targetlist