|
|||||||||||
|
Re: [JDBC] Patch for Statement.getGeneratedKeys()
From: Ken Johanson <pg-user(at)kensystem.com>
Date: Wed Jan 16 2008 - 02:09:29 EST
>> You need to look through the schemas in the search_path in order and see >> which one a table with the given name appears in first. > > I've lost track of the context in which this needs to be done, but in > some cases a cast to or from regclass offers a painless way to > disambiguate table names. Just a suggestion ... > Tom, can you offer an example of this and how the overall goal might be achieved? Kris, please jump in where I'm missing anything:
#Overview:
Current strategy is to find the natural column order (ordinal positions for columnIndexes[]) and extract those names, passing them through to: Statement.executeUpdate(String sql, String columnIndexes[]) To get the column names, I need to look in [the pg_* table equiv to information_schema] tables, and of course this means knowing which table is being referenced for modification. We are already parsing the table name (fully or partially qualified) from the DML; now we need to search [information_schema], finding the matching catalog, schema, and table, and searching schema in the order of the schema search-path.
#History
#Now
#Questions: -would the regclass-cast technique (I have no experience with it) work directly in the RETURNING or need to be in the [information_schema] query? Can you point me to examples? -would it be feasible to modify RETURNING in new server versions to accept indexes as args? That would obviate this whole discussion.
Thanks,
---------------------------(end of broadcast)---------------------------TIP 7: You can help support the PostgreSQL project by donating at
http://www.postgresql.org/about/donate
Received on Wed Jan 16 02:10:39 2008This archive was generated by hypermail 2.1.8 : Wed Jun 18 2008 - 23:42:54 EDT |
||||||||||
|
|||||||||||