Skip site navigation (1) Skip section navigation (2)

INSERT with GROUP

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: hackers(at)postgreSQL(dot)org (PostgreSQL-development)
Subject: INSERT with GROUP
Date: 1998-03-01 05:40:31
Message-ID: 199803010540.AAA09461@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Looks like I don't have this fixed, so I have re-added it to the FAQ.

test=> create table xx (x int, y int) ;     
CREATE
test=> insert into xx select usesysid, count(*) from pg_user group by
usesysid;
ERROR:  The field being grouped by must appear in the target list

In this case, the group by the parser is checking for is x and y, not
the results of the select, so it fails.

-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date

Next:From: Billy G. AllieDate: 1998-03-01 06:54:30
Subject: pg_atoi patch for postgreSQL 6.3.
Previous:From: Billy G. AllieDate: 1998-03-01 04:03:14
Subject: Configure --with-tcl problems.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group