Re: [HACKERS] Numeric and Aggregate: transform node 107 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Numeric and Aggregate: transform node 107
Date
Msg-id 5172.927295299@sss.pgh.pa.us
Whole thread Raw
In response to Numeric and Aggregate: transform node 107  (Michael Contzen <mcontzen@dohle.com>)
List pgsql-hackers
Michael Contzen <mcontzen@dohle.com> writes:
> insert into b select sum(val) into b;
> ERROR:  transformExpr: does not know how to transform node 107

I fixed that error a few days ago (the parser wasn't coping with
implicit type coercion of aggregates).  It works here:

regression=> insert into b select sum(val) into b;
INSERT 540179 1

I'm a little confused about why this statement is allowed, though;
shouldn't it read 'insert into b select sum(val) FROM a'?

I'm not sure what the parser thought it was doing --- there's no
need for a type coercion if it's computing a sum() of a numeric
column and putting the result in another numeric column, so I have
a suspicion that the parser read the statement as meaning something
else entirely.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: [HACKERS] 6.5 cvs: views doesn't survives after pg_dump (fwd)
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Empty system tables