Re: Add custom properties to a column's definition (pg_attribute) - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: Add custom properties to a column's definition (pg_attribute)
Date
Msg-id 52CF03A3.4090407@iol.ie
Whole thread Raw
In response to Add custom properties to a column's definition (pg_attribute)  (Brooke Beacham <brooke.beacham@technekes.com>)
Responses Re: Add custom properties to a column's definition (pg_attribute)  (Raymond O'Donnell <rod@iol.ie>)
List pgsql-general
On 09/01/2014 20:08, Brooke Beacham wrote:
> Can anyone suggest a way to associate a set of custom properties
> (key/value pairs) with a column's definition (ie pg_attribute)?
>
> (without having to replicate/maintain a table of columns separately from
> the system catalog)
>
> For example:
> * I have a table with 50 columns
> * I'd like to 'flag' 30 of those columns as group - 'A' and the other 20
> as group - 'B'
>
>
> So I'd like a way to add custom metdata (k/v pairs) to a column's
> definition (not the actual rows of data).

You could use the comment facility -

   COMMENT ON COLUMN tablename.columnname IS IS '....';

- to store some JSON or the like, though you'll have to parse it
client-side.

Ray.


--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie


pgsql-general by date:

Previous
From: Brooke Beacham
Date:
Subject: Add custom properties to a column's definition (pg_attribute)
Next
From: Raymond O'Donnell
Date:
Subject: Re: Add custom properties to a column's definition (pg_attribute)