explicit cast for null::bigint

Поиск
Список
Период
Сортировка
Искать
От
Ivan Sergio Borgonovo
Тема
explicit cast for null::bigint
Дата
Msg-id
20100313122248.3c3c5394@dawn.webthatworks.it
Список
I've found this a bit strange:

insert into catalog_related (itemid, related_itemid, rank)
        select distinct itemid, null::bigint, 0::float4
                from catalog_categoryitem
                where catid is null or catid<>0
                and itemid not in (select itemid from
                catalog_related);

create table catalog_related (
  itemid bigint,
  updated timestamp default now(),
  related_itemid bigint,
  rank float4
);

without the explicit cast for the null I get 

ERROR:  column "related_itemid" is of type bigint but expression is
of type text LINE 1: insert into catalog_related (itemid,
related_itemid, rank) ^

HINT:  You will need to rewrite or cast the expression.
PostgreSQL 8.3.4 on x86_64-pc-linux-gnu

-- 
Ivan Sergio Borgonovo
http://www.webthatworks.it

В списке pgsql-general по дате отправления
От: Scott Marlowe
Дата:
Сообщение: Re: hardware for a server
От: Angel
Дата:
FAQ