Re: About primary keys -- made some progress

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tim Andersen <timander37(at)yahoo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: About primary keys -- made some progress
Date: 2003-08-16 12:36:11
Message-ID: 24415.1061037371@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tim Andersen <timander37(at)yahoo(dot)com> writes:
> I still have a question about how to get the
> information about length and precision of a column
> from pg_attributes.atttypmod. are there built-in
> functions for PostgreSQL to extract this information?

Best is to rely on the format_type() function. Also, have you thought
about using pg_get_indexdef() in place of all that hacking about in
pg_index?

http://www.postgresql.org/docs/7.3/static/functions-misc.html

In general, your code is less likely to break if you can use the
"catalog information functions" rather than poking around in the
catalogs directly.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ian Barwick 2003-08-16 16:56:57 Re: Optional join
Previous Message Hal Davison 2003-08-16 09:38:09 Do it exist?