Re: merge with view

2024-03-11 Thread Adrian Klaver
On 3/11/24 13:25, Lorusso Domenico wrote: Hello guys, Merge isn't work on view; anyone know why? I mean, merge could be performed in many way, but essentially is: * join sets * if matched update or delete * if not matched insert it doesn't seem to be relevant if set is a table or a view.

merge with view

2024-03-11 Thread Lorusso Domenico
Hello guys, Merge isn't work on view; anyone know why? I mean, merge could be performed in many way, but essentially is: - join sets - if matched update or delete - if not matched insert it doesn't seem to be relevant if set is a table or a view. Moreover also "insert + on conflict"

RE: alter table xxx alter column yyy set (n_distinct=nnnn );

2024-03-11 Thread Tefft, Michael J
OK, thanks to both of you, it is now working for me. Many thanks. This is what I determined was the missing ingredient from the secret sauce… One of the things I had tried (before posting here) was Alter table xxx alter column p_id set statistics [varying values]; Including zero. When I first

Re: Pgxs - How to reference another extension

2024-03-11 Thread Michał Kłeczek
> On 11 Mar 2024, at 15:00, Pavel Stehule wrote: > > > The advantage of OidFunctionCall is fact, it is working on MacOS. My > extension plpgsql_check has a lot of dependencies on plpgsql. > > The linking on MacOS required special section in Makefile > > ifeq ($(PORTNAME), darwin) >

Re: alter table xxx alter column yyy set (n_distinct=nnnn );

2024-03-11 Thread Greg Sabino Mullane
Works for me on Postgres 14 as well. Maybe you are looking at the wrong table? Might help to show the exact steps you typed in.

Re: could not open file "global/pg_filenode.map": Operation not permitted

2024-03-11 Thread Adrian Klaver
On 3/11/24 03:11, Nick Renders wrote: Thank you for your reply Laurenz. I don't think it is related to any third party security software. We have several other machines with a similar setup, but this is the only server that has this issue. The one thing different about this machine however,

Re: alter table xxx alter column yyy set (n_distinct=nnnn );

2024-03-11 Thread Laurenz Albe
On Mon, 2024-03-11 at 14:26 +, Tefft, Michael J wrote: > I tried setting > > alter table ctrg.xxx alter column p_id set (n_distinct_inherited=-0.033 ); > alter table ctrg.xxx alter column pi_id set (n_distinct_inherited=-0.045 ); > alter table ctrg.xxx alter column i_id set

RE: alter table xxx alter column yyy set (n_distinct=nnnn );

2024-03-11 Thread Tefft, Michael J
Thanks very much for the reply. I tried setting alter table ctrg.xxx alter column p_id set (n_distinct_inherited=-0.033 ); alter table ctrg.xxx alter column pi_id set (n_distinct_inherited=-0.045 ); alter table ctrg.xxx alter column i_id set (n_distinct_inherited=-0.0002 ); I then ran analyze

Re: Create a standby server

2024-03-11 Thread Stephen Frost
Greetings, On Mon, Mar 11, 2024 at 13:33 normandavis1990 wrote: > > On Monday, March 11th, 2024 at 3:43 PM, Stephen Frost < > sfr...@snowman.net> wrote: > > > Greetings, > > > > * normandavis1990 (normandavis1...@proton.me) wrote: > > > > > I have a master and tow standby servers. I want to

Re: Pgxs - How to reference another extension

2024-03-11 Thread Pavel Stehule
Hi po 11. 3. 2024 v 14:48 odesílatel Michał Kłeczek napsal: > > > On 11 Mar 2024, at 14:08, Artur Zakirov wrote: > > On Mon, 11 Mar 2024 at 13:26, Michał Kłeczek wrote: > > > > On 11 Mar 2024, at 11:41, Michał Kłeczek wrote: > > Hi, > > I am trying to create an extension that delegates some

Re: Pgxs - How to reference another extension

2024-03-11 Thread Joe Conway
On 3/11/24 09:48, Michał Kłeczek wrote: On 11 Mar 2024, at 14:08, Artur Zakirov wrote: On Mon, 11 Mar 2024 at 13:26, Michał Kłeczek > wrote: On 11 Mar 2024, at 11:41, Michał Kłeczek wrote: Hi, I am trying to create an extension that delegates some calls to

Re: Pgxs - How to reference another extension

2024-03-11 Thread Michał Kłeczek
> On 11 Mar 2024, at 14:08, Artur Zakirov wrote: > > On Mon, 11 Mar 2024 at 13:26, Michał Kłeczek > wrote: >> >> >>> On 11 Mar 2024, at 11:41, Michał Kłeczek wrote: >>> >>> Hi, >>> >>> I am trying to create an extension that delegates some calls to btree_gist

Re: alter table xxx alter column yyy set (n_distinct=nnnn );

2024-03-11 Thread Laurenz Albe
On Mon, 2024-03-11 at 12:36 +, Tefft, Michael J wrote: > I have been struggling to set n_distinct on a few table columns, and confirm > that my changes have actually been accepted. >   > I have a 400-million row table with 81 partitions. PostgreSQL version is > 14.11. > Column p_id has 13

Re: Pgxs - How to reference another extension

2024-03-11 Thread Artur Zakirov
On Mon, 11 Mar 2024 at 13:26, Michał Kłeczek wrote: > > > > On 11 Mar 2024, at 11:41, Michał Kłeczek wrote: > > > > Hi, > > > > I am trying to create an extension that delegates some calls to btree_gist > > functions: > > > > DirectFunctionCall5Coll( > >gbt_text_consistent,

alter table xxx alter column yyy set (n_distinct=nnnn );

2024-03-11 Thread Tefft, Michael J
I have been struggling to set n_distinct on a few table columns, and confirm that my changes have actually been accepted. I have a 400-million row table with 81 partitions. PostgreSQL version is 14.11. Column p_id has 13 million distinct values but pg_stats says n_distinct is only 82k. Column

Re: Create a standby server

2024-03-11 Thread normandavis1990
> On Monday, March 11th, 2024 at 3:39 PM, Mateusz Henicz > wrote: > Hey, > Check your parameter primary_conninfo on any standby server, you should find > here information about the user used for replication and its password or path > to .pgpass file, where the password is stored. If there is

Re: Create a standby server

2024-03-11 Thread normandavis1990
> On Monday, March 11th, 2024 at 3:43 PM, Stephen Frost > wrote: > Greetings, > > * normandavis1990 (normandavis1...@proton.me) wrote: > > > I have a master and tow standby servers. I want to create another one.  > > These servers are made by someone else and I am a newbie in PostgreSQL. > >

Re: Pgxs - How to reference another extension

2024-03-11 Thread Michał Kłeczek
> On 11 Mar 2024, at 11:41, Michał Kłeczek wrote: > > Hi, > > I am trying to create an extension that delegates some calls to btree_gist > functions: > > DirectFunctionCall5Coll( >gbt_text_consistent, …other arguments); > > Basic PGXS Makefile does not work - I get linker

Re: Create a standby server

2024-03-11 Thread Stephen Frost
Greetings, * normandavis1990 (normandavis1...@proton.me) wrote: > I have a master and tow standby servers. I want to create another one. These > servers are made by someone else and I am a newbie in PostgreSQL. > I found the following two tutorials: [...] > A) Which on is better and easier?

Re: Create a standby server

2024-03-11 Thread Mateusz Henicz
Hey, Check your parameter primary_conninfo on any standby server, you should find here information about the user used for replication and its password or path to .pgpass file, where the password is stored. If there is no password or .pgpass file defined, then you do not need any password most

Re: could not open file "global/pg_filenode.map": Operation not permitted

2024-03-11 Thread Stephen Frost
Greetings, * Nick Renders (postg...@arcict.com) wrote: > The one thing different about this machine however, is that it runs 2 > instances of Postgres: > - cluster A on port 165 > - cluster B on port 164 > Cluster A is actually a backup from another Postgres server that is restored > on a daily

Create a standby server

2024-03-11 Thread normandavis1990
Hello, I have a master and tow standby servers. I want to create another one. These servers are made by someone else and I am a newbie in PostgreSQL. I found the following two tutorials: https://linuxconfig.org/how-to-create-a-hot-standby-with-postgresql

Re: could not open file "global/pg_filenode.map": Operation not permitted

2024-03-11 Thread Laurenz Albe
On Mon, 2024-03-11 at 11:11 +0100, Nick Renders wrote: > We have several other machines with a similar setup, but this is the only > server that has this issue. > > [...] Cluster A is actually a backup from another Postgres server that is > restored on a > daily basis via Barman. This means

Pgxs - How to reference another extension

2024-03-11 Thread Michał Kłeczek
Hi, I am trying to create an extension that delegates some calls to btree_gist functions: DirectFunctionCall5Coll( gbt_text_consistent, …other arguments); Basic PGXS Makefile does not work - I get linker error: Undefined symbols for architecture arm64:

Re: About rsync

2024-03-11 Thread Stephen Frost
Greetings, * Rama Krishnan (raghuld...@gmail.com) wrote: > I have primary and stand by setup in that customer using wal_keep_segment > very low number and database size were also high so that cilent asking with > me in order use pgbase backup can't we use rsyn > > Here my question is if the wal

About rsync

2024-03-11 Thread Rama Krishnan
Hi Team, I have primary and stand by setup in that customer using wal_keep_segment very low number and database size were also high so that cilent asking with me in order use pgbase backup can't we use rsyn Here my question is if the wal is is presented on primary and not in standby then rsync

Re: could not open file "global/pg_filenode.map": Operation not permitted

2024-03-11 Thread Nick Renders
Thank you for your reply Laurenz. I don't think it is related to any third party security software. We have several other machines with a similar setup, but this is the only server that has this issue. The one thing different about this machine however, is that it runs 2 instances of Postgres:

Performance (and general) considerations between views and functions

2024-03-11 Thread Wiwwo Staff
Hi Community! I am in the process of re-writing SQLs in app code to a more DB side approach. My first idea was to write views, and let the app query those views; i'd need to rewrite some queries to expose the "parameters" (where condition fields) of those queries in the select part, to expose

Implementing product-aggregate

2024-03-11 Thread Jan Kohnert
Hi, we need a product aggregate and used to implement this as exp(sum(ln([COLUMN]))) While using the sum of logarithms is working RDBMS-independently, we'd like to switch to a more PostgreSQL native way of doing this and implement an aggregate to be used. Currently the implementation is

Re: walsender RAM increases by 500 MB while data is 80 MB

2024-03-11 Thread Masahiko Sawada
On Mon, Mar 11, 2024 at 12:33 AM Avi Weinberg wrote: > > Hi Experts, > > > > Your input is most welcome! > > > > We are using Postgres 13 (and plan to upgrade to 15 soon). We have logical > replication with about 40 servers subscribing to one publisher. 40 Walsender > processes are running on

Re: Seeing high query planning time on Azure Postgres Single Server version 11.

2024-03-11 Thread hassan rafi
Thanks all. Will try upgrading the postgres version. On Sun, Mar 10, 2024 at 11:44 PM Ron Johnson wrote: > On Sun, Mar 10, 2024 at 1:34 PM Greg Sabino Mullane > wrote: > >> >> On Sat, Mar 9, 2024 at 1:57 PM hassan rafi >> wrote: >> >>> Would upgrading to the latest version of Postgres