Re: Using a TRIGGER with window functions.

2021-08-16 Thread Tom Lane
I wrote: > "David G. Johnston" writes: >> On Sun, Aug 15, 2021 at 1:24 AM Pól Ua Laoínecháin wrote: >>> Why are window functions now allowed in UPDATEs > I suspect the error check was just copied from the aggregate-function > case. It's clear why we can't put aggregates in UPDATE: there'd no >

Re: Single mater replica setup for an existing DB

2021-08-16 Thread Vijaykumar Jain
On Mon, 16 Aug 2021 at 00:47, Digimer wrote: > Hi all, > > Could I get recommendations on how to convert an existing database to a > single-master replica setup? > > I'm running on RHEL 8 (pgsql version 10.17). I'd like to replicate the > existing database to 1 (maybe 2) other hosts, synchron

Re: Cluster fencing tool/software for PostgreSQL cluster with streaming replication

2021-08-16 Thread Bruce Momjian
On Mon, Aug 16, 2021 at 10:39:34AM -0400, Mladen Gogala wrote: > Hi Vikas! > > I used to see you on the mailing list for another database, that shall > remain unnamed but starts with the letter "O". To answer your question: I > have very good experience with Veritas Cluster on both Linux and Solar

Re: Using a TRIGGER with window functions.

2021-08-16 Thread Tom Lane
"David G. Johnston" writes: > On Sun, Aug 15, 2021 at 1:24 AM Pól Ua Laoínecháin wrote: >> Why are window functions now allowed in UPDATEs > You can get it to work via a subquery/FROM clause computation. That it > doesn't work directly in the SET clause I don't know off-hand, but most > likely

Re: Using a TRIGGER with window functions.

2021-08-16 Thread David G. Johnston
On Sun, Aug 15, 2021 at 1:24 AM Pól Ua Laoínecháin wrote: > > ERROR: window functions are not allowed in UPDATE LINE 2: SET > sort_order = activity_id - FIRST_VALUE(activity_id) > > Why are window functions now allowed in UPDATEs > You can get it to work via a subquery/FROM clause computation.

Re: Using a TRIGGER with window functions.

2021-08-16 Thread Michael Lewis
If you want to update many rows after updating N rows, you want an after STATEMENT trigger which is executed after insert, update or delete. You also want to ensure that only that function maintains sort_order field and that you don't update recursively, perhaps by executing that function when NEW.

Re: postgres disconnects on master after setting up replication

2021-08-16 Thread Andy Hall
ing after we setup > > replication from the database it was connecting to ( which is now the > > primary in a replicating pair ) with errors such as the following... > > > CLIENT SIDE: DBNAME/logs/20210815-200601.20966.log:SessionManagerImpl > > WARN 20210816-00:01:00.252 - A

Re: help with fmgr

2021-08-16 Thread Tom Lane
Luca Ferrari writes: > I've two main doubts: > - is fmgr working for non PL functions? Because I cannot see messages > starting when an internal function is invoked; Built-in functions do not support fmgr_hook; see the order of tests in fmgr_info_cxt_security(). I'd be loath to change that, for

help with fmgr

2021-08-16 Thread Luca Ferrari
Hi all, I'm trying to understand how fmgr works, and I've written a very simple module that checks if functions f_test, f_test2 (defined by myself in SQL) or hashtext (internal) needs fmgr, and in the case print out a message when the fmgr is invoked. I've two main doubts: - is fmgr working for non

Re: postgres disconnects on master after setting up replication

2021-08-16 Thread Tom Lane
he following... > CLIENT SIDE: DBNAME/logs/20210815-200601.20966.log:SessionManagerImpl > WARN 20210816-00:01:00.252 - A session lost connection with the > database. Disabling all sessions > SERVER SIDE: 2021-08-16 01:48:27 BST FATAL: unsupported frontend > protocol 1234.5680: server supp

postgres disconnects on master after setting up replication

2021-08-16 Thread Andy Hall
/20210815-200601.20966.log:SessionManagerImpl WARN 20210816-00:01:00.252 - A session lost connection with the database. Disabling all sessions SERVER SIDE: 2021-08-16 01:48:27 BST FATAL: unsupported frontend protocol 1234.5680: server supports 1.0 to 3.0 ( these are different times but you get the idea

Re: Cluster fencing tool/software for PostgreSQL cluster with streaming replication

2021-08-16 Thread Mladen Gogala
Hi Vikas! I used to see you on the mailing list for another database, that shall remain unnamed but starts with the letter "O". To answer your question: I have very good experience with Veritas Cluster on both Linux and Solaris (or was it Slowaris? I forgot the exact spelling :). It's an indu

Cluster fencing tool/software for PostgreSQL cluster with streaming replication

2021-08-16 Thread Vikas Sharma
Hi, I am planning for an enterprise grade PostgreSQL cluster and so looking for the tool/softwares which will do the cluster management or fencing to avoid split brain. Please, could you let me know if there are some tools/software which can do that so it can be used in a production environment.

RE: EXTERNAL: Re: Could not startup new database - Oracle to Postgres Migration error.

2021-08-16 Thread Pansara, Jiten
Hello, Thanks a lot for quick response. I can see below after executing the Perl command given by you. PS C:\ora2pg-22.1> perl -e "use DBD::Pg" PS C:\ora2pg-22.1> Jiten Pansara Senior Database Analyst T: +91 9158149600 -Original Message- From: Julien Rouhaud Sent: Monday, August

Re: EXTERNAL: Re: Could not startup new database - Oracle to Postgres Migration error.

2021-08-16 Thread Julien Rouhaud
On Mon, Aug 16, 2021 at 5:16 PM Pansara, Jiten wrote: > > Thanks a lot for quick response. I can see below after executing the Perl > command given by you. > > PS C:\ora2pg-22.1> perl -e "use DBD::Pg" > PS C:\ora2pg-22.1> It means that you already have DBD::Pg installed.

Re: Could not startup new database - Oracle to Postgres Migration error.

2021-08-16 Thread Julien Rouhaud
On Mon, Aug 16, 2021 at 4:46 PM Pansara, Jiten wrote: > > I was following Ora2Pg : Migrates Oracle to PostgreSQL (darold.net) to > migrate the db and am stuck when trying to execute below command. > > perl -MCPAN -e 'install DBD::Pg' It would be better to send the error in plain text rather than

Could not startup new database - Oracle to Postgres Migration error.

2021-08-16 Thread Pansara, Jiten
Hello All, I am facing issue while migrating database from Oracle to Postgres. Any suggestions will be really appreciated. I was following Ora2Pg : Migrates Oracle to PostgreSQL (darold.net) to migrate the db and am stuck when trying to execute bel

Debian APT repo instructions need updating

2021-08-16 Thread Laura Smith
Not sure if this is the right place to post it, but I wanted to higlight that the Debian repo instructions (https://www.postgresql.org/download/linux/debian/) need updating to bring them inline with Debian best practices. As per https://wiki.debian.org/DebianRepository/UseThirdParty: "The key