Re: column information from view

2018-09-14 Thread Sebastian P . Luque
On Fri, 14 Sep 2018 18:29:27 -0400, Tom Lane wrote: > "Sebastian P. Luque" writes: >> Tom Lane wrote: >>> Personally, I'd probably write it something like this: >>> select pa.attnum, pa.attname, col_description(pa.attrelid, >>> pa.

Re: column information from view

2018-09-14 Thread Sebastian P . Luque
On Fri, 14 Sep 2018 17:52:28 -0400, Tom Lane wrote: > Umm ... why are you doing cols.table_name = 'persistent_view' and not > cols.table_name = 'temporary_view' ? I should have pointed out that the column descriptions are all NULL in the temporary view, and I'd like to pull them from the persist

Re: column information from view

2018-09-14 Thread Sebastian P. Luque
On Fri, 14 Sep 2018 14:47:07 -0700, Adrian Klaver wrote: > SELECT cols.ordinal_position, cols.column_name, > col_description(cl.oid, cols.ordinal_position::INT) > FROM pg_class cl, information_schema.columns cols > WHERE cols.table_catalog='aquaculture' AND cols.table_schema ilike > 'pg_temp%'

column information from view

2018-09-14 Thread Sebastian P. Luque
Hello, I'm trying to generate a table with information on columns from a temporary view that simply selects a subset of columns from a persistent view in a given schema. The persistent view joins a number of tables with columns that may or may not have a description entered. I need a table with