Re: driver fails to handle strings in query statements properly

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Barry Lind <barry(at)xythos(dot)com>
Cc: Dave(at)micro-automation(dot)net, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: driver fails to handle strings in query statements properly
Date: 2001-10-02 21:19:21
Message-ID: 19379.1002057561@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Barry Lind <barry(at)xythos(dot)com> writes:
> My thoughts as well. If we encounter an 'unknown' type, just return it
> as a String. Do you have time to fix this?

>> I suppose we could return it as a string when we are in doubt? Is this
>> reasonable since there are many other types it should be returned as?

The backend will presently default to treating 'unknown' as type 'text'
if it hasn't got any better idea what to do, so I think it's reasonable
for JDBC to do likewise.

I believe the only case in which you could see 'unknown' reported as a
query result type is if a string literal is SELECTed without any
processing being done on it, viz

SELECT 'foo'

As soon as the literal is passed to a function or operator, sorted,
grouped, etc, the system will insist on resolving it to a non-unknown
type. If the usage context doesn't provide any other hint, 'text' will
be the chosen type.

regards, tom lane

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2001-10-02 21:22:52 Re: LOCK TABLE oddness in PLpgSQL function called via JDBC
Previous Message Dave Harkness 2001-10-02 21:09:27 Re: LOCK TABLE oddness in PLpgSQL function called via JDBC