Query to fetch all lo and oid tables/columns in a database

Поиск
Список
Период
Сортировка
От Denis Gasparin
Тема Query to fetch all lo and oid tables/columns in a database
Дата
Msg-id 200112060948.fB69mvm53199@postgresql.org
обсуждение исходный текст
Список pgsql-general
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


В списке pgsql-general по дате отправления:

Предыдущее
От: Karel Zak
Дата:
Сообщение: Re: Casting Varchar to Numeric
Следующее
От: Erwin Ambrosch
Дата:
Сообщение: Number of Connections