Hi,
I would like to have a simple way to retrieve information for a field name.
By that I mean have some SQL select that will return all the tables a field
name exist within a database. I did not find anything with google but of
course google depends on the search string.
Thanks in advance,
Hi John,
everything you need is stored in these tables:
http://www.postgresql.org/docs/7.4/static/catalog-pg-attribute.html
http://www.postgresql.org/docs/7.4/static/catalog-pg-class.html
http://www.postgresql.org/docs/7.4/static/catalog-pg-namespace.html
On Tue, Apr 5, 2011 at 4:27 PM, John
On Tuesday, April 05, 2011 7:27:24 am John Fabiani wrote:
Hi,
I would like to have a simple way to retrieve information for a field name.
By that I mean have some SQL select that will return all the tables a field
name exist within a database. I did not find anything with google but of
You could also do something like:
select nspname, relname, attname
from pg_attribute a
JOIN pg_class c ON (a.attrelid = c.oid)
JOIN pg_namespace n ON (n.oid = c.relnamespace)
where a.attname ~ 'yourcolumn'
and c.relname !~ 'pg'
and n.nspname not in ('pg_catalog','information_schema')
order by
On Tuesday, April 05, 2011 07:44:51 am Adrian Klaver wrote:
On Tuesday, April 05, 2011 7:27:24 am John Fabiani wrote:
Hi,
I would like to have a simple way to retrieve information for a field
name. By that I mean have some SQL select that will return all the
tables a field name exist