Query to fetch all lo and oid tables/columns in a database
В списке pgsql-general по дате отправления:
| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера