Re: [HACKERS] group by problem - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] group by problem
Date
Msg-id 199802201929.OAA07166@candle.pha.pa.us
Whole thread Raw
List pgsql-hackers
>
>
> => > insert into FTemp1 select item as item1, count(*) as cnt from data group by
> => > item;
> => > ERROR:  The field being grouped by must appear in the target list
> => >
> => > Thanks
> => > --shiby
> =>
> => Say:
> =>
> => group by item1.
> It works.
> =>
> But, just wanted to check this also.
> I get the same error for:
> insert into FTemp1 select item, count(*) as cnt from data group by item
> also.
>
> So, is it mandatory now to give alias names for all the selected columns if
> we are using group by

No, I am sorry.  Looks like we have a bug where GROUP BY can't be used
with INSERT ... SELECT.


--
Bruce Momjian
maillist@candle.pha.pa.us

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Backend crashes - what's going on here???
Next
From:
Date:
Subject: Re: [HACKERS] Who is everyone?