Re: Database size different on Primary and Standby?

2023-01-18 Thread Ron
On 1/18/23 17:09, Hilbert, Karin wrote: I manage some PostgreSQL clusters on Linux.  We have a Primary & two Standby servers & for Production, there is also a DR server.  We use repmgr for our HA solution & the Standbys are cloned from the Primary using the *repmgr standby clone* command. My

Re: Database size different on Primary and Standby?

2023-01-18 Thread Tom Lane
Erik Wienhold writes: > On 19/01/2023 01:23 CET Ian Lawrence Barwick wrote: >> This is incorrect; with streaming replication all changes applied on the >> primary >> are applied on the standby. > Thanks. I was thinking about logical replication. It's not entirely clear whether the OP is

Re: Database size different on Primary and Standby?

2023-01-18 Thread Erik Wienhold
> On 19/01/2023 01:23 CET Ian Lawrence Barwick wrote: > > 2023年1月19日(木) 8:50 Erik Wienhold : > > > > > On 19/01/2023 00:09 CET Hilbert, Karin wrote: > > > > > > I manage some PostgreSQL clusters on Linux. We have a Primary & two > > > Standby > > > servers & for Production, there is also a DR

Re: Database size different on Primary and Standby?

2023-01-18 Thread Ian Lawrence Barwick
2023年1月19日(木) 8:50 Erik Wienhold : > > > On 19/01/2023 00:09 CET Hilbert, Karin wrote: > > > > I manage some PostgreSQL clusters on Linux. We have a Primary & two Standby > > servers & for Production, there is also a DR server. We use repmgr for our > > HA > > solution & the Standbys are cloned

Re: Database size different on Primary and Standby?

2023-01-18 Thread Erik Wienhold
> On 19/01/2023 00:09 CET Hilbert, Karin wrote: > > I manage some PostgreSQL clusters on Linux. We have a Primary & two Standby > servers & for Production, there is also a DR server. We use repmgr for our HA > solution & the Standbys are cloned from the Primary using the repmgr standby > clone

Database size different on Primary and Standby?

2023-01-18 Thread Hilbert, Karin
I manage some PostgreSQL clusters on Linux. We have a Primary & two Standby servers & for Production, there is also a DR server. We use repmgr for our HA solution & the Standbys are cloned from the Primary using the repmgr standby clone command. My manager asked for a report of all the user

Re: Tools for moving normalized data around

2023-01-18 Thread Rob Sargent
On 1/18/23 13:15, Gavan Schneider wrote: On 19 Jan 2023, at 6:47, Peter wrote: Now I want to grab some part of the data, on a certain condition (let's say all records belonging to user 'Bob', if there is a "user" table somewhere at the tree-bottom), and move it to another database with the

Re: Tools for moving normalized data around

2023-01-18 Thread Gavan Schneider
On 19 Jan 2023, at 6:47, Peter wrote: > Now I want to grab some part of the data, on a certain condition > (let's say all records belonging to user 'Bob', if there is a "user" > table somewhere at the tree-bottom), and move it to another database > with the very same layout - which is already

Re: Tools for moving normalized data around

2023-01-18 Thread Dominique Devienne
On Wed, Jan 18, 2023 at 9:03 PM Jeremy Smith wrote: >> How to do this with two tables connected via one foreign key, that is >> explained a dozen times in Stackoverflow. But what if the tree is 50 >> tables and 120 foreign key columns? >> It can be done. But probably not manually. >> >> So, as

Re: Tools for moving normalized data around

2023-01-18 Thread Jeremy Smith
> > > How to do this with two tables connected via one foreign key, that is > explained a dozen times in Stackoverflow. But what if the tree is 50 > tables and 120 foreign key columns? > It can be done. But probably not manually. > > So, as this seems a very usual use-case for normalized data, is

Tools for moving normalized data around

2023-01-18 Thread Peter
Hi, imagine I have a database containing normalized data: a whole bunch of tables all related via foreign keys (i.e. the thing one should usually have ;) ). So there is a dependency graph: all records relate to others in some tree-like fashion (has-many, belongs-to, etc.) Now I want to grab

Re: Interpreting postgres execution plan along with AND/OR precedence

2023-01-18 Thread Erik Wienhold
> On 18/01/2023 18:03 CET Dirschel, Steve > wrote: > > The plan changes: > > Sort (cost=9382.94..9382.97 rows=12 width=169) > Sort Key: lmq1.priority DESC, lmq1.request_time > -> Bitmap Heap Scan on lm_queue lmq1 (cost=4572.59..9382.73 rows=12 width=169) > Recheck Cond: ((client_name)::text =

Re: Interpreting postgres execution plan along with AND/OR precedence

2023-01-18 Thread Erik Wienhold
> On 18/01/2023 18:56 CET Tom Lane wrote: > > "Dirschel, Steve" writes: > > Filter: ... (alternatives: SubPlan 1 or hashed SubPlan 2) ... > > SubPlan 1 > >-> Index Scan using ix_lm_cc on lm_queue lmq2 > > (cost=0.40..177.93 rows=1 width=0) > >

Re: Interpreting postgres execution plan along with AND/OR precedence

2023-01-18 Thread Tom Lane
"Dirschel, Steve" writes: > Filter: ... (alternatives: SubPlan 1 or hashed SubPlan 2) ... > SubPlan 1 >-> Index Scan using ix_lm_cc on lm_queue lmq2 (cost=0.40..177.93 > rows=1 width=0) > Index Cond: ((collection_name)::text = >

Re: Are ZFS snapshots unsafe when PGSQL is spreading through multiple zpools?

2023-01-18 Thread Ron
On 1/18/23 10:54, Rob Sargent wrote: On 1/18/23 09:38, HECTOR INGERTO wrote: I wanted to understand the underlying issue. I use ZFS snapshots instead of a “correct” backup because with only two machines it allows me to have backups in the main machine and in the secondary too that acts as

Interpreting postgres execution plan along with AND/OR precedence

2023-01-18 Thread Dirschel, Steve
Table definition: Table "load.lm_queue" Column | Type | Collation | Nullable | Default ++---+--+- guid

Re: Are ZFS snapshots unsafe when PGSQL is spreading through multiple zpools?

2023-01-18 Thread Rob Sargent
On 1/18/23 09:38, HECTOR INGERTO wrote: I wanted to understand the underlying issue. I use ZFS snapshots instead of a “correct” backup because with only two machines it allows me to have backups in the main machine and in the secondary too that acts as hotspare at the same time. To

RE: Are ZFS snapshots unsafe when PGSQL is spreading through multiple zpools?

2023-01-18 Thread HECTOR INGERTO
I wanted to understand the underlying issue. I use ZFS snapshots instead of a “correct” backup because with only two machines it allows me to have backups in the main machine and in the secondary too that acts as hotspare at the same time. To accomplish the same I would need 3 nodes. The main,

Re: Are ZFS snapshots unsafe when PGSQL is spreading through multiple zpools?

2023-01-18 Thread Laurenz Albe
On Tue, 2023-01-17 at 15:22 +, HECTOR INGERTO wrote: > > Another case: a transaction COMMITs, and a slightly later transaction reads > > the data > > and sets a hint bit.  If the snapshot of the file system with the data > > directory in it > > is slightly later than the snapshot of the file