Re: selecting array slice problem

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: selecting array slice problem
Дата
Msg-id 20060120025845.GA30818@winnie.fuhr.org
обсуждение исходный текст
Ответ на selecting array slice problem  (Alex Jiang <ajiangenator@gmail.com>)
Список pgsql-general
On Thu, Jan 19, 2006 at 05:34:29PM -0800, Alex Jiang wrote:
> I'm trying to access a bit array field that is declared as
>
> sp1 bit[][]
>
> When I attempt to access a slice of the array with the following command:
>
> SELECT sp1[1:2][1]
>
> I get the error: ' Field '2][1]' is of an unknown type'.

Is that the exact error message?  I can't find it anywhere in the
source code so I suspect it's an error from your client library.

> Postgre seems to think that the characters following the colon is a name for
> a field.

Works here in 8.0.6:

test=> CREATE TABLE foo (sp1 bit[][]);
CREATE TABLE
test=> INSERT INTO foo VALUES ('{{0,1},{1,0}}');
INSERT 0 1
test=> SELECT sp1[1:2][1] FROM foo;
    sp1
-----------
 {{0},{1}}
(1 row)

> I am using Postgresql 8.0-beta1 and my application is written in Delphi 5.

Release versions of 8.0 have been available for a year and the
latest is 8.0.6.  Running an old early beta isn't a good idea; lots
of bugs have been fixed since then.

> I access the database through the BDE.

What happens if you run the same query in psql?  If it works in
psql then the problem is likely with Delphi.

--
Michael Fuhr

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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: What is the maximum length of an IN(a,b,c....d) list in PostgreSQL
Следующее
От: Rich Shepard
Дата:
Сообщение: Re: Upgrade Problem: 7.4.3 -> 8.1.2