Re: WAL File Recovery on Standby Server Stops Before End of WAL Files

2021-10-27 Thread Dilip Kumar
On Thu, Oct 28, 2021 at 7:28 AM Kyotaro Horiguchi wrote: > > At Wed, 27 Oct 2021 16:42:52 +, "Ryan, Les" wrote in > > 2021-10-27 10:26:31.467 MDT [2012] LOG: redo starts at 419/5229A858 > ... > > 2021-10-27 10:26:36.188 MDT [2012] LOG: restored log file > > "00010419005A" from

Re: WAL File Recovery on Standby Server Stops Before End of WAL Files

2021-10-27 Thread Kyotaro Horiguchi
At Wed, 27 Oct 2021 16:42:52 +, "Ryan, Les" wrote in > 2021-10-27 10:26:31.467 MDT [2012] LOG: redo starts at 419/5229A858 ... > 2021-10-27 10:26:36.188 MDT [2012] LOG: restored log file > "00010419005A" from archive > 2021-10-27 10:26:36.750 MDT [2012] LOG: consistent

Re: jsonb: unwrapping text

2021-10-27 Thread David G. Johnston
On Wed, Oct 27, 2021 at 11:58 AM wrote: > > I've found out that one can treat a string singleton as if it > were an array: > > foo=# select '"foo"'::jsonb ->> 0; >?column? > -- >foo > (1 row) > > which conveniently returns the right type. My question: can I rely > on that,

Re: Segmentation fault in volatile c function

2021-10-27 Thread Louise Grandjonc
Thank you! I used that. The segmentation fault came from a later code in my hook. But that helped. > On Oct 27, 2021, at 12:47 PM, Peter Geoghegan wrote: > > On Wed, Oct 27, 2021 at 12:39 PM Louise Grandjonc > wrote: >> I'm creating my first ever extension. The function that I'm trying to

Re: psql could not connect to server after complete reinstallation [Ubuntu 21.10 / PostgreSQL 13]

2021-10-27 Thread Adrian Klaver
On 10/27/21 12:51, Jérémy Garniaux wrote: Adrian, Le 27/10/2021 à 19:30, Adrian Klaver a écrit : While you are at it: sudo pg_dropcluster 12 main to get rid of the orphaned cluster. Great, thanks for your help. Everything is back in order now. I found out about Pg clusters in the

Re: psql could not connect to server after complete reinstallation [Ubuntu 21.10 / PostgreSQL 13]

2021-10-27 Thread Jérémy Garniaux
Adrian, Le 27/10/2021 à 19:30, Adrian Klaver a écrit : Your Postgres 13 cluster is up and listening on 5433. Your choices: 1) Connect using psql -d -U -p 5433 2) Open: sudo vi /etc/postgresql/13/main/postgresql.conf and change port = 5433 to port = 5432 and then restart server.

Re: Segmentation fault in volatile c function

2021-10-27 Thread Peter Geoghegan
On Wed, Oct 27, 2021 at 12:39 PM Louise Grandjonc wrote: > I'm creating my first ever extension. The function that I'm trying to write > takes the schema and name of a table, and adds it in a table with all the > tables the extension follows. > In that table I want the schema, name and oid of

Segmentation fault in volatile c function

2021-10-27 Thread Louise Grandjonc
Hi, I'm creating my first ever extension. The function that I'm trying to write takes the schema and name of a table, and adds it in a table with all the tables the extension follows. In that table I want the schema, name and oid of the table. I created a C function for that. Here is the code

jsonb: unwrapping text

2021-10-27 Thread tomas
Hi, I'm trying to extract text from a jsonb 'string'. Simply casting gives me the string wrapped in quotes: foo=# select '"foo"'::jsonb::text; text --- "foo" (1 row) This, of course, makes kind of sense, since it /is/ the JSON's textual representation. What is the canonical

Re: Strange sequences - how to construct?

2021-10-27 Thread SQL Padawan
> --- example: lets get 3 sequences > > select next_sequence(), next_sequence(), next_sequence(); > --- inspect the table to see what happned > select * from my_sequence; Thanks for your input on this issue. SQLP Sent with ProtonMail Secure Email.

Re: psql could not connect to server after complete reinstallation [Ubuntu 21.10 / PostgreSQL 13]

2021-10-27 Thread Adrian Klaver
On 10/27/21 9:01 AM, Jérémy Garniaux wrote: Hi Adrian, Thanks for answering on both sides! Same response as to your SO question: What is the output of pg_lsclusters? Ver Cluster Port Status    Owner    Data directory  Log file 12  main    5432

WAL File Recovery on Standby Server Stops Before End of WAL Files

2021-10-27 Thread Ryan, Les
Hello, I'm hoping to get some suggestions on what to do here. I am running PostgreSQL version 13.2 and am shipping the WAL files to a standby server. Once a day I restart the standby server and it recovers the new WAL files that have been shipped to it. Everything was working great until

Re: psql could not connect to server after complete reinstallation [Ubuntu 21.10 / PostgreSQL 13]

2021-10-27 Thread Jérémy Garniaux
Hi Adrian, Thanks for answering on both sides! Le 27/10/2021 à 17:58, Adrian Klaver a écrit : On 10/27/21 08:51, Jérémy Garniaux wrote: Hi, After experiencing issues related to the existence of two different PostgreSQL versions installed on the same machine, I decided to do a "remove

Re: psql could not connect to server after complete reinstallation [Ubuntu 21.10 / PostgreSQL 13]

2021-10-27 Thread Adrian Klaver
On 10/27/21 08:51, Jérémy Garniaux wrote: Hi, After experiencing issues related to the existence of two different PostgreSQL versions installed on the same machine, I decided to do a "remove --purge postgresql*" and reinstall postgresql-13. Now the output of "psql --version" is "psql

psql could not connect to server after complete reinstallation [Ubuntu 21.10 / PostgreSQL 13]

2021-10-27 Thread Jérémy Garniaux
Hi, After experiencing issues related to the existence of two different PostgreSQL versions installed on the same machine, I decided to do a "remove --purge postgresql*" and reinstall postgresql-13. Now the output of "psql --version" is "psql (PostgreSQL) 13.4 (Ubuntu 13.4-1)". However,

Re: ZFS filesystem - supported ?

2021-10-27 Thread Laurenz Albe
On Wed, 2021-10-27 at 11:21 +1300, Lucas wrote: > The snapshots are done this way: > 1. Grab the latest applied WAL File for further references, stores that in a > variable in Bash > 2. Stop the Postgres process > 3. Check it is stopped > 4. Start the Block level EBS Snapshot process > 5. Applied

Re: pg_dump and pg_restore and foreign keys

2021-10-27 Thread Tore Halvorsen
Then I'll try that, thank you :) On Wed, Oct 27, 2021 at 4:04 PM Tom Lane wrote: > Tore Halvorsen writes: > > That would be appending it for "pg_catalog.pg_get_constraintdef(oid) AS > > condef" in getConstraints in pg_dump.c? > > No, you want to mess with the text printed by dumpConstraint().

Re: Determining if a table really changed in a trigger

2021-10-27 Thread Mitar
Hi! On Wed, Oct 27, 2021 at 12:56 PM Marcos Pegoraro wrote: >> Oh, very interesting. I thought that this is not possible because WHEN >> condition on triggers does not have NEW and OLD. But this is a very >> cool way to combine rules with triggers, where a rule can still >> operate by row. > >

Re: pg_dump and pg_restore and foreign keys

2021-10-27 Thread Tom Lane
Tore Halvorsen writes: > That would be appending it for "pg_catalog.pg_get_constraintdef(oid) AS > condef" in getConstraints in pg_dump.c? No, you want to mess with the text printed by dumpConstraint(). regards, tom lane

Re: pg_dump and pg_restore and foreign keys

2021-10-27 Thread Tore Halvorsen
That would be appending it for "pg_catalog.pg_get_constraintdef(oid) AS condef" in getConstraints in pg_dump.c? On Wed, Oct 27, 2021 at 3:27 PM Tom Lane wrote: > Tore Halvorsen writes: > > I'm trying to restore a database where adding foreign key constraints > takes > > most of the time. Does

Re: pg_dump and pg_restore and foreign keys

2021-10-27 Thread Tom Lane
Tore Halvorsen writes: > I'm trying to restore a database where adding foreign key constraints takes > most of the time. Does there exist a simple way to make either pg_dump or > pg_restore handle them as "not valid", and defer the validation. No. It's kind of a neat idea perhaps, but it's not

Re: Python3 for PostgreSQL 14

2021-10-27 Thread Magnus Hagander
On Sat, Oct 23, 2021 at 10:40 PM Adrian Klaver wrote: > On 10/23/21 13:00, Дмитрий Иванов wrote: > > Да. > > Python extension issues occurred on Windows Server 2012 and Windows 10 > > Pro. Experimentally, when installing version 3.7.4, everything worked. > > If you used the EDB installer for the

pg_dump and pg_restore and foreign keys

2021-10-27 Thread Tore Halvorsen
Hi, I hope this is the correct place for this question. I'm trying to restore a database where adding foreign key constraints takes most of the time. Does there exist a simple way to make either pg_dump or pg_restore handle them as "not valid", and defer the validation. -- Eld på åren og sol

Re: Determining if a table really changed in a trigger

2021-10-27 Thread Marcos Pegoraro
> > Oh, very interesting. I thought that this is not possible because WHEN > condition on triggers does not have NEW and OLD. But this is a very > cool way to combine rules with triggers, where a rule can still > operate by row. > > That is not true create table test(i integer); create function

Re: String comparison fails for some cases after migration

2021-10-27 Thread Jayadevan M
On Wed, Oct 27, 2021 at 11:49 AM Julien Rouhaud wrote: > > > Most likely you had a different version of the glibc or ICU libraries > on the new system, which lead to your indexes on collatable datatypes > partially corrupted. See https://wiki.postgresql.org/wiki/Collations > for more details. >

Re: Determining if a table really changed in a trigger

2021-10-27 Thread Thomas Kellerer
Mitar schrieb am 26.10.2021 um 09:05: > I would like to test inside trigger_function if the table really > changed. I have tried to do: > > PERFORM * FROM ((TABLE old_table EXCEPT TABLE new_table) UNION ALL > (TABLE new_table EXCEPT TABLE old_table)) AS differences LIMIT 1; > IF FOUND THEN > ...

Re: Determining if a table really changed in a trigger

2021-10-27 Thread Mitar
Hi! On Wed, Oct 27, 2021 at 3:56 AM Michael Lewis wrote: > If you end up with no rows changing from an insert or delete, something seems > awry. Unless you mean 0 rows affected. Isn't this the same? Isn't the number of rows affected the same as the number of rows changing? For example: DELETE

Re: String comparison fails for some cases after migration

2021-10-27 Thread Tom Lane
Jayadevan M writes: > We moved our PostgreSQL database from one hosting provider to another using > pgbackrest. In the new environment, some comparison operations were > failing. The issue was fixed by running an update. But I am trying to find > out what would have happened. Did the

Re: String comparison fails for some cases after migration

2021-10-27 Thread Julien Rouhaud
Hi, On Wed, Oct 27, 2021 at 2:12 PM Jayadevan M wrote: > > We moved our PostgreSQL database from one hosting provider to another using > pgbackrest. In the new environment, some comparison operations were > failing. The issue was fixed by running an update. But I am trying to find > out

String comparison fails for some cases after migration

2021-10-27 Thread Jayadevan M
Hello all, We moved our PostgreSQL database from one hosting provider to another using pgbackrest. In the new environment, some comparison operations were failing. The issue was fixed by running an update. But I am trying to find out what would have happened. select * from accounts where