I have a database with lo (the type for large objects used by the odbc driver
) and oid (the default type for large objects in postgres).
I need to find all the tables (and respective columns) in the database
containing large objects ( lo and oid ).
Is the following query correct?
select c.relname,a.attname from pg_class c, pg_attribute a
where
( format_type(a.atttypid, a.atttypmod)='lo'
or format_type(a.atttypid, a.atttypmod)='oid' )
and a.attrelid=c.oid and a.attnum > 0
and c.relkind = 'r' and c.relname !~ '^pg_'
I have tested my query with two tables in the database containing both oid
and lo types and it worked.
I would know if there is any case in which this query could fetch any column
that doesn't contain large objects (those in pg_largeobject).
(surely this period contains some grammar mistakes... sorry ;-) )
--
Ing. Denis Gasparin: denis@edistar.com
---------------------------
Programmer & System Administrator - Edistar srl
www.edistar.com