Re: Guidance on INSERT RETURNING order

2023-04-14 Thread Federico
On Sat, 15 Apr 2023 at 05:17, Tom Lane wrote: > > Federico writes: > > Would something like what was proposed by Mike Bayer be considered? > > >> A new token called "tuple_order" or something > >> > >> INSERT INTO table (a, b, c) VALUES ((1, 2, 3), (4, 5, 6), ...) RETURNING > >> table.id, insert

Re: Guidance on INSERT RETURNING order

2023-04-14 Thread David G. Johnston
On Fri, Apr 14, 2023 at 8:17 PM Tom Lane wrote: > Federico writes: > > Would something like what was proposed by Mike Bayer be considered? > > >> A new token called "tuple_order" or something > >> > >> INSERT INTO table (a, b, c) VALUES ((1, 2, 3), (4, 5, 6), ...) > RETURNING table.id, inserted.

Re: Guidance on INSERT RETURNING order

2023-04-14 Thread Tom Lane
Federico writes: > Would something like what was proposed by Mike Bayer be considered? >> A new token called "tuple_order" or something >> >> INSERT INTO table (a, b, c) VALUES ((1, 2, 3), (4, 5, 6), ...) RETURNING >> table.id, inserted.tuple_order >> >> tuple_order would be incrementing value

Re: Guidance on INSERT RETURNING order

2023-04-14 Thread Adrian Klaver
On 4/14/23 15:44, Karsten Hilbert wrote: Am Fri, Apr 14, 2023 at 10:44:19PM +0100 schrieb John Howroyd: The problem is that SQLAlchemy is an ORM [...] ... [...] as the majority of the python world will use this ORM for their database needs. I wouldn't be so sure on this count ... +1 Kar

Re: Guidance on INSERT RETURNING order

2023-04-14 Thread Karsten Hilbert
Am Fri, Apr 14, 2023 at 10:44:19PM +0100 schrieb John Howroyd: > The problem is that SQLAlchemy is an ORM [...] ... > [...] as the majority of the python world will use this ORM for > their database needs. I wouldn't be so sure on this count ... Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BE

Re: Guidance on INSERT RETURNING order

2023-04-14 Thread David G. Johnston
On Fri, Apr 14, 2023 at 12:47 PM Federico wrote: > > Would something like what was proposed by Mike Bayer be considered? > > > A new token called "tuple_order" or something > > > > INSERT INTO table (a, b, c) VALUES ((1, 2, 3), (4, 5, 6), ...) > RETURNING table.id, inserted.tuple_order > > > > t

Re: Guidance on INSERT RETURNING order

2023-04-14 Thread David G. Johnston
On Fri, Apr 14, 2023 at 2:44 PM John Howroyd 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

Re: Guidance on INSERT RETURNING order

2023-04-14 Thread John Howroyd
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 b

Re: Guidance on INSERT RETURNING order

2023-04-14 Thread Federico
On Fri, 14 Apr 2023 at 21:37, David G. Johnston wrote: > > On Fri, Apr 14, 2023 at 11:42 AM John Howroyd > wrote: >> >> @PostgreSQL: Might I ask if this is still being actively considered or >> should we repost to another mailing list (perhaps pgsql-hackers or any other >> you might suggest)?

Re: Guidance on INSERT RETURNING order

2023-04-14 Thread David G. Johnston
On Fri, Apr 14, 2023 at 11:42 AM John Howroyd wrote: > @PostgreSQL: Might I ask if this is still being actively considered or > should we repost to another mailing list (perhaps pgsql-hackers or any > other you might suggest)? > This is the right place for such a discussion. Unless you think y

Re: Guidance on INSERT RETURNING order

2023-04-14 Thread John Howroyd
@PostgreSQL: Might I ask if this is still being actively considered or should we repost to another mailing list (perhaps pgsql-hackers or any other you might suggest)?

Re: JSON / ASP.NET AJAX Dates support in PostgreSQL

2023-04-14 Thread Adrian Klaver
On 4/14/23 9:31 AM, Peter J. Holzer wrote: On 2023-04-13 10:07:09 -0500, Ron wrote: On 4/13/23 09:44, Sebastien Flaesch wrote: Is there an easy way to convert JSON data containing ASP.NET AJAX Dates into PostgreSQL timestamp? I have this kind of JSON data: {     "Purch

Re: Guidance on INSERT RETURNING order

2023-04-14 Thread Peter J. Holzer
On 2023-04-11 15:45:59 -0600, Rob Sargent wrote: > > > Can your client retain a hashmap of md5,data pairings, allowing the > > > lookup on the way back using the returned data and supplied id? > > > > > When using unique columns or similar, that's something that is done, > > but if there are no un

Re: JSON / ASP.NET AJAX Dates support in PostgreSQL

2023-04-14 Thread Peter J. Holzer
On 2023-04-13 10:07:09 -0500, Ron wrote: > On 4/13/23 09:44, Sebastien Flaesch wrote: > Is there an easy way to convert JSON data containing ASP.NET AJAX Dates > into PostgreSQL timestamp? > > I have this kind of JSON data: > > { >     "PurchaseOrder" : "45", >    

Re: SIze 0 in pg_stat_file, pg_stat_progress_copy

2023-04-14 Thread Marc Millas
Sorry... someone did setup the log as a named pipe... Marc MILLAS Senior Architect +33607850334 www.mokadb.com On Fri, Apr 14, 2023 at 4:26 PM Marc Millas wrote: > Hi, > > on a debian machine, with a postgres 14,2 server > > logs in a dedicated directory (not log) > when logged as superuser,

Re: [Extern] Re: Is a logical replication crash recovery safe?

2023-04-14 Thread GF
Markus, Yesterday EDB published the (open source) pg_failover_slots extension, aimed at pushing logical slot information on standbys: without it, that information is kept on the master only, so you have to rebuild the logical replication topology on switch/fail-overs. Obviously, if the promoted ser

Re: cursor with hold must be save to disk?

2023-04-14 Thread Laurenz Albe
On Fri, 2023-04-14 at 19:04 +0800, 黄宁 wrote: > i want to use cursor with hold ,but when I declare a curosr , it takes a long > time to save the result set to disk. can i save the query state in memory? > and fetch forward the next result. The complete result set has to be materialized. It only sp

Re: cursor with hold must be save to disk?

2023-04-14 Thread Adrian Klaver
On 4/14/23 04:04, 黄宁 wrote: i want to use cursor with hold ,but when I declare a curosr , it takes a long time to save the result set to disk. can i save the query state in memory? and fetch forward the next result. From the docs: https://www.postgresql.org/docs/current/sql-declare.html A

SIze 0 in pg_stat_file, pg_stat_progress_copy

2023-04-14 Thread Marc Millas
Hi, on a debian machine, with a postgres 14,2 server logs in a dedicated directory (not log) when logged as superuser, I get: --pg_stat_file for the current logfile says size 0, --pg_ls_logdir answers 0 files, --pg_ls_dir, for the log directory provides postgres.csv, postgres.json,... list of fi

cursor with hold must be save to disk?

2023-04-14 Thread 黄宁
i want to use cursor with hold ,but when I declare a curosr , it takes a long time to save the result set to disk. can i save the query state in memory? and fetch forward the next result.

Re: "PANIC: could not open critical system index 2662" - twice

2023-04-14 Thread Alban Hertroys
> On 14 Apr 2023, at 9:38, Evgeny Morozov wrote: (…) > I don't know whether ZFS zero-fills blocks on disk errors. As I > understood, ZFS should have been able to recover from disk errors (that > were "unrecoverable" at the hardware level) using the data on the other > two disks (which did not

Re: "PANIC: could not open critical system index 2662" - twice

2023-04-14 Thread Evgeny Morozov
> Hmm, I am not certain. The block was filled with zeros from your error > message, and I think such blocks don't trigger a checksum warning. OK, so data_checksums=on might not have made any difference in this case? > So if your disk replaces a valid block with zeros (filesystem check > after cr