Re: SELECT INTO deprecation

2021-03-30 Thread Jan Wieck
On 12/15/20 5:13 PM, Bruce Momjian wrote: 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

Re: SELECT INTO deprecation

2021-01-30 Thread Peter Eisentraut
On 2020-12-17 02:30, Michael Paquier wrote: On Wed, Dec 16, 2020 at 06:07:08PM +0100, Peter Eisentraut wrote: Right, we would very likely not add it now. But it doesn't seem to cause a lot of ongoing maintenance burden, so if there is a use case, it's not unreasonable to keep it around. I have

Re: SELECT INTO deprecation

2020-12-16 Thread Michael Paquier
On Wed, Dec 16, 2020 at 06:07:08PM +0100, Peter Eisentraut wrote: > Right, we would very likely not add it now. But it doesn't seem to cause a > lot of ongoing maintenance burden, so if there is a use case, it's not > unreasonable to keep it around. I have no other motive here, I was just > curio

Re: SELECT INTO deprecation

2020-12-16 Thread Peter Eisentraut
On 2020-12-15 23:13, Bruce Momjian wrote: Do we really want to carry around confusing syntax for compatibility? I doubt we would ever add INTO now, even for compatibility. Right, we would very likely not add it now. But it doesn't seem to cause a lot of ongoing maintenance burden, so if ther

Re: SELECT INTO deprecation

2020-12-15 Thread Bruce Momjian
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. >

Re: SELECT INTO deprecation

2020-12-09 Thread Peter Eisentraut
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 SELE

Re: SELECT INTO deprecation

2020-12-03 Thread Peter Eisentraut
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 bein

Re: SELECT INTO deprecation

2020-12-03 Thread Tom Lane
Peter Eisentraut writes: > Interesting. This appears to be the case. SQL Server uses SELECT INTO > to create a table, and does not appear to have CREATE TABLE AS. > So maybe we should keep it, but adjust the documentation to point out > this use case. That argument makes sense, but only if ou

Re: SELECT INTO deprecation

2020-12-03 Thread Peter Eisentraut
On 2020-12-03 00:54, Michael Paquier wrote: I got to wonder about the impact when migrating applications though. SELECT INTO has a different meaning in Oracle, but SQL server creates a new table like Postgres. Interesting. This appears to be the case. SQL Server uses SELECT INTO to create a

Re: SELECT INTO deprecation

2020-12-03 Thread Peter Eisentraut
On 2020-12-02 18:58, Stephen Frost wrote: I also found some gratuitous uses of SELECT INTO in various tests and documentation (not ecpg or plpgsql of course). Here is a patch to adjust those to CREATE TABLE AS. If we aren't actually removing SELECT INTO then I don't know that it makes sense to

Re: SELECT INTO deprecation

2020-12-03 Thread Thomas Kellerer
Stephen Frost schrieb am 02.12.2020 um 18:58: > We should either remove it, or remove the comments that it's deprecated, > not try to make it more deprecated or try to somehow increase the > recommendation to not use it. (I am writing from a "user only" perspective, not a developer) I don't see a

Re: SELECT INTO deprecation

2020-12-02 Thread Michael Paquier
On Wed, Dec 02, 2020 at 03:35:46PM -0500, Tom Lane wrote: > Yeah, if we want to kill it let's just do so. The negative language in > the reference page has been there since (at least) 7.1, so people can > hardly say they didn't see it coming. +1. I got to wonder about the impact when migrating a

Re: SELECT INTO deprecation

2020-12-02 Thread Tom Lane
Stephen Frost writes: > * Peter Eisentraut (peter.eisentr...@enterprisedb.com) wrote: >> While reading about deprecating and removing various things in other >> threads, I was wondering about how deprecated SELECT INTO is. There are >> various source code comments about this, but the SELECT INTO

Re: SELECT INTO deprecation

2020-12-02 Thread David Fetter
On Wed, Dec 02, 2020 at 12:58:36PM -0500, Stephen Frost wrote: > Greetings, > > * Peter Eisentraut (peter.eisentr...@enterprisedb.com) wrote: > > While reading about deprecating and removing various things in > > other threads, I was wondering about how deprecated SELECT INTO > > is. There are va

Re: SELECT INTO deprecation

2020-12-02 Thread Stephen Frost
Greetings, * Peter Eisentraut (peter.eisentr...@enterprisedb.com) wrote: > While reading about deprecating and removing various things in other > threads, I was wondering about how deprecated SELECT INTO is. There are > various source code comments about this, but the SELECT INTO reference page >

Re: SELECT INTO deprecation

2020-12-02 Thread Pavel Stehule
st 2. 12. 2020 v 12:55 odesílatel Peter Eisentraut < peter.eisentr...@enterprisedb.com> napsal: > While reading about deprecating and removing various things in other > threads, I was wondering about how deprecated SELECT INTO is. There are > various source code comments about this, but the SELEC

Re: SELECT INTO deprecation

2020-12-02 Thread Daniel Gustafsson
> On 2 Dec 2020, at 12:54, Peter Eisentraut > wrote: > While reading about deprecating and removing various things in other threads, > I was wondering about how deprecated SELECT INTO is. There are various > source code comments about this, but the SELECT INTO reference page only > contains

SELECT INTO deprecation

2020-12-02 Thread Peter Eisentraut
While reading about deprecating and removing various things in other threads, I was wondering about how deprecated SELECT INTO is. There are various source code comments about this, but the SELECT INTO reference page only contains soft language like "recommended". I'm proposing the attached p