Re: Guidance on INSERT RETURNING order

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: John Howroyd <jdhowroyd(at)googlemail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Guidance on INSERT RETURNING order
Date: 2023-04-14 22:14:12
Message-ID: CAKFQuwaHDiCV0BRf+1jWqV3QVP=vek7ptAK53YTRk+Vh0-tNMA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Apr 14, 2023 at 2:44 PM John Howroyd <jdhowroyd(at)googlemail(dot)com>
wrote:

> A patch for what? All my testing gives me the same output order as the
> declaration order. Does anyone have an example where this is not the case?
>
> The problem is that SQLAlchemy is an ORM and they need to be sure to match
> records from the insert to the relevant code side objects. This needs to
> be efficient as the majority of the python world will use this ORM for
> their database needs. There is no PostgreSQL documentation upon which to
> give this assertion.
>
> So what is really needed is for PostgreSQL to commit to this behaviour, or
> give guidance on how this might be achieved.
>
>>
>>
We aren't committing to it though. It will require newly introduced syntax
that tells the system to behave in the manner so desired. It makes sense
to attach such syntax to the RETURNING clause itself. Whether someone can
achieve that in a manner that the project is willing to commit remains to
be seen.

In short, lots of people complain about PostgreSQL's lack of this feature.
None of them are stepping up to fill in the gap and there isn't enough
interest, for many reasons, for the people being complained to to go ahead
and design and implement it themselves.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2023-04-14 22:22:42 Re: Guidance on INSERT RETURNING order
Previous Message John Howroyd 2023-04-14 21:44:19 Re: Guidance on INSERT RETURNING order