From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tim Andersen <timander37@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: About primary keys -- made some progress
Date: Sat, 16 Aug 2003 08:36:11 -0400
Message-ID: <24415.1061037371@sss.pgh.pa.us> (raw)
In-Reply-To: <20030816041559.74395.qmail@web10006.mail.yahoo.com>
References: <20030816041559.74395.qmail@web10006.mail.yahoo.com>
Tim Andersen <timander37@yahoo.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, timander37@yahoo.com
Subject: Re: About primary keys -- made some progress
In-Reply-To: <24415.1061037371@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox