datatype of constant is not propagated into aggregate query - Mailing list pgsql-hackers

From Pavel Stehule
Subject datatype of constant is not propagated into aggregate query
Date
Msg-id CAFj8pRB4nHkrBq8bMyPMn-UYnrFfADok2wakRLRVqznq2cks4g@mail.gmail.com
Whole thread Raw
Responses Re: datatype of constant is not propagated into aggregate query
List pgsql-hackers
Hello

create table t1(d date, n integer);

postgres=# insert into t1 select '2001-01-01', 1 from generate_series(1,3);
INSERT 0 3

but

postgres=# insert into t1 select distinct '2001-01-01', 1 from
generate_series(1,3);
ERROR:  column "d" is of type date but expression is of type text
LINE 1: insert into t1 select distinct '2001-01-01', 1 from generate...                                      ^
HINT:  You will need to rewrite or cast the expression.

Regards

Pavel Stehule


pgsql-hackers by date:

Previous
From: Thomas Hunger
Date:
Subject: Typo patch
Next
From: Stefan Keller
Date:
Subject: Re: pg_prewarm