Re: logical replication resiliency

2018-12-30 Thread Achilleas Mantzios
On 23/12/18 3:39 μ.μ., Istvan Soos wrote: I have a database with about 1 TB of data, mostly inserts, little updates and deletes, and I want to setup 2 logical replication for it. What should be my expectation with the replication? 1. What is the time-window that either of the nodes can be offlin

Re: ERROR: found multixact XX from before relminmxid YY

2018-12-30 Thread Andres Freund
Hi, On 2018-12-28 19:49:36 -0500, Tom Lane wrote: > Mark Fletcher writes: > > Starting yesterday morning, auto vacuuming of one of our postgresql 9.6.10 > > (CentOS 7) table's started failing: > > ERROR: found multixact 370350365 from before relminmxid 765860874 > > CONTEXT: automatic vacuum of

In which session context is a trigger run?

2018-12-30 Thread David G. Johnston
On Friday, December 28, 2018, Mitar wrote: > > On Fri, Dec 28, 2018 at 9:36 PM Adrian Klaver > wrote: > > When you create the temporary function it is 'pinned' to a particular > > session/pg_temp_nn. Running the trigger in another session 'pins' it to > > that session and it is not able to see th

Re: getting pg_basebackup to use remote destination

2018-12-30 Thread Chuck Martin
Maybe I need to rethink ths and take Jeff's advice. I executed this: pg_basebackup -h [main server's URL] -U postgres -P -v -X s -D /mnt/dbraid/data 8 hours ago, and it is now still at 1%. Should it be that slow? The database in question is about 750 GB, and both servers are on the same GB ethern

Re: jsonb : find row by array object attribute

2018-12-30 Thread Andrew Gierth
> "Andrew" == Andrew Gierth writes: > "Rory" == Rory Campbell-Lange writes: Rory> and data like this: Rory> j Rory> -- Rory> {"a": 1, "people": [{"id": 2002}, {"id": 2004}]} Rory> {"a": 3, "people": [{"id": 200

Re: jsonb : find row by array object attribute

2018-12-30 Thread Andrew Gierth
> "Rory" == Rory Campbell-Lange writes: Rory> and data like this: Rory> j Rory> -- Rory> {"a": 1, "people": [{"id": 2002}, {"id": 2004}]} Rory> {"a": 3, "people": [{"id": 20

Re: jsonb : find row by array object attribute

2018-12-30 Thread Tom Lane
Rory Campbell-Lange writes: > ... I can't work out how to return the whole row containing a desired > people id value. Something like this, maybe? =# select * from x where '2003'::jsonb in (select jsonb_array_elements(j #>'{people}')->'id'); j -

jsonb : find row by array object attribute

2018-12-30 Thread Rory Campbell-Lange
With a table like this: Table "public.x" Column | Type | Modifiers +---+--- j | jsonb | and data like this: j -- {"a": 1, "people": [{"

Re: getting pg_basebackup to use remote destination

2018-12-30 Thread Jeff Janes
On Sat, Dec 29, 2018 at 2:05 PM Chuck Martin wrote: > I thought I knew how to do this, but I apparently don't. I have to set up > a new server as a standby for a PG 11.1 server. The main server has a lot > more resources than the standby. What I want to do is run pg_basebackup on > the main serve

Re: getting pg_basebackup to use remote destination

2018-12-30 Thread Francisco Olarte
On Sun, Dec 30, 2018 at 5:52 PM Chuck Martin wrote: .. > I’ve started pg_basebackup from the standby. It failed once due to an ssh > error, but I reloaded sshd and started again. May take a while. It about > 750gb. IIRC pg_base backup uses the postgres connection, so I supose ssh failed on

Re: In which session context is a trigger run?

2018-12-30 Thread Adrian Klaver
On 12/30/18 3:08 AM, Peter J. Holzer wrote: On 2018-12-29 13:01:47 -0800, Adrian Klaver wrote: On 12/28/18 11:44 PM, Mitar wrote: On Fri, Dec 28, 2018 at 9:36 PM Adrian Klaver wrote: When you create the temporary function it is 'pinned' to a particular session/pg_temp_nn. Running the trigger

Re: getting pg_basebackup to use remote destination

2018-12-30 Thread Chuck Martin
On Sun, Dec 30, 2018 at 11:20 AM Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 29/12/2018 20:04, Chuck Martin wrote: > > I thought I knew how to do this, but I apparently don't. I have to set > > up a new server as a standby for a PG 11.1 server. The main server has a > > lot mo

Re: getting pg_basebackup to use remote destination

2018-12-30 Thread Peter Eisentraut
On 29/12/2018 20:04, Chuck Martin wrote: > I thought I knew how to do this, but I apparently don't. I have to set > up a new server as a standby for a PG 11.1 server. The main server has a > lot more resources than the standby. What I want to do is run > pg_basebackup on the main server with the ou

Re: Recursive CTE

2018-12-30 Thread Andy Colson
On 12/29/18 12:34 PM, Glenn Schultz wrote: All, Following my earlier post on variable instantiation, I rethought how I was working with dates and realized I can fix the date and use static interval.  I came up with this recursive CTE which is the end goal.  However, the problem is that the con

Re: In which session context is a trigger run?

2018-12-30 Thread Peter J. Holzer
On 2018-12-29 13:01:47 -0800, Adrian Klaver wrote: > On 12/28/18 11:44 PM, Mitar wrote: > > On Fri, Dec 28, 2018 at 9:36 PM Adrian Klaver > > wrote: > > > When you create the temporary function it is 'pinned' to a particular > > > session/pg_temp_nn. Running the trigger in another session 'pins'