Union with array types

Поиск
Список
Период
Сортировка
От Juhan-Peep Ernits
Тема Union with array types
Дата
Msg-id Pine.GSO.4.21.0103131409020.28773-100000@suhkur.cc.ioc.ee
обсуждение исходный текст
Ответы Re: Union with array types
Список pgsql-general
Hello!

The example is the following:

create table arraytest ( id int,  mystuff varchar(40)[][]);
insert into arraytest values (1,'{{"a","b"}}');
insert into arraytest values (2,'{{"c","d"}}');


 (select id, mystuff from arraytest where id=1) union (select id, mystuf
f from arraytest where id=2);

ERROR:  Unable to identify an ordering operator '<' for type '_varchar'
        Use an explicit ordering operator or modify the query

PG version is CVS from Feb 26, 2001.

What kind of explicit ordering operator would one need? Since the array
type seems to remember only the fact that it is an array of a particular
type, not the dimension (ie if one creates a field of type
varchar(40)[][] the result is the same as creating a field of type
varchar(40)[] and it is possible to store stuff in the form
varchar(40)[][][] also in that field), it is up to the person who
creates the union to ensure that the types actually match.
Is it necessary to require the explicit ordering operator in this
case? What am I missing?

Best regards,

Juhan Ernits




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

Предыдущее
От: "Richard Huxton"
Дата:
Сообщение: Re: Text search
Следующее
От: "keith"
Дата:
Сообщение: Please Help