pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Carl Olivier <carl@zero-one.co.za>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: DatabaseMetaData and Transactions
Date: Wed, 08 Jun 2005 09:38:34 +1200
Message-ID: <42A613DA.7090300@opencloud.com> (raw)
In-Reply-To: <473185057AB4D7118B6C00508B624DDA1C96BB@ALPHENPDC>
References: <473185057AB4D7118B6C00508B624DDA1C96BB@ALPHENPDC>

Carl Olivier wrote:

> Now - the reason we do a setString(index, null) and not a setNull(index,
> Types.SOME_TYPE) is because this method is generic and does not always KNOW
> the datatypes for the columns.

> ERROR: column "created_by" is of type integer but expression is of type
> character varying

> Does anyone have any comments/suggestions/etc?  Is there any way to get
> around this?  Or will we need to update our side to always pass in the
> column meta data etc for use?

You're going to have to pass metadata down, or change your queries to
explicitly cast the parameters in the SQL itself. The driver has exactly
the same problem as your code does -- with the v3 protocol it needs to
provide a type for the parameter, but if it's just provided as a string
the only type it can assume is text..

-O



view thread (9+ messages)  latest in thread

Message-ID: <42A613DA.7090300@opencloud.com>
Permalink:  ../42A613DA.7090300@opencloud.com/
Also on:    postgresql.org/message-id/42A613DA.7090300@opencloud.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: oliver@opencloud.com, carl@zero-one.co.za
  Subject: Re: DatabaseMetaData and Transactions
  In-Reply-To: <42A613DA.7090300@opencloud.com>
  References: <473185057AB4D7118B6C00508B624DDA1C96BB@ALPHENPDC> <42A613DA.7090300@opencloud.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox