Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-10 Thread Nico Williams
On Fri, Apr 11, 2025 at 07:15:44AM +0200, Laurenz Albe wrote: > On Thu, 2025-04-10 at 22:18 -0500, Merlin Moncure wrote: > > Facts.  This is black magic.   This has come up over and over.  > > Perhaps it would help to add the excellent information from the Wiki to the > documentation: > https://w

Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-10 Thread Laurenz Albe
On Thu, 2025-04-10 at 22:18 -0500, Merlin Moncure wrote: > Facts.  This is black magic.   This has come up over and over.  Perhaps it would help to add the excellent information from the Wiki to the documentation: https://wiki.postgresql.org/wiki/Inlining_of_SQL_functions Yours, Laurenz Albe

Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-10 Thread David G. Johnston
On Thursday, April 10, 2025, Tom Lane wrote: > Merlin Moncure writes: > > I guess the real problems here are lack of feedback on a number of > fronts: > > *) the server knows the function is not immutable but lets you create it > > anyway, even though it can have negative downstream consequences

Re: Meson and Numa: C header not found

2025-04-10 Thread Daniel Westermann (DWE)
>This implies that it caches info about header presence but >not library presence (else it wouldn't have thought that >the library was there either, I guess). Kind of weird, >but I'm still learning about meson. Thanks, Tom, Confirmed, starting from scratch does not show the issue anymore. Regard

Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-10 Thread Tom Lane
Merlin Moncure writes: > I guess the real problems here are lack of feedback on a number of fronts: > *) the server knows the function is not immutable but lets you create it > anyway, even though it can have negative downstream consequences That's debatable I think. If you know what you're doin

Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-10 Thread Merlin Moncure
On Thu, Apr 10, 2025 at 10:59 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Thu, Apr 10, 2025 at 8:49 AM Nico Williams > wrote: > >> On Wed, Apr 09, 2025 at 02:43:11PM -0700, Adrian Klaver wrote: >> > On 4/9/25 14:21, Nico Williams wrote: >> > > That to_char is not immutable is n

PgBackRest fails due to filesystem full

2025-04-10 Thread KK CHN
List, I am running PgbackRest-2.52.1 on RHEL9.3 and EDB16 to backup to a remote repo server . Everything was working fine and backups were regularly taken with cron scheduler daily. But due to a / partition full 100 % utilization, the pgbackrest backup failed the other day. I came t

Re: find replication slots that "belong" to a publication

2025-04-10 Thread Willy-Bas Loos
Hi Laurenz, Thanks for answering! I find it very strange, because the publication is needed to make a subscription, which makes the slot. Thanks for looking into it and helping me understand. Cheers! Willy-Bas Loos On Mon, Apr 7, 2025 at 3:31 PM Laurenz Albe wrote: > On Mon, 2025-04-07 at 12:

Re: psql meta command

2025-04-10 Thread Christoph Moench-Tegeder
## Marc Millas (marc.mil...@mokadb.com): > on a customer postgres db, using psql, if I post \ to initiate, for > exemple \x > that psql immediately exits. I've seen that happen with broken terminals, mostly some "web shell" stuff. Ditch that, it's most likely broken in other ways, too. > somewh

Re: [EXTERNAL] Re: Cannot connect local with ttrust (pg_upgrade assumes it)

2025-04-10 Thread Francisco Olarte
Abraham: On Thu, 10 Apr 2025 at 13:30, Francisco Olarte wrote: > You forgot to answer the first and most important question. > > How are you connecting? Your symptoms matches confusing local with > > TCP/IP to localhost. They are not the same thing. After reading more messages it seems you use

Re: Slow timestamp query after upgrading from Pg13 to Pg16

2025-04-10 Thread Laurenz Albe
On Mon, 2025-04-07 at 20:25 +0100, Simon Windsor wrote: > We used pg_dump|pg_restore to migrate the data. > > The full explain plan is at https://explain.depesz.com/s/742M. The SQL > > explain (analyze, buffers) select count(*) from consignments where > (req_status_tstamp >= '2025-03-28 00:00'::

Re: Postgres_fdw- User Mapping with md5-hashed password

2025-04-10 Thread Adrian Klaver
On 4/8/25 13:00, Dirschel, Steve wrote: I know I can create user steve_test with password testpassword122 as md5 by doing: select 'md5'||md5('testpassword122steve_test'); Returns --> md5eb7e220574bf85096ee99370ad67cbd3 CREATE USER steve_test WITH PASSWORD 'md5eb7e220574bf85096ee99370ad67cbd

Re: Slow timestamp query after upgrading from Pg13 to Pg16

2025-04-10 Thread Laurenz Albe
On Mon, 2025-04-07 at 15:48 +0100, Simon Windsor wrote: > After upgrading a Db from Pg13 (Centos) to Pg16(Ubuntu) some queries > on a simple, large table (200M rows) are very slow If you used "pg_upgrade", did you ANALYZE the database? If that is not the problem, we can't guess what your problem

Re: Meson and Numa: C header not found

2025-04-10 Thread Tomas Vondra
On 4/10/25 11:53, Daniel Westermann (DWE) wrote: >> >>    ninja -C build >> >> completes just fine. What exactly are the commands you're executing? >> >> >> FWIW I guess -hackers would be a better place for this question. > > Nothing special, just this: > > meson configure -Dprefix=${PGHOME} \

Re: psql meta command

2025-04-10 Thread Pavel Luzanov
On 10.04.2025 15:29, Marc Millas wrote: on a customer postgres db, using psql, if I post \  to initiate, for exemple \x that psql immediately exits. somewhat boring as it blocks all psql meta commands. Is there a way to get the extended display without posting a \  ? You can enable extended ou

Re: Meson and Numa: C header not found

2025-04-10 Thread Tom Lane
"Daniel Westermann (DWE)" writes: > Even after restorecon I get this: > Found pkg-config: YES (/usr/bin/pkg-config) 2.3.0 > Run-time dependency numa found: YES 2.0.19 > ../postgresql/meson.build:957:12: ERROR: C header 'numa.h' not found > ... which gives this in the log: > Run-time dependency

Re: Meson and Numa: C header not found

2025-04-10 Thread Daniel Westermann (DWE)
>That's just weird then.  The only other theory that comes to mind >is that there's something wrong with the SELinux attributes on these >fles.  restorecon might help if so. If that would be the case, then it is a packaging issue on Fedora, I guess. Even after restorecon I get this: Found pkg-co

Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-10 Thread David G. Johnston
On Wednesday, April 9, 2025, Olleg Samoylov wrote: > > On 10.04.2025 01:08, Tom Lane wrote: > >> Yeah. The assumption is that you had a reason for marking the >> function IMMUTABLE and you want the planner to treat it that way >> even if it isn't really. (There are valid use-cases for that, for

Re: Meson and Numa: C header not found

2025-04-10 Thread Daniel Westermann (DWE)
>Just to confirm, do you have all of these in /usr/lib64? >$ ls -l /usr/lib64/libnuma* >lrwxrwxrwx. 1 root root16 Nov 4 19:00 /usr/lib64/libnuma.so -> >libnuma.so.1.0.0 >lrwxrwxrwx. 1 root root16 Nov 4 19:00 /usr/lib64/libnuma.so.1 -> >libnuma.so.1.0.0 >-rwxr-xr-x. 1 root root 62424 No

Re: Capturing both IP address and hostname in the log

2025-04-10 Thread David G. Johnston
On Thu, Apr 10, 2025 at 5:22 AM Tefft, Michael J wrote: > The documentation for log_hostname says: > > log_hostname (boolean) > > By default, connection log messages only show the IP address of the > connecting host. Turning this parameter on causes logging of the host name > as well. Note that d

Re: Meson and Numa: C header not found

2025-04-10 Thread Tom Lane
"Daniel Westermann (DWE)" writes: >> Just to confirm, do you have all of these in /usr/lib64? > Yes, it it there That's just weird then. The only other theory that comes to mind is that there's something wrong with the SELinux attributes on these files. restorecon might help if so.

Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-10 Thread Adrian Klaver
On 4/9/25 22:33, Olleg Samoylov wrote: On 10.04.2025 01:08, Tom Lane wrote: Yeah.  The assumption is that you had a reason for marking the function IMMUTABLE and you want the planner to treat it that way even if it isn't really.  (There are valid use-cases for that, for instance if you want ca

Re: Meson and Numa: C header not found

2025-04-10 Thread Tom Lane
"Daniel Westermann (DWE)" writes: > Tomas Vondra writes: >> On 4/10/25 08:00, Daniel Westermann (DWE) wrote: >>> ../postgresql/meson.build:957:12: ERROR: C header 'numa.h' not found > It is there: > postgres@pgbox:/home/postgres/ [DEV] ls /usr/include/numa.h > /usr/include/numa.h Just to confi

Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-10 Thread David G. Johnston
On Thu, Apr 10, 2025 at 8:49 AM Nico Williams wrote: > On Wed, Apr 09, 2025 at 02:43:11PM -0700, Adrian Klaver wrote: > > On 4/9/25 14:21, Nico Williams wrote: > > > That to_char is not immutable is not documented though. Though it's > > > clear when looking at the docs for the `jsonb_.*_tz()` f

Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-10 Thread Adrian Klaver
On 4/10/25 08:48, Nico Williams wrote: On Wed, Apr 09, 2025 at 02:43:11PM -0700, Adrian Klaver wrote: On 4/9/25 14:21, Nico Williams wrote: That to_char is not immutable is not documented though. Though it's clear when looking at the docs for the `jsonb_.*_tz()` functions. From here: https

Re: Interesting case of IMMUTABLE significantly hurting performance

2025-04-10 Thread Nico Williams
On Wed, Apr 09, 2025 at 02:43:11PM -0700, Adrian Klaver wrote: > On 4/9/25 14:21, Nico Williams wrote: > > That to_char is not immutable is not documented though. Though it's > > clear when looking at the docs for the `jsonb_.*_tz()` functions. > > From here: > > https://www.postgresql.org/docs/

Re: Meson and Numa: C header not found

2025-04-10 Thread Daniel Westermann (DWE)
>Tomas Vondra writes: >> On 4/10/25 08:00, Daniel Westermann (DWE) wrote: >>> I wanted to play a bit with the Numa stuff recently committed but Meson >>> fails to find numa.h: >>> Found pkg-config: YES (/usr/bin/pkg-config) 2.3.0 >>> Run-time dependency numa found: YES 2.0.19 >>> >>> ../postgresq

Re: Capturing both IP address and hostname in the log

2025-04-10 Thread Adrian Klaver
On 4/10/25 05:22, Tefft, Michael J wrote: The documentation for log_hostname says: log_hostname (boolean) By default, connection log messages only show the IP address of the connecting host. Turning this parameter on causes logging of the host name as well. Note that depending on your host na

Re: Meson and Numa: C header not found

2025-04-10 Thread Tom Lane
Tomas Vondra writes: > On 4/10/25 08:00, Daniel Westermann (DWE) wrote: >> I wanted to play a bit with the Numa stuff recently committed but Meson >> fails to find numa.h: >> Found pkg-config: YES (/usr/bin/pkg-config) 2.3.0 >> Run-time dependency numa found: YES 2.0.19 >> >> ../postgresql/meson

Meson and Numa: C header not found

2025-04-10 Thread Daniel Westermann (DWE)
Hi, I wanted to play a bit with the Numa stuff recently committed but Meson fails to find numa.h: Found pkg-config: YES (/usr/bin/pkg-config) 2.3.0 Run-time dependency numa found: YES 2.0.19 ../postgresql/meson.build:957:12: ERROR: C header 'numa.h' not found Is this expected? The header file

Re: Archive logging not cleaning up pg_wal directory

2025-04-10 Thread Justin Swanhart
Thank you very much. I had a stale replication slot. I removed it and the logs were cleaned up immediately. --Justin On Thu, Apr 10, 2025 at 8:48 AM Laurenz Albe wrote: > On Thu, 2025-04-10 at 08:28 -0400, Justin Swanhart wrote: > > I have the following in my postgresql.conf for archive loggi

Re: Archive logging not cleaning up pg_wal directory

2025-04-10 Thread Laurenz Albe
On Thu, 2025-04-10 at 08:28 -0400, Justin Swanhart wrote: > I have the following in my postgresql.conf for archive logging: > archive_command='test ! -f /var/lib/postgresql/prod_archive_logs/%f && cp %p > /var/lib/postgresql/prod_archive_logs/%f' > > This command is properly copying the log files

pg_restore causing ENOSPACE on the WAL partition

2025-04-10 Thread Dimitrios Apostolou
Hello list, last night I got ENOSPACE on the WAL partition while running a huge pg_restore on an empty and idle database. The checkpoint that started 7 minutes earlier never finished: 04:31:09 LOG: checkpoint starting: wal ... 04:38:04 PANIC: could not write to file "pg_wal/xlogtemp.5462

Re: Archive logging not cleaning up pg_wal directory

2025-04-10 Thread Ron Johnson
On Thu, Apr 10, 2025 at 8:29 AM Justin Swanhart wrote: > Hi, > > I have the following in my postgresql.conf for archive logging: > archive_command='test ! -f /var/lib/postgresql/prod_archive_logs/%f && cp > %p /var/lib/postgresql/prod_archive_logs/%f' > > This command is properly copying the log

Re: psql meta command

2025-04-10 Thread Laurenz Albe
On Thu, 2025-04-10 at 14:29 +0200, Marc Millas wrote: > on a customer postgres db, using psql, if I post \  to initiate, for exemple  > \x > that psql immediately exits. > somewhat boring as it blocks all psql meta commands. > Is there a way to get the extended display without posting a \  ? Odd.

psql meta command

2025-04-10 Thread Marc Millas
Hello, on a customer postgres db, using psql, if I post \ to initiate, for exemple \x that psql immediately exits. somewhat boring as it blocks all psql meta commands. Is there a way to get the extended display without posting a \ ? thanks, Marc MILLAS Senior Architect +33607850334 www.mokadb.

Archive logging not cleaning up pg_wal directory

2025-04-10 Thread Justin Swanhart
Hi, I have the following in my postgresql.conf for archive logging: archive_command='test ! -f /var/lib/postgresql/prod_archive_logs/%f && cp %p /var/lib/postgresql/prod_archive_logs/%f' This command is properly copying the log files to my archive directory but they remain in the `pg_wal` directo

Capturing both IP address and hostname in the log

2025-04-10 Thread Tefft, Michael J
The documentation for log_hostname says: log_hostname (boolean) By default, connection log messages only show the IP address of the connecting host. Turning this parameter on causes logging of the host name as well. Note that depending on your host name resolution setup this might impose a non-n

Re: timescaledb vs NULL vs pg_timeseries vs partman + pgcron + pg_ivm

2025-04-10 Thread Achilleas Mantzios
Hi Brent how do you plan to cope with future upgrades based on logical replication ? Do you run timescale on a dedicated/separate system from the rest of your PostgreSQL cluster(s)? On 10/4/25 08:25, Amitabh Kant wrote: On Wed, Apr 9, 2025 at 11:50 AM Achilleas Mantzios - cloud wrote:

Re: pg_restore causing ENOSPACE on the WAL partition

2025-04-10 Thread Dimitrios Apostolou
Forgot an important setting I have during pg_restore: On Thu, 10 Apr 2025, Dimitrios Apostolou wrote: max_wal_size=64GB max_replication_slots = 0 max_logical_replication_workers = 0 max_wal_senders = 0 wal_level = minimal autovacuum = off checkpoint_completion_target = 0 so the checkpoint sh

Re: [EXTERNAL] Re: Cannot connect local with ttrust (pg_upgrade assumes it)

2025-04-10 Thread Francisco Olarte
On Wed, 9 Apr 2025 at 19:44, Abraham, Danny wrote: > Thanks for the answers. > All the 3 lines are, of course, uncommented for the test. That was assumed. > I am using Linux, socket is in /tmp, i see the .s files , but local trust > still does not connect. You forgot to answer the first and most

Re: Meson and Numa: C header not found

2025-04-10 Thread Daniel Westermann (DWE)
> >   ninja -C build > >completes just fine. What exactly are the commands you're executing? > > >FWIW I guess -hackers would be a better place for this question. Nothing special, just this: meson configure -Dprefix=${PGHOME} \ -Dbindir=${PGHOME}/bin \ -Ddatadir=${

Re: Meson and Numa: C header not found

2025-04-10 Thread Tomas Vondra
On 4/10/25 08:00, Daniel Westermann (DWE) wrote: > Hi, > > I wanted to play a bit with the Numa stuff recently committed but Meson fails > to find numa.h: > > Found pkg-config: YES (/usr/bin/pkg-config) 2.3.0 > Run-time dependency numa found: YES 2.0.19 > > ../postgresql/meson.build:957:12: ERR