Search Postgresql Archives

Re: How to change pg_trigger query so that it works in 9.0 without pg_trigger.tgisconstraint does not exist error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/10/16 Andrus Moor <eetasoft@xxxxxxxxx>:
> In 9.0 query below returns error
>
> 7/42703:ERROR: column pg_trigger.tgisconstraint does not exist
>
> How to change it so that it works in all servers starting at 8.0 (or at
> least
> from 8.1) to 9.0 ?
> Or if this is not possible how to fix it so that it works in 9 ?
>
> Andrus
>
> SELECT
>  pg_catalog.pg_get_triggerdef(pg_trigger.oid) as trdef
> FROM pg_catalog.pg_trigger
> join pg_catalog.pg_class on pg_trigger.tgrelid = pg_class.oid
> JOIN pg_catalog.pg_namespace ON pg_namespace.oid=pg_class.relnamespace
> WHERE not pg_trigger.tgisconstraint
> and pg_namespace.nspname='firma1'

For 9.0, maybe change the WHERE clause to:

WHERE pg_trigger.tgconstraint = 0 AND
               pg_namespace.nspname='firma1'

Josh

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux