Re: RETURNING clause: how to specifiy column indexes? - Mailing list pgsql-general

From Kris Jurka
Subject Re: RETURNING clause: how to specifiy column indexes?
Date
Msg-id Pine.BSO.4.64.0712132104040.22816@leary.csoft.net
Whole thread Raw
In response to Re: RETURNING clause: how to specifiy column indexes?  (Ken Johanson <pg-user@kensystem.com>)
Responses Re: RETURNING clause: how to specifiy column indexes?
List pgsql-general

On Thu, 13 Dec 2007, Ken Johanson wrote:

> Here is the query I will call to the get the name of columns by ordinal
> position. Do you see any compatibility drivers will older server versions, or
> other issues?
>
> SELECT column_name
> FROM information_schema.columns
> WHERE table_catalog=? AND table_schema=? AND table_name=?
> ORDER BY ordinal_position
>

Using pg_catalog tables is better than using information_schema because of
the way permissions work.  For information_schema you must be the table
owner, while people who only have permissions to access a table will most
likely be able to read pg_catalog.

Kris Jurka


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: plpgsql trigger coredumps instance
Next
From: Ow Mun Heng
Date:
Subject: HouseKeeping and vacuum Questions