Re: [HACKERS] Array types

2009-04-08 Thread Merlin Moncure
On Wed, Apr 8, 2009 at 11:35 AM, Greg Stark wrote: > On Wed, Apr 8, 2009 at 4:11 PM, John Lister > wrote: >> Cheers for the pointers. Am i right in thinking that if i get an array of >> arrays, the nested arrays are sent in wire format as well - it seems to be >> from the docs. > > No, you can't

Re: [HACKERS] Array types

2009-04-08 Thread John Lister
On Wed, Apr 8, 2009 at 4:11 PM, John Lister wrote: Cheers for the pointers. Am i right in thinking that if i get an array of arrays, the nested arrays are sent in wire format as well - it seems to be from the docs. No, you can't easily get an array of arrays in Postgres. You can get multi

Re: [HACKERS] Array types

2009-04-08 Thread Greg Stark
On Wed, Apr 8, 2009 at 4:11 PM, John Lister wrote: > Cheers for the pointers. Am i right in thinking that if i get an array of > arrays, the nested arrays are sent in wire format as well - it seems to be > from the docs. No, you can't easily get an array of arrays in Postgres. You can get multi-d

Re: [HACKERS] Array types

2009-04-08 Thread Tom Lane
"John Lister" writes: > Cheers for the pointers. Am i right in thinking that if i get an array of > arrays, the nested arrays are sent in wire format as well - it seems to be > from the docs. Postgres doesn't have arrays of arrays. There are multi-dimensional arrays, which aren't conceptually

Re: [HACKERS] Array types

2009-04-08 Thread Andrew Dunstan
Merlin Moncure wrote: On Wed, Apr 8, 2009 at 10:48 AM, John Lister wrote: Following this up, is there any docs on the binary wire format for arrays? Thanks Does java wrap libpq? No. The JDBC driver is a Type 4 pure java driver. It implements the wire protocol. That's is w

Re: [HACKERS] Array types

2009-04-08 Thread John Lister
No unfortunately not, it is a JDBC type 4 java which is entirely written in java. I've patched (as pointed out in another list) the base version to handle binary data (still a couple of issues that seem unfinished) which has given me clues, but the patch only supports simple types. I'm looking t

Re: [HACKERS] Array types

2009-04-08 Thread John Lister
ril 08, 2009 4:07 PM Subject: Re: [HACKERS] Array types Andrew Chernow wrote: John Lister wrote: Following this up, is there any docs on the binary wire format for arrays? None that I know of. Check out the backend source: (array_recv() and array_send() functions) http://anoncvs.postgresql.org/

Re: [HACKERS] Array types

2009-04-08 Thread Merlin Moncure
On Wed, Apr 8, 2009 at 10:48 AM, John Lister wrote: > Following this up, is there any docs on the binary wire format for arrays? > > Thanks > Does java wrap libpq? If so, your best bet is probably going to be to go the libpqtypes route. If you want help doing that, you are more than welcome to a

Re: [HACKERS] Array types

2009-04-08 Thread Andrew Chernow
Andrew Chernow wrote: John Lister wrote: Following this up, is there any docs on the binary wire format for arrays? None that I know of. Check out the backend source: (array_recv() and array_send() functions) http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/arrayfuncs.c?

Re: [HACKERS] Array types

2009-04-08 Thread Andrew Chernow
John Lister wrote: Following this up, is there any docs on the binary wire format for arrays? None that I know of. Check out the backend source: (array_recv() and array_send() functions) http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/arrayfuncs.c?rev=1.154 Or, look at

Re: [HACKERS] Array types

2009-04-08 Thread John Lister
Following this up, is there any docs on the binary wire format for arrays? Thanks - Original Message - From: John Lister To: pgsql-hackers@postgresql.org Sent: Tuesday, April 07, 2009 7:54 PM Subject: [HACKERS] Array types Hi, using v8.3.5 and a number of client libraries

Re: [HACKERS] Array types

2009-04-08 Thread John Lister
brilliant i'll give it a go... Now to sort out java :) James Pye wrote: On Apr 7, 2009, at 12:54 PM, John Lister wrote: Cheers, nice to know it is possible... Now to see if i can get java/python to do the same :) or to use a modified libpq somehow... http://python.projects.postgresql.org wi

Re: [HACKERS] Array types

2009-04-07 Thread Merlin Moncure
On Tue, Apr 7, 2009 at 6:42 PM, James Pye wrote: > On Apr 7, 2009, at 12:54 PM, John Lister wrote: > >> Cheers, nice to know it is possible... Now to see if i can get java/python >> to do the same :) or to use a modified libpq somehow... > > http://python.projects.postgresql.org will do it for Pyt

Re: [HACKERS] Array types

2009-04-07 Thread James Pye
On Apr 7, 2009, at 12:54 PM, John Lister wrote: Cheers, nice to know it is possible... Now to see if i can get java/ python to do the same :) or to use a modified libpq somehow... http://python.projects.postgresql.org will do it for Python. =D tho, only supports Python 3, which is still quite

Re: [HACKERS] Array types

2009-04-07 Thread Andrew Chernow
John Lister wrote: They all return arrays as text, is it possible to configure postgresql to return an array in native form (does postgresql support such a thing)? This is using both the simple and extended query forms - i couldn't see a way to say what return type i wanted in the protocol docs

Re: [HACKERS] Array types

2009-04-07 Thread John Lister
Cheers, nice to know it is possible... Now to see if i can get java/python to do the same :) or to use a modified libpq somehow... Merlin Moncure wrote: On Tue, Apr 7, 2009 at 3:35 PM, John Lister wrote: Does libpqtypes pass the array "over the wire" as an array? Ideally i'd like to do th

Re: [HACKERS] Array types

2009-04-07 Thread Andrew Chernow
John Lister wrote: Cheers, nice to know it is possible... Now to see if i can get java/python to do the same :) or to use a modified libpq somehow... If performance is your concern, you would probably get the best results using the languages C glue interfrace. For instance, in java I think

Re: [HACKERS] Array types

2009-04-07 Thread Merlin Moncure
On Tue, Apr 7, 2009 at 3:35 PM, John Lister wrote: > Does libpqtypes pass the array "over the wire" as an array? Ideally i'd like > to do this with jdbc, but might give me a pointer... We send/receive the server's array format. This is not quite a C array, and is definitely not a java array. It

Re: [HACKERS] Array types

2009-04-07 Thread John Lister
Does libpqtypes pass the array "over the wire" as an array? Ideally i'd like to do this with jdbc, but might give me a pointer... Thanks - Original Message - From: "Andrew Chernow" To: "John Lister" Cc: Sent: Tuesday, April 07, 2009 8:15 PM

Re: [HACKERS] Array types

2009-04-07 Thread John Lister
This is something the client code would request (or not). It would not be sensible to try to force it from the server side, since if the client doesn't request it it's likely that the client wouldn't understand the data format. Cheers for the quick reply, any chance of a pointer to the protocol

Re: [HACKERS] Array types

2009-04-07 Thread Merlin Moncure
On Tue, Apr 7, 2009 at 3:11 PM, Tom Lane wrote: > "John Lister" writes: >> Hi, using v8.3.5 and a number of client libraries (java, python, pgadmin) >> and playing about with arrays. >> They all return arrays as text, is it possible to configure postgresql >> to return an array in native form (d

Re: [HACKERS] Array types

2009-04-07 Thread Tom Lane
"John Lister" writes: > Hi, using v8.3.5 and a number of client libraries (java, python, pgadmin) and > playing about with arrays. > They all return arrays as text, is it possible to configure postgresql > to return an array in native form (does postgresql support such a > thing)? This is someth

[HACKERS] Array types

2009-04-07 Thread John Lister
Hi, using v8.3.5 and a number of client libraries (java, python, pgadmin) and playing about with arrays. They all return arrays as text, is it possible to configure postgresql to return an array in native form (does postgresql support such a thing)? This is using both the simple and extended qu