Re: Column descriptions - could they be propagated to new tables?

Lists: pgsql-general
From: Clive Page <cgp(at)star(dot)le(dot)ac(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Column descriptions - could they be propagated to new tables?
Date: 2006-04-05 08:59:22
Message-ID: Pine.LNX.4.63.0604050951550.7042@peneca.star.le.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Since I discovered the facilities in Postgres for providing and listing
column descrptions, I have found them very useful, especially for adding a
string showing physical units to my columns. For example:

\d+ cat
Table "public.cat"
Column | Type | Modifiers | Description
-----------------+------------------+-----------+--------------
src_num | integer | |
ra | double precision | | deg
decl | double precision | | deg
radec_err | real | | arcsec
lii | double precision | | deg
bii | double precision | | deg
pn_cts | real | | counts

However if one performs a JOIN creating a new table, all these
descriptions fail to transfer. I haven't been able to find any easy way
of propagating the descriptions - would it be a useful facility to have
them propagated automatically? I would have thought that things like
units would be useful even in many scientific applications, e.g. to have
monetary columns described as dollars/pounds/euros or whatever.

--
Clive Page
Dept of Physics & Astronomy,
University of Leicester,
Leicester, LE1 7RH, U.K.


From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Clive Page" <cgp(at)star(dot)le(dot)ac(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Column descriptions - could they be propagated to new tables?
Date: 2006-04-05 16:15:07
Message-ID: b42b73150604050915k1427caeeq1e07de94e0841397@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 4/5/06, Clive Page <cgp(at)star(dot)le(dot)ac(dot)uk> wrote:
> Since I discovered the facilities in Postgres for providing and listing
> column descrptions, I have found them very useful, especially for adding a
> string showing physical units to my columns.

Have you considered using domains for these types? You can comment
the domain appropriately. While the domain description will not show
in \d+. to get the description you can do \dT on the domain.

Based on your background I also think you might appreciate domains
from a design perspective. There are a couple of disadvantages to
using them so I'd suggest reading about them.

merlin


From: Clive Page <cgp(at)star(dot)le(dot)ac(dot)uk>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Column descriptions - could they be propagated to new
Date: 2006-04-05 16:53:11
Message-ID: Pine.LNX.4.63.0604051752000.7042@peneca.star.le.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Wed, 5 Apr 2006, Merlin Moncure wrote:

> Have you considered using domains for these types? You can comment
> the domain appropriately. While the domain description will not show
> in \d+. to get the description you can do \dT on the domain.
>
> Based on your background I also think you might appreciate domains
> from a design perspective. There are a couple of disadvantages to
> using them so I'd suggest reading about them.

Thanks for the suggestion, I'll start reading up on them.

--
Clive Page
Dept of Physics & Astronomy,
University of Leicester,
Leicester, LE1 7RH, U.K.


From: Jim Nasby <jnasby(at)pervasive(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: "Clive Page" <cgp(at)star(dot)le(dot)ac(dot)uk>, pgsql-general(at)postgresql(dot)org
Subject: Re: Column descriptions - could they be propagated to new tables?
Date: 2006-04-06 21:18:11
Message-ID: 4D8D0951-518D-4C55-B6E4-32FF939CBF9D@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Apr 5, 2006, at 12:15 PM, Merlin Moncure wrote:
> On 4/5/06, Clive Page <cgp(at)star(dot)le(dot)ac(dot)uk> wrote:
>> Since I discovered the facilities in Postgres for providing and
>> listing
>> column descrptions, I have found them very useful, especially for
>> adding a
>> string showing physical units to my columns.
>
> Have you considered using domains for these types? You can comment
> the domain appropriately. While the domain description will not show
> in \d+. to get the description you can do \dT on the domain.
>
> Based on your background I also think you might appreciate domains
> from a design perspective. There are a couple of disadvantages to
> using them so I'd suggest reading about them.

I seem to recall some astronomer having created some custom types for
storing astronomical data in PostgreSQL. Or perhaps he was using
PostGIS. I know that other astronomers are using PostgreSQL/PostGIS
so if you look around you might be able to save yourself quite a bit
of work.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461


From: Clive Page <cgp(at)star(dot)le(dot)ac(dot)uk>
To: Jim Nasby <jnasby(at)pervasive(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Column descriptions - could they be propagated to new
Date: 2006-04-07 07:51:14
Message-ID: Pine.LNX.4.63.0604070850250.7042@peneca.star.le.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Thu, 6 Apr 2006, Jim Nasby wrote:

> I seem to recall some astronomer having created some custom types for storing
> astronomical data in PostgreSQL. Or perhaps he was using PostGIS. I know that
> other astronomers are using PostgreSQL/PostGIS so if you look around you
> might be able to save yourself quite a bit of work.

Well I know about pgAstro and pgSphere (and helped a little in testing
them) but maybe there are others. Will look, thanks.

--
Clive Page
Dept of Physics & Astronomy,
University of Leicester,
Leicester, LE1 7RH, U.K.