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

Re: INSERT/SELECT with ORDER BY

From: Dirk Lutzebaeck <lutzeb(at)aeccom(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Cc: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Subject: Re: INSERT/SELECT with ORDER BY
Date: 2001-03-29 08:55:09
Message-ID: 15042.63597.611925.454061@ampato.core.aeccom.com (view raw or flat)
Thread:
Lists: pgsql-bugs
Stephan Szabo writes:
 > 
 > Unless I'm horribly misreading the spec, this is correct.  
 > ORDER BY is used in reference to cursor definitions and
 > direct select statements, but is not part of query expressions
 > which is what the INSERT INTO references.
 > 
 >          <insert statement> ::=
 >               INSERT INTO <table name>
 >                 <insert columns and source>
 > 
 >          <insert columns and source> ::=
 >                 [ <left paren> <insert column list> <right paren> ]
 >               <query expression>
 >               | DEFAULT VALUES
 > 
 >          <insert column list> ::= <column name list>
 > 
 > But, this may be a useful extension to allow, at least with the
 > existance of LIMIT.
 > 
 > Stephan Szabo
 > sszabo(at)bigpanda(dot)com
 > 
 > On Thu, 17 Aug 2000, Bob Rivoir wrote:
 > > 
 > > Please enter a FULL description of your problem:
 > > ------------------------------------------------
 > > I got the following error message when I tried to do an INSERT using
 > > SELECT ... ORDER BY:
 > > 
 > > ERROR:  ORDER BY is not allowed in INSERT/SELECT


Is 7.1 able to do INSERT/SELECT with ORDER BY and LIMIT ?

Dirk



In response to

pgsql-bugs by date

Next:From: Alexis WilkeDate: 2001-03-29 12:25:20
Subject: Please, fix!!! The backend can crash on your system!
Previous:From: Peter MountDate: 2001-03-29 08:52:05
Subject: Re: [JDBC] Possible large object bug?

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