tcp keepalives not sent during long query

2022-12-13 Thread Willy-Bas Loos
Hi! Some users of our database have a NAT firewall and keep a postgres client (e.g. pgAdmin ) open for hours. To prevent the connection from being killed by the firewall due to inactivity, we configured tcp_keepalives_idle = 120 so that the server sends keepalives and keeps the connection active.

SV: compiling postgres on windows - how to deal with unmatched file extension?

2022-12-13 Thread Niels Jespersen
>I'm trying to build postgresql from source code on windows. The build ran into >a bunch of errors like > >'src/backend/bootstrap/bootparse.c': No such file or directory >src/backend/parser/gram.c': No such file or directory > >These .c files are referenced in postgres.vcxproj. They actual exist b

Re: compiling postgres on windows - how to deal with unmatched file extension?

2022-12-13 Thread David G. Johnston
On Tue, Dec 13, 2022 at 9:56 PM Yang, T. Andy wrote: > I checked out source code from the latest master version on github. I was > expecting the build would go smoothly since I didn't modify anything. > That philosophy unfortunately doesn't work here. There are many pre-requisites and there isn

Re: compiling postgres on windows - how to deal with unmatched file extension?

2022-12-13 Thread Tom Lane
"Yang, T. Andy" writes: > I'm trying to build postgresql from source code on windows. The build ran > into a bunch of errors like  > 'src/backend/bootstrap/bootparse.c': No such file or directory > 'src/backend/parser/gram.c': No such file or directory I know little about building on Windows, b

compiling postgres on windows - how to deal with unmatched file extension?

2022-12-13 Thread Yang, T. Andy
I'm trying to build postgresql from source code on windows. The build ran into a bunch of errors like  'src/backend/bootstrap/bootparse.c': No such file or directory 'src/backend/parser/gram.c': No such file or directory These .c files are referenced in postgres.vcxproj. They actual exist but th

Re: print in plpython not appearing in logs

2022-12-13 Thread Adrian Klaver
On 12/13/22 13:20, Shaozhong SHI wrote: What is brilliant about plpython?  Any brilliant examples to look at? 1) It is actually plython(3)u where the u means untrusted. This means you can reach outside the database and do things. That can seen as brilliant or dangerous. 2) You have no end

Re: print in plpython not appearing in logs

2022-12-13 Thread Shaozhong SHI
What is brilliant about plpython? Any brilliant examples to look at? On Friday, 2 December 2022, Ludwig Isaac Lim wrote: > I'm having problems wherein my print() statements inside my plpython > stored proc are not appearing in postgresql log. I tried setting the > file=sys.stderr > > To reprodu

Re: Is there a way to detect that code is inside CREATE EXTENSION?

2022-12-13 Thread Michel Pelletier
> > At the C-code level you can check the creating_extension global variable, > or maybe better look at the in_extension fields of CollectedCommands. > Thanks Tom! That was the hint I needed, looks like pg_event_trigger_ddl_commands() has an in_extension boolean that seems like it will do what I

Re: Is there a way to detect that code is inside CREATE EXTENSION?

2022-12-13 Thread Julien Rouhaud
On Tue, Dec 13, 2022 at 7:49 PM Tom Lane wrote: > > Michel Pelletier writes: > > I'm working with an event trigger that fires on ALTER TABLE and regenerates > > certain objects, but unfortunately those objects end up being owned by any > > extensions that run ALTER TABLE and any subsequent altera

Re: Is there a way to detect that code is inside CREATE EXTENSION?

2022-12-13 Thread Tom Lane
Michel Pelletier writes: > I'm working with an event trigger that fires on ALTER TABLE and regenerates > certain objects, but unfortunately those objects end up being owned by any > extensions that run ALTER TABLE and any subsequent alterations fail to > regenerate because they are owned by that e

Is there a way to detect that code is inside CREATE EXTENSION?

2022-12-13 Thread Michel Pelletier
I'm working with an event trigger that fires on ALTER TABLE and regenerates certain objects, but unfortunately those objects end up being owned by any extensions that run ALTER TABLE and any subsequent alterations fail to regenerate because they are owned by that extension. Ideally, I'd like to be

Re: Is there a way to know write statistics on an individual index

2022-12-13 Thread higherone
It's not a partial index, but I believe the pg_stat_user_tables contains all the writes on the table, which not necessarily updates the individual index I'm interested in (e.g. when the updated column is not part of the index columns) . On Fri, Dec 9, 2022 at 2:06 PM Maciek Sakrejda wrote: > On