Re: [INTERFACES] libpgtcl and array fields return format - PROPOSAL

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [INTERFACES] libpgtcl and array fields return format - PROPOSAL
Дата
Msg-id 7653.934382778@sss.pgh.pa.us
обсуждение исходный текст
Ответ на libpgtcl and array fields return format - PROPOSAL  (Constantin Teodorescu <teo@flex.ro>)
Список pgsql-interfaces
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


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Constantin Teodorescu
Дата:
Сообщение: Re: [INTERFACES] Regarding selction of query
Следующее
От: Constantin Teodorescu
Дата:
Сообщение: Re: [INTERFACES] libpgtcl and array fields return format - PROPOSAL