ra@konvergencia.hu wrote:
> On Tuesday 10 August 2004 03:14, Olivier Guilyardi wrote:
>
>>SELECT viewname FROM pg_views WHERE viewname !~ '^pg_';
>
> with 7.4 :
>
> SELECT viewname FROM pg_views WHERE schemaname NOT IN
> ('pg_catalog','information_schema');
For me, the best is an identical query for both 7.2 and 7.4. Since
the pg_views schemaname field does not exist in 7.2, this last query
is going to raise an error.
Let's take, say :
SELECT viewname FROM pg_views
WHERE schemaname NOT IN ('pg_catalog','information_schema')
AND viewname !~ '^pg_';
Is there an SQL trick so that this does not raise an error in 7.2 ?
Something like IF FIELD EXISTS (this is pseudo-code) ?
--
og