From: Chris Hoover <revoohc@gmail.com>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Where to get column length
Date: Fri, 5 May 2006 11:01:45 -0400
Message-ID: <1d219a6f0605050801n43054504j112a62f10c8fcc59@mail.gmail.com> (raw)
I know it is in the docs, but right now I can't see it.
How do I pull the length of a specific varchar column? I have just found a
problem with our schema being out of sync on one specific column, and need
to find out how many of our 200+ databases need to be fixed.
Here is what I have so far:
select *
from pg_class, pg_attribute
where pg_class.relkind = 'r' and
pg_attribute.attrelid = pg_class.oid and
pg_class.relname = 'mytable' and
pg_attribute.attname = 'problem_column' and
???? != 256; -- need to report anytime this column is not a varchar(256).
Thanks,
Chris
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: revoohc@gmail.com
Subject: Re: Where to get column length
In-Reply-To: <1d219a6f0605050801n43054504j112a62f10c8fcc59@mail.gmail.com>
References: <1d219a6f0605050801n43054504j112a62f10c8fcc59@mail.gmail.com>
* 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