RE: Table/Column Constraints

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: Table/Column Constraints
Date: 2000-11-21 08:10:56
Message-ID: 3.0.5.32.20001121191056.029c0ca0@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 15:10 21/11/00 +0800, Christopher Kings-Lynne wrote:
>> CREATE TABLE example
>> ( example_id serial
>>
>> -- Must be a ZIP or Postal Code
>> , region varchar(6)
>>
>> -- Descriptive text
>> , description varchar(60)
>> );
>
>Actually - this is something I _could_ do.
>
>As the pg_dump is running, it shouldn't be too hard to select the comment
>associated with each entity as it is being dumped. ie. In the example
>above, the comments for each attribute would be retrieved from
>pg_description (or whatever) and output as '-- ...' comments.

I was actually more worried about making sure the constraints were dumped
separately from the table, but maybe I missed the point of the original post.

>Then, if the COMMENT ON statements are also still dumped at the bottom, you
>get the ability to see comments conveniently in your dump, but with the
>ability to still hand-edit them before restoring the dump...

If I recall correctly, the comments are actually grabbed when each table is
retrieved, so it is easy to do. But is it really a good idea?

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Inoue 2000-11-21 09:54:24 Re: Re: [COMMITTERS] pgsql/src/backend/utils/adt (ri_triggers.c)
Previous Message Mitch Vincent 2000-11-21 07:55:27 Re: [HACKERS] RE: PHPBuilder article -- Postgres vs MySQL