From: Tom Lane <tgl@sss.pgh.pa.us>
To: Constantin Teodorescu <teo@flex.ro>
Cc: PostgreSQL Interfaces <pgsql-interfaces@postgreSQL.org>
Subject: Re: [INTERFACES] libpgtcl and array fields return format - PROPOSAL
Date: Wed, 11 Aug 1999 10:46:18 -0400
Message-ID: <7653.934382778@sss.pgh.pa.us> (raw)
In-Reply-To: <37B1178F.1BDFB003@flex.ro>
Constantin Teodorescu <teo@flex.ro> writes:
> In libpgtcl, pg_select an array field is return as the following string:
> {"red","blue","green"}
> and it's rather difficult to process them as a normal tcl list.
> I think it would be better to return the string as:
> "red" "blue" "green"
> and tcl users could directly process the array as an ordinary tcl list.
Only problem is, how do you know when to make the transformation?
It's not that easy to tell in libpq/libpgtcl whether a column has
array type or not, and I think stripping '{' ... '}' off a plain
text value would be a big no-no.
As you noticed later, there is some optional TCL_ARRAYS code that
purports to do something like this, but I think it's pretty broken.
What seems like it would be fairly safe is to introduce separate Tcl
functions that convert between Postgres array format and Tcl list
format, and leave it to the user to apply these functions to data that
he knows is arrays...
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: tgl@sss.pgh.pa.us, teo@flex.ro
Subject: Re: [INTERFACES] libpgtcl and array fields return format - PROPOSAL
In-Reply-To: <7653.934382778@sss.pgh.pa.us>
* 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