pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Postgresql 8.4 replication using Londiste
4+ messages / 3 participants
[nested] [flat]

* Postgresql 8.4 replication using Londiste
@ 2011-06-08 19:39  Maria L. Wilson <Maria.L.Wilson-1@nasa.gov>
  0 siblings, 2 replies; 4+ messages in thread

From: Maria L. Wilson @ 2011-06-08 19:39 UTC (permalink / raw)
  To: pgsql-admin

Interested in using Londiste to set up replication of only one column in 
a particular database to another database on a remote Postgres server.  
I've installed and configured londiste on the servers - that was no 
problem.  I just don't see anything in the docs that specify how to 
replicate only one column - not the entire table.  Anybody out there 
have any expertise in this that can point me in the right direction?

thanks!
Maria Wilson
NASA/Langley Research Center
Hampton, Virginia 23666



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

* Re: Postgresql 8.4 replication using Londiste
@ 2011-06-08 20:28  Craig James <craig_james@emolecules.com>
  parent: Maria L. Wilson <Maria.L.Wilson-1@nasa.gov>
  1 sibling, 1 reply; 4+ messages in thread

From: Craig James @ 2011-06-08 20:28 UTC (permalink / raw)
  To: pgsql-admin

On 6/8/11 12:39 PM, Maria L. Wilson wrote:
> Interested in using Londiste to set up replication of only one column in a particular database to another database on a remote Postgres server.  I've installed and configured londiste on the servers - that was no problem.  I just don't see anything in the docs that specify how to replicate only one column - not the entire table.  Anybody out there have any expertise in this that can point me in the right direction?
Londiste is a table-level replicator.

You might be able to create one table with the column you want replicated (plus a primary key), another table with the rest of the columns, and a view to give your app the original view.  Even so, you have to replicate the one column plus the PK, unless the data you're replicating is unique and can be its own PK.

On the other hand, I've noticed that Londiste doesn't know when you change a table.  You might be able to create your one-column table (plus PK), start replication with Londiste, then do ALTER TABLE to add the rest of the columns.  A hack for sure.

Craig



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

* Re: Postgresql 8.4 replication using Londiste
@ 2011-08-15 22:29  Dimitri Fontaine <dimitri@2ndQuadrant.fr>
  parent: Maria L. Wilson <Maria.L.Wilson-1@nasa.gov>
  1 sibling, 0 replies; 4+ messages in thread

From: Dimitri Fontaine @ 2011-08-15 22:29 UTC (permalink / raw)
  To: Maria.L.Wilson-1@nasa.gov; +Cc: pgsql-admin

"Maria L. Wilson" <Maria.L.Wilson-1@nasa.gov> writes:
> Interested in using Londiste to set up replication of only one column in a
> particular database to another database on a remote Postgres server.  I've
> installed and configured londiste on the servers - that was no problem.  I
> just don't see anything in the docs that specify how to replicate only one
> column - not the entire table.  Anybody out there have any expertise in this
> that can point me in the right direction?

That's supported in skytools3, currently in release candidate status.

Those are the arguments you can give to the add table command:

  londiste <ini> provider add table --trigger-arg ...

-- Optinal arguments:
--      SKIP                - The actual operation should be skipped (BEFORE trigger)
--      ignore=col1[,col2]  - don't look at the specified arguments
--      pkey=col1[,col2]    - Set pkey fields for the table, autodetection will be skipped
--      backup              - Put urlencoded contents of old row to ev_extra2
--      colname=EXPR        - Override field value with SQL expression.  Can reference table
--                            columns.  colname can be: ev_type, ev_data, ev_extra1 .. ev_extra4
--      when=EXPR           - If EXPR returns false, don't insert event.

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support



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

* Re: Postgresql 8.4 replication using Londiste
@ 2011-08-15 22:50  Dimitri Fontaine <dimitri@2ndQuadrant.fr>
  parent: Craig James <craig_james@emolecules.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Dimitri Fontaine @ 2011-08-15 22:50 UTC (permalink / raw)
  To: Craig James <craig_james@emolecules.com>; +Cc: pgsql-admin

Craig James <craig_james@emolecules.com> writes:
> On the other hand, I've noticed that Londiste doesn't know when you change a
> table.  You might be able to create your one-column table (plus PK), start
> replication with Londiste, then do ALTER TABLE to add the rest of the
> columns.  A hack for sure.

And it stopped working somewhere in the 2.1 branch, I would guess by
2.1.9 from memory.  Now the trigger notices when you ALTER TABLE and
will queue events with the new columns by itself.  Well, that might also
depend on which trigger you use, but the default one is now smart
enough.

Skytools3 ahead! :)

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support



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


end of thread, other threads:[~2011-08-15 22:50 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-06-08 19:39 Postgresql 8.4 replication using Londiste Maria L. Wilson <Maria.L.Wilson-1@nasa.gov>
2011-06-08 20:28 ` Craig James <craig_james@emolecules.com>
2011-08-15 22:50   ` Dimitri Fontaine <dimitri@2ndQuadrant.fr>
2011-08-15 22:29 ` Dimitri Fontaine <dimitri@2ndQuadrant.fr>

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