pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedObject types and ResultSets (java.sql.Struct)
6+ messages / 3 participants
[nested] [flat]
* Object types and ResultSets (java.sql.Struct)
@ 2010-01-23 16:39 Thomas Kellerer <spam_eater@gmx.net>
2010-01-29 21:43 ` Re: Object types and ResultSets (java.sql.Struct) Kris Jurka <books@ejurka.com>
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Kellerer @ 2010-01-23 16:39 UTC (permalink / raw)
To: pgsql-jdbc
Hi,
I noticed that "object types" are not treated in a consistent manner
Taking the following table:
CREATE TYPE person_type AS
(
first_name VARCHAR(20),
last_name VARCHAR(25)
)
CREATE TABLE contacts
(
id integer,
contact person_type
)
DatabaseMetaData.getColumns() will return a java.sql.Types.STRUCT for the column "contact".
That seems to be correct to me - at least this is what I expected ;)
When running a "SELECT * FROM contacts", ResultSetMetaData.getColumnType() will return java.sql.Types.OTHER (for the contact column)
This seems to be inconsistent to me.
My expectation was that ResultSetMetaData.getColumnType() should also return java.sql.Types.STRUCT and that the object returned by getObject() on the ResultSet should implement java.sql.Struct (which it doesn't)
Regards
Thomas
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Object types and ResultSets (java.sql.Struct)
2010-01-23 16:39 Object types and ResultSets (java.sql.Struct) Thomas Kellerer <spam_eater@gmx.net>
@ 2010-01-29 21:43 ` Kris Jurka <books@ejurka.com>
2010-08-10 20:00 ` Re: Object types and ResultSets (java.sql.Struct) Kris Jurka <books@ejurka.com>
0 siblings, 1 reply; 6+ messages in thread
From: Kris Jurka @ 2010-01-29 21:43 UTC (permalink / raw)
To: Thomas Kellerer <spam_eater@gmx.net>; +Cc: pgsql-jdbc
On Sat, 23 Jan 2010, Thomas Kellerer wrote:
> DatabaseMetaData.getColumns() will return a java.sql.Types.STRUCT for the
> column "contact".
> That seems to be correct to me - at least this is what I expected ;)
>
> When running a "SELECT * FROM contacts", ResultSetMetaData.getColumnType()
> will return java.sql.Types.OTHER (for the contact column)
>
> This seems to be inconsistent to me.
>
> My expectation was that ResultSetMetaData.getColumnType() should also return
> java.sql.Types.STRUCT
That should be easy enough to fix. I'll take a look.
> and that the object returned by getObject() on the
> ResultSet should implement java.sql.Struct (which it doesn't)
>
That one will take some more work. I wouldn't hold my breath on that one.
Kris Jurka
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Object types and ResultSets (java.sql.Struct)
2010-01-23 16:39 Object types and ResultSets (java.sql.Struct) Thomas Kellerer <spam_eater@gmx.net>
2010-01-29 21:43 ` Re: Object types and ResultSets (java.sql.Struct) Kris Jurka <books@ejurka.com>
@ 2010-08-10 20:00 ` Kris Jurka <books@ejurka.com>
2010-08-10 21:00 ` Re: Object types and ResultSets (java.sql.Struct) Andreas Joseph Krogh <andreak@officenet.no>
0 siblings, 1 reply; 6+ messages in thread
From: Kris Jurka @ 2010-08-10 20:00 UTC (permalink / raw)
To: Thomas Kellerer <spam_eater@gmx.net>; +Cc: pgsql-jdbc
On Fri, 29 Jan 2010, Kris Jurka wrote:
> On Sat, 23 Jan 2010, Thomas Kellerer wrote:
>
>> DatabaseMetaData.getColumns() will return a java.sql.Types.STRUCT for the
>> column "contact".
>> That seems to be correct to me - at least this is what I expected ;)
>>
>> When running a "SELECT * FROM contacts", ResultSetMetaData.getColumnType()
>> will return java.sql.Types.OTHER (for the contact column)
>>
>> This seems to be inconsistent to me.
>>
>> My expectation was that ResultSetMetaData.getColumnType() should also
>> return java.sql.Types.STRUCT
>
> That should be easy enough to fix. I'll take a look.
I've applied a fix to this for 8.3, 8.4, and 9.0 in CVS.
Kris Jurka
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Object types and ResultSets (java.sql.Struct)
2010-01-23 16:39 Object types and ResultSets (java.sql.Struct) Thomas Kellerer <spam_eater@gmx.net>
2010-01-29 21:43 ` Re: Object types and ResultSets (java.sql.Struct) Kris Jurka <books@ejurka.com>
2010-08-10 20:00 ` Re: Object types and ResultSets (java.sql.Struct) Kris Jurka <books@ejurka.com>
@ 2010-08-10 21:00 ` Andreas Joseph Krogh <andreak@officenet.no>
2010-08-10 21:05 ` Re: Object types and ResultSets (java.sql.Struct) Kris Jurka <books@ejurka.com>
0 siblings, 1 reply; 6+ messages in thread
From: Andreas Joseph Krogh @ 2010-08-10 21:00 UTC (permalink / raw)
To: pgsql-jdbc
On 08/10/2010 10:00 PM, Kris Jurka wrote:
>
>
> On Fri, 29 Jan 2010, Kris Jurka wrote:
>
>> On Sat, 23 Jan 2010, Thomas Kellerer wrote:
>>
>>> DatabaseMetaData.getColumns() will return a java.sql.Types.STRUCT
>>> for the column "contact".
>>> That seems to be correct to me - at least this is what I expected ;)
>>>
>>> When running a "SELECT * FROM contacts",
>>> ResultSetMetaData.getColumnType() will return java.sql.Types.OTHER
>>> (for the contact column)
>>>
>>> This seems to be inconsistent to me.
>>>
>>> My expectation was that ResultSetMetaData.getColumnType() should
>>> also return java.sql.Types.STRUCT
>>
>> That should be easy enough to fix. I'll take a look.
>
> I've applied a fix to this for 8.3, 8.4, and 9.0 in CVS.
>
What about this?
>> and that the object returned by getObject() on the
>> ResultSet should implement java.sql.Struct (which it doesn't)
>
>That one will take some more work. I wouldn't hold my breath on that
one.
Without proper support for Struct returning custom-types (i.e. arrays of
arrays) becomes a pain. Any word on this?
--
Andreas Joseph Krogh<andreak@officenet.no>
Senior Software Developer / CTO
------------------------+---------------------------------------------+
OfficeNet AS | The most difficult thing in the world is to |
Rosenholmveien 25 | know how to do a thing and to watch |
1414 TrollÄsen | somebody else doing it wrong, without |
NORWAY | comment. |
| |
Tlf: +47 24 15 38 90 | |
Fax: +47 24 15 38 91 | |
Mobile: +47 909 56 963 | |
------------------------+---------------------------------------------+
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Object types and ResultSets (java.sql.Struct)
2010-01-23 16:39 Object types and ResultSets (java.sql.Struct) Thomas Kellerer <spam_eater@gmx.net>
2010-01-29 21:43 ` Re: Object types and ResultSets (java.sql.Struct) Kris Jurka <books@ejurka.com>
2010-08-10 20:00 ` Re: Object types and ResultSets (java.sql.Struct) Kris Jurka <books@ejurka.com>
2010-08-10 21:00 ` Re: Object types and ResultSets (java.sql.Struct) Andreas Joseph Krogh <andreak@officenet.no>
@ 2010-08-10 21:05 ` Kris Jurka <books@ejurka.com>
2010-08-10 21:07 ` Re: Object types and ResultSets (java.sql.Struct) Andreas Joseph Krogh <andreak@officenet.no>
0 siblings, 1 reply; 6+ messages in thread
From: Kris Jurka @ 2010-08-10 21:05 UTC (permalink / raw)
To: Andreas Joseph Krogh <andreak@officenet.no>; +Cc: pgsql-jdbc
On Tue, 10 Aug 2010, Andreas Joseph Krogh wrote:
> Without proper support for Struct returning custom-types (i.e. arrays of
> arrays) becomes a pain. Any word on this?
>
Composite type support is a big job that's not going to happen for 9.0.
Kris Jurka
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Object types and ResultSets (java.sql.Struct)
2010-01-23 16:39 Object types and ResultSets (java.sql.Struct) Thomas Kellerer <spam_eater@gmx.net>
2010-01-29 21:43 ` Re: Object types and ResultSets (java.sql.Struct) Kris Jurka <books@ejurka.com>
2010-08-10 20:00 ` Re: Object types and ResultSets (java.sql.Struct) Kris Jurka <books@ejurka.com>
2010-08-10 21:00 ` Re: Object types and ResultSets (java.sql.Struct) Andreas Joseph Krogh <andreak@officenet.no>
2010-08-10 21:05 ` Re: Object types and ResultSets (java.sql.Struct) Kris Jurka <books@ejurka.com>
@ 2010-08-10 21:07 ` Andreas Joseph Krogh <andreak@officenet.no>
0 siblings, 0 replies; 6+ messages in thread
From: Andreas Joseph Krogh @ 2010-08-10 21:07 UTC (permalink / raw)
To: pgsql-jdbc
On 08/10/2010 11:05 PM, Kris Jurka wrote:
>
>
> On Tue, 10 Aug 2010, Andreas Joseph Krogh wrote:
>
>> Without proper support for Struct returning custom-types (i.e. arrays of
>> arrays) becomes a pain. Any word on this?
>>
>
> Composite type support is a big job that's not going to happen for 9.0.
For what it's worth I hope it will be a priority for 9.1 as PG+JAVA
provides pretty much everything else I need, except returning more
complex structures to JAVA.
--
Andreas Joseph Krogh<andreak@officenet.no>
Senior Software Developer / CTO
------------------------+---------------------------------------------+
OfficeNet AS | The most difficult thing in the world is to |
Rosenholmveien 25 | know how to do a thing and to watch |
1414 TrollÄsen | somebody else doing it wrong, without |
NORWAY | comment. |
| |
Tlf: +47 24 15 38 90 | |
Fax: +47 24 15 38 91 | |
Mobile: +47 909 56 963 | |
------------------------+---------------------------------------------+
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2010-08-10 21:07 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-01-23 16:39 Object types and ResultSets (java.sql.Struct) Thomas Kellerer <spam_eater@gmx.net>
2010-01-29 21:43 ` Kris Jurka <books@ejurka.com>
2010-08-10 20:00 ` Kris Jurka <books@ejurka.com>
2010-08-10 21:00 ` Andreas Joseph Krogh <andreak@officenet.no>
2010-08-10 21:05 ` Kris Jurka <books@ejurka.com>
2010-08-10 21:07 ` Andreas Joseph Krogh <andreak@officenet.no>
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