pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pglogical in postgres 9.6
10+ messages / 3 participants
[nested] [flat]

* pglogical in postgres 9.6
@ 2018-02-12 22:11 greigwise <greigwise@comcast.net>
  2018-02-12 23:19 ` Re: pglogical in postgres 9.6 Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 10+ messages in thread

From: greigwise @ 2018-02-12 22:11 UTC (permalink / raw)
  To: pgsql-general

Hello.  I'm trying to get pglogical setup between 2 postgres 9.6 instances. 
I can get everything replicating over fine, my problem is that I can't seem
to get it to work in the mode where it does not try to copy all the data
over initially.  On the source side, I'm doing this:

  psql -U hireology -d $SRCDB -c "SELECT pglogical.create_node( node_name :=
'${SRCNODE}', dsn := 'host=localhost port=${SRCPORT} dbname=${SRCDB}
user=logical_replication')"
  
  psql -U hireology -d $SRCDB -c "select
pglogical.create_replication_set('dw_repl', true, true, true, true)"
  
  psql -U hireology -d $SRCDB -c "select pglogical.replication_set_add_table
('dw_repl', 'accounts', false)"
  psql -U hireology -d $SRCDB -c "select pglogical.replication_set_add_table
('dw_repl', 'organizations', false)"
  psql -U hireology -d $SRCDB -c "select
pglogical.replication_set_add_sequence ('dw_repl', 'accounts_id_seq',
false)"
  psql -U hireology -d $SRCDB -c "select
pglogical.replication_set_add_sequence ('dw_repl', 'organizations_id_seq',
false)"

Note on the replication_set_add_table command, I'm sending false as the
third parameter which should tell it to not copy over the initial data.  But
when I create the subscription on the target side, I can see in the logs
where it is issuing the copy command.  And since I have the data already
there, I get duplicate key errors and it bombs out.  Any suggestions?

Thanks,
Greig Wise




--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html




^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: pglogical in postgres 9.6
  2018-02-12 22:11 pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
@ 2018-02-12 23:19 ` Adrian Klaver <adrian.klaver@aklaver.com>
  2018-02-13 00:44   ` Re: pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
  2018-02-13 00:46   ` Re: pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
  0 siblings, 2 replies; 10+ messages in thread

From: Adrian Klaver @ 2018-02-12 23:19 UTC (permalink / raw)
  To: greigwise <greigwise@comcast.net>; pgsql-general

On 02/12/2018 02:11 PM, greigwise wrote:
> Hello.  I'm trying to get pglogical setup between 2 postgres 9.6 instances.
> I can get everything replicating over fine, my problem is that I can't seem
> to get it to work in the mode where it does not try to copy all the data
> over initially.  On the source side, I'm doing this:
> 
>    psql -U hireology -d $SRCDB -c "SELECT pglogical.create_node( node_name :=
> '${SRCNODE}', dsn := 'host=localhost port=${SRCPORT} dbname=${SRCDB}
> user=logical_replication')"
>    
>    psql -U hireology -d $SRCDB -c "select
> pglogical.create_replication_set('dw_repl', true, true, true, true)"
>    
>    psql -U hireology -d $SRCDB -c "select pglogical.replication_set_add_table
> ('dw_repl', 'accounts', false)"
>    psql -U hireology -d $SRCDB -c "select pglogical.replication_set_add_table
> ('dw_repl', 'organizations', false)"
>    psql -U hireology -d $SRCDB -c "select
> pglogical.replication_set_add_sequence ('dw_repl', 'accounts_id_seq',
> false)"
>    psql -U hireology -d $SRCDB -c "select
> pglogical.replication_set_add_sequence ('dw_repl', 'organizations_id_seq',
> false)"
> 
> Note on the replication_set_add_table command, I'm sending false as the
> third parameter which should tell it to not copy over the initial data.  But
> when I create the subscription on the target side, I can see in the logs
> where it is issuing the copy command.  And since I have the data already
> there, I get duplicate key errors and it bombs out.  Any suggestions?

I don't know what is going on, but for those that might the pglogical 
version you are using might be helpful.

> 
> Thanks,
> Greig Wise
> 
> 
> 
> 
> --
> Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: pglogical in postgres 9.6
  2018-02-12 22:11 pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
  2018-02-12 23:19 ` Re: pglogical in postgres 9.6 Adrian Klaver <adrian.klaver@aklaver.com>
@ 2018-02-13 00:44   ` greigwise <greigwise@comcast.net>
  1 sibling, 0 replies; 10+ messages in thread

From: greigwise @ 2018-02-13 00:44 UTC (permalink / raw)
  To: pgsql-general

I downloaded it from git and compiled from source just today.

Looks like it's 2.0.0 based on the pglogical.control file that was in the
source.  I'm not sure how else I'd know.

Greig



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html




^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: pglogical in postgres 9.6
  2018-02-12 22:11 pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
  2018-02-12 23:19 ` Re: pglogical in postgres 9.6 Adrian Klaver <adrian.klaver@aklaver.com>
@ 2018-02-13 00:46   ` greigwise <greigwise@comcast.net>
  2018-02-13 00:53     ` Re: pglogical in postgres 9.6 Adrian Klaver <adrian.klaver@aklaver.com>
  2018-02-13 00:56     ` Re: pglogical in postgres 9.6 Adrian Klaver <adrian.klaver@aklaver.com>
  1 sibling, 2 replies; 10+ messages in thread

From: greigwise @ 2018-02-13 00:46 UTC (permalink / raw)
  To: pgsql-general

I downloaded from git and compiled from source.  Based on the
pglogical.control file, it appears to be 2.0.0.  Is there a better way to
determine the version?

Thanks,
Greig



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html




^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: pglogical in postgres 9.6
  2018-02-12 22:11 pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
  2018-02-12 23:19 ` Re: pglogical in postgres 9.6 Adrian Klaver <adrian.klaver@aklaver.com>
  2018-02-13 00:46   ` Re: pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
@ 2018-02-13 00:53     ` Adrian Klaver <adrian.klaver@aklaver.com>
  1 sibling, 0 replies; 10+ messages in thread

From: Adrian Klaver @ 2018-02-13 00:53 UTC (permalink / raw)
  To: greigwise <greigwise@comcast.net>; pgsql-general

On 02/12/2018 04:46 PM, greigwise wrote:
> I downloaded from git and compiled from source.  Based on the
> pglogical.control file, it appears to be 2.0.0.  Is there a better way to
> determine the version?

In psql do:

\dx

> 
> Thanks,
> Greig
> 
> 
> 
> --
> Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: pglogical in postgres 9.6
  2018-02-12 22:11 pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
  2018-02-12 23:19 ` Re: pglogical in postgres 9.6 Adrian Klaver <adrian.klaver@aklaver.com>
  2018-02-13 00:46   ` Re: pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
@ 2018-02-13 00:56     ` Adrian Klaver <adrian.klaver@aklaver.com>
  2018-02-13 02:09       ` Re: pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
  1 sibling, 1 reply; 10+ messages in thread

From: Adrian Klaver @ 2018-02-13 00:56 UTC (permalink / raw)
  To: greigwise <greigwise@comcast.net>; pgsql-general

On 02/12/2018 04:46 PM, greigwise wrote:
> I downloaded from git and compiled from source.  Based on the
> pglogical.control file, it appears to be 2.0.0.  Is there a better way to
> determine the version?

Should have added that you need run the \dx in the database you 
installed pglogical into.

> 
> Thanks,
> Greig
> 
> 
> 
> --
> Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: pglogical in postgres 9.6
  2018-02-12 22:11 pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
  2018-02-12 23:19 ` Re: pglogical in postgres 9.6 Adrian Klaver <adrian.klaver@aklaver.com>
  2018-02-13 00:46   ` Re: pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
  2018-02-13 00:56     ` Re: pglogical in postgres 9.6 Adrian Klaver <adrian.klaver@aklaver.com>
@ 2018-02-13 02:09       ` greigwise <greigwise@comcast.net>
  2018-02-13 19:13         ` Re: pglogical in postgres 9.6 Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 10+ messages in thread

From: greigwise @ 2018-02-13 02:09 UTC (permalink / raw)
  To: pgsql-general

hireology_tmp=# \dx
                                            List of installed extensions
       Name       | Version |      Schema      |                           
Description
------------------+---------+------------------+--------------------------------------------------------------------
 pglogical        | 2.0.0   | pglogical        | PostgreSQL Logical
Replication
 pglogical_origin | 1.0.0   | pglogical_origin | Dummy extension for
compatibility when upgrading from Postgres 9.4



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html




^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: pglogical in postgres 9.6
  2018-02-12 22:11 pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
  2018-02-12 23:19 ` Re: pglogical in postgres 9.6 Adrian Klaver <adrian.klaver@aklaver.com>
  2018-02-13 00:46   ` Re: pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
  2018-02-13 00:56     ` Re: pglogical in postgres 9.6 Adrian Klaver <adrian.klaver@aklaver.com>
  2018-02-13 02:09       ` Re: pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
@ 2018-02-13 19:13         ` Adrian Klaver <adrian.klaver@aklaver.com>
  2018-02-13 19:46           ` Re: pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
  0 siblings, 1 reply; 10+ messages in thread

From: Adrian Klaver @ 2018-02-13 19:13 UTC (permalink / raw)
  To: greigwise <greigwise@comcast.net>; pgsql-general

On 02/12/2018 06:09 PM, greigwise wrote:
> hireology_tmp=# \dx
>                                              List of installed extensions
>         Name       | Version |      Schema      |
> Description
> ------------------+---------+------------------+--------------------------------------------------------------------
>   pglogical        | 2.0.0   | pglogical        | PostgreSQL Logical
> Replication
>   pglogical_origin | 1.0.0   | pglogical_origin | Dummy extension for
> compatibility when upgrading from Postgres 9.4

To get an answer you might to file an issue here:

https://github.com/2ndQuadrant/pglogical/issues

> 
> 
> 
> --
> Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: pglogical in postgres 9.6
  2018-02-12 22:11 pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
  2018-02-12 23:19 ` Re: pglogical in postgres 9.6 Adrian Klaver <adrian.klaver@aklaver.com>
  2018-02-13 00:46   ` Re: pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
  2018-02-13 00:56     ` Re: pglogical in postgres 9.6 Adrian Klaver <adrian.klaver@aklaver.com>
  2018-02-13 02:09       ` Re: pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
  2018-02-13 19:13         ` Re: pglogical in postgres 9.6 Adrian Klaver <adrian.klaver@aklaver.com>
@ 2018-02-13 19:46           ` greigwise <greigwise@comcast.net>
  2018-02-14 05:41             ` Re: pglogical in postgres 9.6 Jeremy Finzel <finzelj@gmail.com>
  0 siblings, 1 reply; 10+ messages in thread

From: greigwise @ 2018-02-13 19:46 UTC (permalink / raw)
  To: pgsql-general

No need!  I figured it out.

Had to put this "synchronize_data := false" on the create_subscription call. 
Weird that there seem to be redundant parameters for this; one on the
replication set add and one on the create subscription.  Maybe I'm not quite
understanding the usage on those or something.   If anyone knows the
difference, I'd be interested to hear.

Greig



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html




^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: pglogical in postgres 9.6
  2018-02-12 22:11 pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
  2018-02-12 23:19 ` Re: pglogical in postgres 9.6 Adrian Klaver <adrian.klaver@aklaver.com>
  2018-02-13 00:46   ` Re: pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
  2018-02-13 00:56     ` Re: pglogical in postgres 9.6 Adrian Klaver <adrian.klaver@aklaver.com>
  2018-02-13 02:09       ` Re: pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
  2018-02-13 19:13         ` Re: pglogical in postgres 9.6 Adrian Klaver <adrian.klaver@aklaver.com>
  2018-02-13 19:46           ` Re: pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
@ 2018-02-14 05:41             ` Jeremy Finzel <finzelj@gmail.com>
  0 siblings, 0 replies; 10+ messages in thread

From: Jeremy Finzel @ 2018-02-14 05:41 UTC (permalink / raw)
  To: greigwise <greigwise@comcast.net>; +Cc: pgsql-general

On Tue, Feb 13, 2018 at 1:46 PM greigwise <greigwise@comcast.net> wrote:

> No need!  I figured it out.
>
> Had to put this "synchronize_data := false" on the create_subscription
> call.
> Weird that there seem to be redundant parameters for this; one on the
> replication set add and one on the create subscription.  Maybe I'm not
> quite
> understanding the usage on those or something.   If anyone knows the
> difference, I'd be interested to hear.
>
> Greig
>
>
>
> --
> Sent from:
> http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
>
> Yes. When you add a subscription with sync = true, then all tables in the
replication set(s) will be synced. But suppose you want to add a table
later to the replication set. Sync = true will sync only that one table. So
the latter is more granular.

Jeremy

^ permalink  raw  reply  [nested|flat] 10+ messages in thread


end of thread, other threads:[~2018-02-14 05:41 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-02-12 22:11 pglogical in postgres 9.6 greigwise <greigwise@comcast.net>
2018-02-12 23:19 ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-02-13 00:44   ` greigwise <greigwise@comcast.net>
2018-02-13 00:46   ` greigwise <greigwise@comcast.net>
2018-02-13 00:53     ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-02-13 00:56     ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-02-13 02:09       ` greigwise <greigwise@comcast.net>
2018-02-13 19:13         ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-02-13 19:46           ` greigwise <greigwise@comcast.net>
2018-02-14 05:41             ` Jeremy Finzel <finzelj@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox