On Fri, Apr 14, 2023 at 2:44 PM John Howroyd <jdhowroyd@xxxxxxxxxxxxxx> 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.