Re: pg_restore (fromuser -> touser)

2021-07-26 Thread Ben Madin
Hi - we have had to do such operations quite commonly, if you want to automate / stream such a change I would suggest that you look into sed. Off the top of my head, consider something like this: pg_dump --format=p --schema=schema_a original_database | sed 's/ schema_a./ schema_b./g' | psql

single-row deadlock

2021-07-26 Thread guntiso
Hi, After upgrading from PostgreSQL 9.6 to 13 we started to experience locking issues once per week or two. Replacing exclusive table lock with helper table row lock did not help. Now it seems like a single-row deadlocks can occur, which should not be possible (audit_data_lock table contains

Re: Logical replication from Rds into on-premise

2021-07-26 Thread Cory Nemelka
On Mon, Jul 26, 2021 at 12:06 PM Rama Krishnan wrote: > Hi all, > > I have a postgres server on Aws RDS no i want to replicate the data or > logical replication into the on-premise server. I have gone through DMS > provides the service buy it pricing was high. Do we have any option or > method

Re: pg-audit extension

2021-07-26 Thread Ron
On 7/26/21 1:24 PM, Olagoke Akinyemi wrote: Hello, Could someone please, give me a quick guide? I am trying to install pgaudit extension on an existing PostgreSQL instance but I want to place it on a different this mount. How can i do this? "but I want to place it on a different this

pg-audit extension

2021-07-26 Thread Olagoke Akinyemi
Hello, Could someone please, give me a quick guide? I am trying to install pgaudit extension on an existing PostgreSQL instance but I want to place it on a different this mount. How can i do this?  Your assistance will be highly appreciated. Regards,Spago

Logical replication from Rds into on-premise

2021-07-26 Thread Rama Krishnan
Hi all, I have a postgres server on Aws RDS no i want to replicate the data or logical replication into the on-premise server. I have gone through DMS provides the service buy it pricing was high. Do we have any option or method to achieve this? Thanks RamaKrishnan

Re: pg_restore (fromuser -> touser)

2021-07-26 Thread Mayan
Thanks for the responses everyone and the reality check of how new features get in. I will look into the suggestion by Vijaykumar in more detail and try it out. Thanks again, Mayan On Sun, Jul 25, 2021 at 10:11 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Sun, Jul 25, 2021 at

Re: Recursive Parent-Child Function Bottom Up

2021-07-26 Thread Rob Sargent
On 7/26/21 9:55 AM, Alban Hertroys wrote: On 26 Jul 2021, at 17:52, Alban Hertroys wrote: Something like this: with recursive foo (id, parent, children_ids) as ( select id, parent, null::text from tree t where not exists ( select 1 from tree c where

Re: Recursive Parent-Child Function Bottom Up

2021-07-26 Thread Rob Sargent
On 7/26/21 9:55 AM, Alban Hertroys wrote: On 26 Jul 2021, at 17:52, Alban Hertroys wrote: Something like this: with recursive foo (id, parent, children_ids) as ( select id, parent, null::text from tree t where not exists ( select 1 from tree c where

Re: Recursive Parent-Child Function Bottom Up

2021-07-26 Thread Alban Hertroys
> On 26 Jul 2021, at 17:52, Alban Hertroys wrote: > Something like this: > > with recursive foo (id, parent, children_ids) as ( > select id, parent, null::text > from tree t >where not exists ( > select 1 from tree c where c.parent = t.id >) >

Re: Recursive Parent-Child Function Bottom Up

2021-07-26 Thread Alban Hertroys
> On 26 Jul 2021, at 17:19, Avi Weinberg wrote: > > Hi, > > I would like to populate the children_ids column with all the ids of the > children recursively (+ grandchildren etc.) > If I do it top-bottom I will end up doing extra work since there is no need > to go all levels down if I can

Re: Recursive Parent-Child Function Bottom Up

2021-07-26 Thread Rob Sargent
On 7/26/21 9:19 AM, Avi Weinberg wrote: Hi, I would like to populate the children_ids column with all the ids of the children recursively (+ grandchildren etc.) If I do it top-bottom I will end up doing extra work since there is no need to go all levels down if I can just compute my

Re: Recursive Parent-Child Function Bottom Up

2021-07-26 Thread Rob Sargent
On 7/26/21 9:19 AM, Avi Weinberg wrote: Hi, I would like to populate the children_ids column with all the ids of the children recursively (+ grandchildren etc.) If I do it top-bottom I will end up doing extra work since there is no need to go all levels down if I can just compute my

Re: Why does VACUUM FULL pg_class sometimes wait for ShareLock on another transaction after getting AccessExclusiveLock on pg_class?

2021-07-26 Thread Marcin Barczynski
On Fri, Jul 23, 2021 at 4:46 PM Ninad Shah wrote: > Question 1 : What's a need to perform a VACUUM FULL operation on pg_class? > Workload requires many temp tables which cause huge bloat on pg_class - it sometimes has more than 2 GB. > Question 2 : Ideally, a VACUUM FULL operation seeks an

Recursive Parent-Child Function Bottom Up

2021-07-26 Thread Avi Weinberg
Hi, I would like to populate the children_ids column with all the ids of the children recursively (+ grandchildren etc.) If I do it top-bottom I will end up doing extra work since there is no need to go all levels down if I can just compute my IMMEDIATE children "children_ids" and just

Re: PostgreSQL reference coffee mug

2021-07-26 Thread Pavel Stehule
po 26. 7. 2021 v 13:44 odesílatel Rob Sargent napsal: > > > On Jul 26, 2021, at 1:06 AM, Pavel Stehule > wrote: > >  > > Thanks in advance for any hints. >> > > I have this in czech language - maybe google translator > https://translate.google.com/ helps > >

Re: PostgreSQL reference coffee mug

2021-07-26 Thread Rob Sargent
> On Jul 26, 2021, at 1:06 AM, Pavel Stehule wrote: > >  > >> Thanks in advance for any hints. > > I have this in czech language - maybe google translator > https://translate.google.com/ helps > > https://postgres.cz/files/tahak_postgresql-13.pdf > > Regards > > Pavel >> >> I could

Re: Obsolete or dead serverconnections after reboot

2021-07-26 Thread WR
Hello Ninad Shah, Thank you for clarification. The state of the mentioned connections was "Idle" in pg_stat_activity. Now on my Laptops the shutdown of the postgres-service works too. I had to switch off the "Schnellstart" (in english something like "fast start" or "fast boot"), which can be

Re: PostgreSQL reference coffee mug

2021-07-26 Thread Pavel Stehule
po 26. 7. 2021 v 8:56 odesílatel Matthias Apitz napsal: > > Hello, > > Nearly 20 years ago, I ordered some 50 vi-reference coffee mugs like this > one here (not exactly the same, but to give you an idea): > > https://www.getdigital.eu/vi-reference-mug.html > > for our vi-lovers in-house and the

PostgreSQL reference coffee mug

2021-07-26 Thread Matthias Apitz
Hello, Nearly 20 years ago, I ordered some 50 vi-reference coffee mugs like this one here (not exactly the same, but to give you an idea): https://www.getdigital.eu/vi-reference-mug.html for our vi-lovers in-house and the admins of our customers. I'd like to do the same now with a reference