query on smallint array column

Поиск
Список
Период
Сортировка
От Zhihong Yu
Тема query on smallint array column
Дата
Msg-id CALNJ-vSg--Gup5jwrKv4GP50gzk8Gtq1qunNjudu=n7barorEQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: query on smallint array column  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
Hi,
I was experimenting with the following query.

create table sint1(k int primary key, arr smallint[]);
create index s1 on sint1(arr);
insert into sint1 select s, array[s*s, s] FROM generate_series(1, 10) AS s;
select * from sint1 where arr @> array[4];
ERROR:  operator does not exist: smallint[] @> integer[]
LINE 1: select * from sint1 where arr @> array[4];
                                      ^
HINT:  No operator matches the given name and argument types. You might need to add explicit type casts.
-------

I wonder if someone can enlighten me on the correct way to perform the type cast.

Thanks

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

Предыдущее
От: Andrey Borodin
Дата:
Сообщение: Re: MultiXact\SLRU buffers configuration
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: query on smallint array column