Talk About Network

Google





Data Bases > Pgsql Interfaces Jdbc > Re: Patch for S...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 7 Topic 1866 of 2101
Post > Topic >>

Re: Patch for Statement.getGeneratedKeys()

by pg-user@[EMAIL PROTECTED] (Ken Johanson) Jan 16, 2008 at 01:12 AM

Tom Lane wrote:
> Right.  I suggest using regclass to obtain the OID of the referenced
> table, which then allows direct lookup in pg_attribute and other
> relevant catalogs.  Something along the line of
> 
> 	select attname from pg_attribute where attrelid = 't'::regclass
> 


Here is what I have so far (not sure of my conditionals yet or if I need 
any joins for them):

select attname from pg_attribute
where attrelid = 'postgres.public.test'::regclass
and attstattarget=-1
and attisdropped='f'
order by attnum asc

Very simple and elegant, you guys rule.

Couple things I want to verify - will this regclass method have any 
cases where security would make it less reliable than say, using pg_*? 
Also compatibility issues?: are there any server or session/driver modes 
that would somehow prevent this from working?

ken



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@[EMAIL PROTECTED]
 so that your
       message can get through to the mailing list cleanly
 




 7 Posts in Topic:
Re: Patch for Statement.getGeneratedKeys()
books@[EMAIL PROTECTED]   2008-01-15 02:27:46 
Re: Patch for Statement.getGeneratedKeys()
tgl@[EMAIL PROTECTED] (T  2008-01-15 10:32:10 
Re: Patch for Statement.getGeneratedKeys()
pg-user@[EMAIL PROTECTED]  2008-01-16 00:09:29 
Re: Patch for Statement.getGeneratedKeys()
tgl@[EMAIL PROTECTED] (T  2008-01-16 02:38:37 
Re: Patch for Statement.getGeneratedKeys()
pg-user@[EMAIL PROTECTED]  2008-01-16 01:12:13 
Re: Patch for Statement.getGeneratedKeys()
tgl@[EMAIL PROTECTED] (T  2008-01-16 10:01:58 
Re: Patch for Statement.getGeneratedKeys()
tivvpgsqljdbc@[EMAIL PROT  2008-01-16 11:30:22 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Fri Jan 9 20:29:48 PST 2009.