Reuse an existing slot with a new initdb

2020-05-13 Thread David G. Johnston
On Wednesday, May 13, 2020, Michael Paquier wrote: > On Wed, May 13, 2020 at 02:12:45PM -0700, live-school support wrote: > > I didn't recal that it was not possible to create a hot standby with a > fresh > > new install and pg_dumpall :(. > > > > only pg_basebackup or an exact copy of the data f

Re: Practical usage of large objects.

2020-05-13 Thread Michael Paquier
On Wed, May 13, 2020 at 01:55:48PM -0400, Tom Lane wrote: > Dmitry Igrishin writes: >> As you know, PostgreSQL has a large objects facility [1]. I'm curious >> are there real systems which are use this feature? > > We get questions about it regularly, so yeah people use it. I recall that some ap

Re: Reuse an existing slot with a new initdb

2020-05-13 Thread Michael Paquier
On Wed, May 13, 2020 at 02:12:45PM -0700, live-school support wrote: > I didn't recal that it was not possible to create a hot standby with a fresh > new install and pg_dumpall :(. > > only pg_basebackup or an exact copy of the data folder can do it right? is > the reason technical or else? When u

Re: Practical usage of large objects.

2020-05-13 Thread Ron
Our databases use bytea instead.  (I don't know why the application vendor decided on that.) On 5/13/20 12:53 PM, Dmitry Igrishin wrote: Hello all, As you know, PostgreSQL has a large objects facility [1]. I'm curious are there real systems which are use this feature? I'm asking because and I'

Re: ESQL/C: a ROLLBACK rolls back a COMMITED transaction

2020-05-13 Thread Adrian Klaver
On 5/13/20 11:16 AM, Matthias Apitz wrote: El día Mittwoch, Mai 13, 2020 a las 08:15:40 -0700, Adrian Klaver escribió: In your original post you had: "We're facing in our ESQL/C written application a situation where a commit'ed INSERT into a table is rolled back. I have here the ESQL/C logging

Re: Reuse an existing slot with a new initdb

2020-05-13 Thread Support
On 5/13/2020 1:24 PM, Laurenz Albe wrote: On Wed, 2020-05-13 at 06:18 -0700, Support wrote: On 5/8/2020 1:51 PM, Support wrote: I normalized my replislots with the name of my nodes. I have 2 options in my recovery script that tries first pg_basebackup to recover and sync the hot standby, but

Re: Reuse an existing slot with a new initdb

2020-05-13 Thread Support
On 5/13/2020 1:24 PM, Laurenz Albe wrote: On Wed, 2020-05-13 at 06:18 -0700, Support wrote: On 5/8/2020 1:51 PM, Support wrote: I normalized my replislots with the name of my nodes. I have 2 options in my recovery script that tries first pg_basebackup to recover and sync the hot standby, but

Re: Reuse an existing slot with a new initdb

2020-05-13 Thread live-school support
Best Regards LIVE-SCHOOL FOUNDATION http://www.live-school.net in...@live-school.net On 5/13/2020 1:24 PM, Laurenz Albe wrote: On Wed, 2020-05-13 at 06:18 -0700, Support wrote: On 5/8/2020 1:51 PM, Support wrote: I normalized my replislots with the name of my nodes. I have 2 options in my re

Re: Reuse an existing slot with a new initdb

2020-05-13 Thread Laurenz Albe
On Wed, 2020-05-13 at 06:18 -0700, Support wrote: > On 5/8/2020 1:51 PM, Support wrote: > > I normalized my replislots with the name of my nodes. > > I have 2 options in my recovery script that tries first pg_basebackup > > to recover and sync the hot standby, but unfortunately big DB fails > > so

Re: ESQL/C: a ROLLBACK rolls back a COMMITED transaction

2020-05-13 Thread Matthias Apitz
El día Mittwoch, Mai 13, 2020 a las 08:15:40 -0700, Adrian Klaver escribió: > In your original post you had: > > "We're facing in our ESQL/C written application a situation where a > commit'ed INSERT into a table is rolled back. I have here the ESQL/C > logging of the problem:" > ... > > "The IN

Re: Practical usage of large objects.

2020-05-13 Thread Tom Lane
Dmitry Igrishin writes: > As you know, PostgreSQL has a large objects facility [1]. I'm curious > are there real systems which are use this feature? We get questions about it regularly, so yeah people use it. regards, tom lane

Practical usage of large objects.

2020-05-13 Thread Dmitry Igrishin
Hello all, As you know, PostgreSQL has a large objects facility [1]. I'm curious are there real systems which are use this feature? I'm asking because and I'm in doubt should the Pgfe driver [2] provide the convenient API for working with large objects or not. Thanks! [1] https://www.postgresql.

Re: ESQL/C: a ROLLBACK rolls back a COMMITED transaction

2020-05-13 Thread Adrian Klaver
On 5/12/20 10:34 PM, Matthias Apitz wrote: El día Dienstag, Mai 12, 2020 a las 05:17:33 -0700, Adrian Klaver escribió: insert into swd_auftrag .. COMMIT? This question (if it was a question) I don't understand. From your original message: "The INSERT of 1 row into table swd_daten was OK

Re: Why is it that “aggregate functions are not allowed in FROM clause of their own query level”?

2020-05-13 Thread Tom Lane
Tom Ellis writes: > A. Am I right in thinking that the two forms are equivalent? No. In the first case the SUM() aggregate does not use any variables belonging to the "LATERAL (SELECT ..." query level, therefore, per SQL standard, it is not an aggregate of that query but an aggregate of the next

Re: Create user mapping for role

2020-05-13 Thread Tom Lane
Gerard Weatherby writes: > Can a foreign data wrapper user mapping by created for multiple users via a > role? i.e. if bob, sally, and john belong to role foreigusers, is it possible > to do something like > Create user mapping for foreignusers server … You can certainly create a user mapping f

Re: Enforcing uniqueness on [real estate/postal] addresses

2020-05-13 Thread David Goodenough
There is also What3Words.com, which give a three word name to each 3m square over the world. Longer that USNG but easier to remember/type/say. David On Wednesday, 13 May 2020 14:33:30 BST Basques, Bob (CI-StPaul) wrote: > I've been following this thread with some interest. > > Was wondering i

Create user mapping for role

2020-05-13 Thread Gerard Weatherby
Can a foreign data wrapper user mapping by created for multiple users via a role? i.e. if bob, sally, and john belong to role foreigusers, is it possible to do something like Create user mapping for foreignusers server …

RE: Enforcing uniqueness on [real estate/postal] addresses

2020-05-13 Thread Basques, Bob (CI-StPaul)
Yup, that's where I was going with the USNG use. Separate dataset bound to addresses where needed/desired for detailed locating. And where no address is present, the USNG becomes the address. Bobb -Original Message- From: Rich Shepard Sent: Wednesday, May 13, 2020 9:01 AM To: pgs

Re: ESQL/C: a ROLLBACK rolls back a COMMITED transaction

2020-05-13 Thread Tom Lane
Matthias Apitz writes: > El día Dienstag, Mai 12, 2020 a las 08:01:15 -0400, Tom Lane escribió: >> Not an unreasonable suggestion, but it'd be more likely to happen if >> you send in a patch ;-). > as the first argument to ECPGdo() is of type int we can not do a hack > like "__LINE__:"__FILE__ (i

RE: Enforcing uniqueness on [real estate/postal] addresses

2020-05-13 Thread Rich Shepard
On Wed, 13 May 2020, Basques, Bob (CI-StPaul) wrote: Was wondering if you ever thought about binding the textual address to a USNG location. https://usngcenter.org/ Bobb, et al.: Why not have a 'parent' table with entries such as 'Foo Farm' and a 'child' table with rows for sub-parts of the p

Re: Why is it that “aggregate functions are not allowed in FROM clause of their own query level”?

2020-05-13 Thread David G. Johnston
On Wednesday, May 13, 2020, Tom Ellis wrote: > Hello, > > The code under 1 gives me the error message "aggregate functions are > not allowed in FROM clause of their own query level" whereas the code > under 2 is permitted. Unless I am much mistaken the latter is > equivalent to the former because

RE: Enforcing uniqueness on [real estate/postal] addresses

2020-05-13 Thread Basques, Bob (CI-StPaul)
I've been following this thread with some interest. Was wondering if you ever thought about binding the textual address to a USNG location. https://usngcenter.org/ You can easily add individual locations within something like a farm field with as few as eight unique digits that would identify

Re: Reuse an existing slot with a new initdb

2020-05-13 Thread Support
On 5/8/2020 1:51 PM, Support wrote: I normalized my replislots with the name of my nodes. I have 2 options in my recovery script that tries first pg_basebackup to recover and sync the hot standby, but unfortunately big DB fails sometimes due to very slow or unstable network. So my second optio

Re: what is the best way to access cold data on another server?

2020-05-13 Thread Laurenz Albe
On Wed, 2020-05-13 at 10:12 +0300, Amine Tengilimoglu wrote: > In addition to the actively used data, there are other data that are very > little accessed. > I want to separate the less used data to save space and reduce maintenance > operations. > I want to use a separate postgres instance for t

Why is it that “aggregate functions are not allowed in FROM clause of their own query level”?

2020-05-13 Thread Tom Ellis
Hello, The code under 1 gives me the error message "aggregate functions are not allowed in FROM clause of their own query level" whereas the code under 2 is permitted. Unless I am much mistaken the latter is equivalent to the former because it just makes a new "local" name for `v`. I'm writing a

Re: ESQL/C: a ROLLBACK rolls back a COMMITED transaction

2020-05-13 Thread Ravi Krishna
the pgm does an INSERT, after this the row is there and can be seen with SELECT; than I CLOSE a non existing cursor, which rolls back the INSERTed data: I have not done coding in ESQL/C in a long time, but shouldn't that be expected as any error should trigger a rollback.

Re: ESQL/C: a ROLLBACK rolls back a COMMITED transaction

2020-05-13 Thread Matthias Apitz
I finally can reproduce the issue with a small ESQL/C written program for that purpose. I could attach here the source, but even seeing its printouts, all is perhaps clear: the pgm does an INSERT, after this the row is there and can be seen with SELECT; than I CLOSE a non existing cursor, which

Re: Column reset all values

2020-05-13 Thread Olivier Gautherot
Hi Otar, On Wed, May 13, 2020 at 10:15 AM otar shavadze wrote: > postgres version 12 > I have very simple update query, like this: > > update my_table > set > col = NULL > where > col IS NOT NULL; > > my_table contains few million rows, col is indexed column > > Fastest way would be alter tabl

Re: Column reset all values

2020-05-13 Thread Peter J. Holzer
On 2020-05-13 12:13:20 +0400, otar shavadze wrote: > postgres version 12 > I have very simple update query, like this: > > update my_table  > set  > col = NULL > where > col IS NOT NULL; > > my_table contains few million rows, col is indexed column You might want to drop the index before doing t

Column reset all values

2020-05-13 Thread otar shavadze
postgres version 12 I have very simple update query, like this: update my_table set col = NULL where col IS NOT NULL; my_table contains few million rows, col is indexed column Fastest way would be alter table, drop column and then add column again, but I can't do this just because on this colu

Re: [EXTERNAL] Re: PostgreSQL-12 replication failover, pg_rewind fails

2020-05-13 Thread Michael Paquier
On Wed, May 13, 2020 at 04:58:15AM +, Mariya Rampurawala wrote: > Thank you Kyotaro and Laurenz for your quick responses. > This helped me get my setup working. Please note that we have added in Postgres 13 the possibility to use a restore_command when using pg_rewind if the parameter is set i

what is the best way to access cold data on another server?

2020-05-13 Thread Amine Tengilimoglu
Hello everyone; In addition to the actively used data, there are other data that are very little accessed. I want to separate the less used data to save space and reduce maintenance operations. I want to use a separate postgres instance for this. Now the question is; How do I link these two in

Re: [EXTERNAL] Re: PostgreSQL-12 replication failover, pg_rewind fails

2020-05-13 Thread Mariya Rampurawala
Thank you Kyotaro and Laurenz for your quick responses. This helped me get my setup working. Regards, Mariya On 13/05/20, 6:51 AM, "Kyotaro Horiguchi" wrote: At Tue, 12 May 2020 17:29:50 +0200, Laurenz Albe wrote in > On Tue, 2020-05-12 at 09:40 +, Mariya Rampurawala wrote: