Re: sequence on daily log partitioned table

2025-04-21 Thread David G. Johnston
On Monday, April 21, 2025, senor wrote: > > I'm mainly interested in understanding how this works or why it can't > Partition routing happens on fully-formed tuples. They thus must be formed initially using only context, like defaults, attached to the partitioned table. You can do what you want

sequence on daily log partitioned table

2025-04-21 Thread senor
Hi All, I'm mainly interested in understanding how this works or why it can't, as opposed to just solving the problem. AI just told me this can't be done without a trigger but I'd like to confirm in case maybe I just asked the wrong question. I want to have a partitioned log table receiving inp

Re: pg_get_serial_sequence not working for manually set seq

2025-04-21 Thread Tom Lane
Marcelo Fernandes writes: > I've been testing the pg_get_serial_sequence function and noticed that I can > only get reliable results when using a SERIAL or IDENTITY column. > However, shouldn't it work for manually set sequences too? pg_get_serial_sequence looks for pg_depend entries that make se

pg_get_serial_sequence not working for manually set seq

2025-04-21 Thread Marcelo Fernandes
Hi folks, I've been testing the pg_get_serial_sequence function and noticed that I can only get reliable results when using a SERIAL or IDENTITY column. However, shouldn't it work for manually set sequences too? In the docs[0] we have that this function: > Returns the name of the sequence assoc

Re: Order of update

2025-04-21 Thread Thiemo Kellner
Thanks for the pointer. I feel my doubts reflected. For such reasons, I prefer the UUID as surrogate key. No point in trying to establish an order or even id arithmetics. 21.04.2025 18:44:27 Adrian Klaver : > On 4/21/25 09:12, Thiemo Kellner wrote: >> I wonder if that is a corner case. Updating

Re: Cannot turn track_counts on

2025-04-21 Thread Adrian Klaver
On 4/21/25 09:46, Anton Shepelev wrote: I wrote: I will test if clearing shared_preload_libraries and restarting Postgres has any effect on track_counts, just in case. Nope, it didn't unstick track_counts: db=# show shared_preload_libraries ; -[ RECORD 1 ]+- shared_prelo

Re: Cannot turn track_counts on

2025-04-21 Thread Adrian Klaver
On 4/21/25 09:26, Anton Shepelev wrote: Adrian Klaver: Found it. It is coming from the Debian postgresql-common packaging. /usr/bin/pg_config is wrapper that contains: #!/bin/sh # If postgresql-server-dev-* is installed, call pg_config from the latest # available one. Otherwise fall back t

Re: Cannot turn track_counts on

2025-04-21 Thread Anton Shepelev
I wrote: > I will test if clearing shared_preload_libraries and > restarting Postgres has any effect on track_counts, just > in case. Nope, it didn't unstick track_counts: db=# show shared_preload_libraries ; -[ RECORD 1 ]+- shared_preload_libraries | db=# select * from pg_s

Re: Order of update

2025-04-21 Thread Adrian Klaver
On 4/21/25 09:12, Thiemo Kellner wrote: I wonder if that is a corner case. Updating a unique key sounds to me like a design flaw in the first place. Check out this the thread below for discussion on that topic: https://www.postgresql.org/message-id/dkbnfi$7g5$1...@sea.gmane.org -- Adrian Kl

Re: Cannot turn track_counts on

2025-04-21 Thread Anton Shepelev
Adrian Klaver: > Found it. It is coming from the Debian postgresql-common > packaging. > > /usr/bin/pg_config is wrapper that contains: > > #!/bin/sh > > # If postgresql-server-dev-* is installed, call pg_config from the latest > # available one. Otherwise fall back to libpq-dev's version. Ah,

Re: Pgbackrest fails due after an ISP change

2025-04-21 Thread Greg Sabino Mullane
On Mon, Apr 21, 2025 at 9:03 AM KK CHN wrote: > > ERROR: [082]: WAL segment 000102200038 was not archived before > the 6ms timeout > ... > How can I make the full backup command not to check the WAL was archived > or not to the repo server for atleast once ? > You cannot. WAL

Re: Order of update

2025-04-21 Thread Thiemo Kellner
I wonder if that is a corner case. Updating a unique key sounds to me like a design flaw in the first place.

Re: Order of update

2025-04-21 Thread Adrian Klaver
On 4/21/25 01:47, Peter J. Holzer wrote: If the hash was the other way around it wouldn't work. So let's try if we can get the optimizer to flip the plan by changing the number of updated rows. [a few minutes later] #v+ hjp=> explain with a as (select id from id_update where id > 9 order

Pgbackrest fails due after an ISP change

2025-04-21 Thread KK CHN
List, I am running a pgbackrest(2.52.1) backup setup for a postgres(16) server(RHEL9.4) to a repo server RHEL 9.4.. The pgbackrest was working fine and the remote repo server got regular backups through cron scheduler. Suddenly there was an ISP change at our end, the VPN tunnel between DB s

Re: [EXTERNAL] Re: Why is an error not thrown when the time exceeds the lock timeout for an ExclusiveLock on a transaction ?

2025-04-21 Thread Mansky, Edmund J. (GSFC-671.0)[ADNET Affiliate]
Ahh, thanks Tom & Martin, it looks like STATEMENT_TIMEOUT is what I need to set first before the SQL in question. Many thanks, --Ed [signature_1371444655] Ed Mansky Software Engineer SDAC / VSO NASA Goddard Space Flight Center ADNET SYSTEMS, Inc. 8800 Greenbelt Rd, Greenbelt MD 20771 ed

Re: Order of update

2025-04-21 Thread Peter J. Holzer
On 2025-04-20 08:28:22 -0700, Adrian Klaver wrote: > On 4/20/25 02:10, Peter J. Holzer wrote: > > I've just read Laurenz' blog post about the differences between Oracle > > and PostgreSQL[1]. > > > > One of the differences is that something like > > > > UPDATE tab SET id = id + 1; > > > > t