Re: SELECT INTO deprecation

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: SELECT INTO deprecation
Дата
Msg-id 20201215221325.GA14807@momjian.us
обсуждение исходный текст
Ответ на Re: SELECT INTO deprecation  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Ответы Re: SELECT INTO deprecation  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Re: SELECT INTO deprecation  (Jan Wieck <jan@wi3ck.info>)
Список pgsql-hackers
On Wed, Dec  9, 2020 at 09:48:54PM +0100, Peter Eisentraut wrote:
> On 2020-12-03 20:26, Peter Eisentraut wrote:
> > On 2020-12-03 16:34, Tom Lane wrote:
> > > As I recall, a whole lot of the pain we have with INTO has to do
> > > with the semantics we've chosen for INTO in a set-operation nest.
> > > We think you can write something like
> > > 
> > >      SELECT ... INTO foo FROM ... UNION SELECT ... FROM ...
> > > 
> > > but we insist on the INTO being in the first component SELECT.
> > > I'd like to know exactly how much of that messiness is shared
> > > by SQL Server.
> > 
> > On sqlfiddle.com, this works:
> > 
> > select a into t3 from t1 union select a from t2;
> > 
> > but this gets an error:
> > 
> > select a from t1 union select a into t4 from t2;
> > 
> > SELECT INTO must be the first query in a statement containing a UNION,
> > INTERSECT or EXCEPT operator.
> 
> So, with that in mind, here is an alternative proposal that points out that
> SELECT INTO has some use for compatibility.

Do we really want to carry around confusing syntax for compatibility?  I
doubt we would ever add INTO now, even for compatibility.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

  The usefulness of a cup is in its emptiness, Bruce Lee




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Cary Huang
Дата:
Сообщение: Re: pg_rewind copies
Следующее
От: Fedir Panasenko
Дата:
Сообщение: Sorting case branches in outfuncs.c/outNode alphabetically