Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Interfaces Jdbc > Re: Howto set U...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 1860 of 2028
Post > Topic >>

Re: Howto set UUID parameter for PGSQL 8.3rc1 / postgresql-8.3dev-602.jdbc3.jar

by sbierman@[EMAIL PROTECTED] (Silvio Bierman) Jan 14, 2008 at 06:08 PM

Silvio Bierman wrote:
> Hello all,
>
> I am trying to convert an older PG database where we stored GUID keys 
> by explicitly converting them to byte arrays before storing them in  
> bytea columns in the DB to a database where we use the new UUID type 
> sup****ted by PG 8.3.
>
> I am having trouble setting such a value through a JDBC 
> PreparedStatement because any stmt.setXXX(i,...) I have tried results 
> in an error about a mismatch between type UUID and XXX.
>
> How can I get my PreparedStatement to work correctly?
>
> Kind regards,
>
> Silvio Bierman
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>       choose an index scan if your joining column's datatypes do not
>       match
Someone at comp.databases.postgresql suggested I change the SQL to do an 
explicit cast from string to UUID. Unfortunately (well, in this case 
anyway) we use the same code and SQL strings for Orcacle, MSSQLServer, 
MySQl, MaxDB/SapDB and PostgreSQL so this is not a viable solution. We 
do have a backend specific adapter class so there is a call

adapter.setGUID(PreparedStatement stmt,int idx,String guidValue)

that I get to implement to accomodate for PG UUIDs but there is no way 
to tweak the SQL, the statement is already prepared.

In my opinion at least one external type should be allowed to map 
implicitly to UUID just as the SQLServer driver allows the mapping of an 
adequately formatted string to a uniqeuidentifier (=uuid) column. PG 
allows this internally, I just need sup****t for this through the JDBC 
driver.

Any chance this will be allowed? If not I will need to continue to use 
bytea as my GUID representation.

Kind regards,

Silvio Bierman


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org
 




 3 Posts in Topic:
Howto set UUID parameter for PGSQL 8.3rc1 / postgresql-8.3dev-60
sbierman@[EMAIL PROTECTED  2008-01-12 23:13:46 
Re: Howto set UUID parameter for PGSQL 8.3rc1 / postgresql-8.3de
sbierman@[EMAIL PROTECTED  2008-01-14 18:08:11 
Re: Howto set UUID parameter for PGSQL 8.3rc1 / postgresql-8.3de
oliver@[EMAIL PROTECTED]   2008-01-15 16:01:39 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Sun Sep 7 6:49:16 CDT 2008.