NAB : insert into select distinct => when used on null, distinct causes loss of type knowledge
Поиск
Список
Период
Сортировка
От Frank van Vugt
Тема NAB : insert into select distinct => when used on null, distinct causes loss of type knowledge
Дата
Msg-id 200408242316.38155.ftm.van.vugt@foxi.nl
обсуждение исходный текст
Ответы Re: NAB : insert into select distinct => when used on null, distinct causes loss of type knowledge  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi,


Not exactly a showstopper, but I noticed this behaviour:

db=# create table f1 (id int, value int);
CREATE TABLE

db=# insert into f1 select 1 as id, null;
INSERT 25456306 1

db=# insert into f1 select distinct 2 as id, null;
ERROR:  column "value" is of type integer but expression is of type text
HINT:  You will need to rewrite or cast the expression.

db=# insert into f1 select distinct on (id) 2 as id, null;
INSERT 25456307 1

So it seems distinct applied to the second column causes it to lose knowledge
on its type.

Does anybody happen to know why ?




--
Best,




Frank.


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

Предыдущее
От: Doug McNaught
Дата:
Сообщение: Re: Problem to connect to the Windows Port
Следующее
От: "ruben20@superguai.com"
Дата:
Сообщение: Upgrading PostgreSQL 7.1.3