datatype of constant is not propagated into aggregate query

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: datatype of constant is not propagated into aggregate query
Date: 2012-03-11 14:46:17
Message-ID: CAFj8pRB4nHkrBq8bMyPMn-UYnrFfADok2wakRLRVqznq2cks4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stefan Keller 2012-03-11 15:24:20 Re: pg_prewarm
Previous Message Thomas Hunger 2012-03-11 14:17:59 Typo patch