Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id AE0672E3046 for ; Fri, 14 Dec 2007 00:14:57 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 59510-08 for ; Fri, 14 Dec 2007 00:14:54 -0400 (AST) Received: from www01.kensystem.com (www01.kensystem.com [72.19.170.120]) by postgresql.org (Postfix) with ESMTP id 4FA8C2E3005 for ; Fri, 14 Dec 2007 00:14:54 -0400 (AST) Received: from 192.168.0.3 by www01.kensystem.com (SMTPD); id s20071213211451.62750; Thu, 13 Dec 2007 21:14:51 Message-ID: <4762033B.9080004@kensystem.com> Date: Thu, 13 Dec 2007 21:14:51 -0700 From: Ken Johanson User-Agent: Thunderbird 1.5.0.13 (Windows/20070809) MIME-Version: 1.0 To: Kris Jurka CC: pgsql-general@postgresql.org Subject: Re: RETURNING clause: how to specifiy column indexes? References: <22a9f7570703301215y44a937d0r5faa706bad7948c@mail.gmail.com> <4610AA0C.30608@ejurka.com> <47579D44.6060005@kensystem.com> <47579FBE.1070503@kensystem.com> <475F7766.2040005@kensystem.com> <12796.1197439644@sss.pgh.pa.us> <4760D33E.40004@kensystem.com> <4760DC91.8090103@kensystem.com> <4761D2DF.4080204@kensystem.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/945 X-Sequence-Number: 125688 Kris Jurka wrote: > > 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. > Do you have an equivalent query/join handy that will get the catalog and schema and table and column names frm the pg tables? SELECT column_name FROM information_schema.columns WHERE table_catalog=? AND table_schema=? AND table_name=? ORDER BY ordinal_position