Обсуждение: rserv
Hi: I'm using rserv (from contrib) to replicate one DB to another. Works fine for all the easy tables, i.e. those that have a one column primary key. However, I'm also trying to replicate a couple of man-in-the-middle for many-to-many relatinships tables, so they don't have any unique fields. In the rserv documentation it says that you have to specify a column "that is updated" for each table, but is not clear to me which one to specify for that kind of tables. I'm currently creating a new field of type bigint, where I store a combination of the primary key, that I can assure will be unique -- until I get lots of entries in the main tables, that is. What is the "right" approach for this? -- Alvaro Herrera (<alvherre[@]atentus.com>)
> I'm currently creating a new field of type bigint, where I store a > combination of the primary key, that I can assure will be unique -- > until I get lots of entries in the main tables, that is. > > What is the "right" approach for this? "Right" way would be implement support for multi-column keys in Rserv, so even for tables without natural PK one could add OID to some existent key to get uniq identifier for all rows in tables. No one had that ability so far. You can use OID as key for Rserv. Unfortunately, you probably will have to create index on table.oid for better replication performance, but most likely that index will be useful for replication only, not for queries. Vadim
On 08 May 2001 11:11:52 -0700, Mikheev, Vadim wrote: > > I'm currently creating a new field of type bigint, where I store a > > combination of the primary key, that I can assure will be unique -- > > until I get lots of entries in the main tables, that is. > > > > What is the "right" approach for this? > > "Right" way would be implement support for multi-column keys in Rserv, > so even for tables without natural PK one could add OID to some existent > key to get uniq identifier for all rows in tables. No one had that > ability so far. > You can use OID as key for Rserv. Unfortunately, you probably will have > to create index on table.oid for better replication performance, but > most likely that index will be useful for replication only, not for > queries. Ok, this works just fine. I'm able to replicate the table. Thanks for the help. rserv has proven an excellent tool, at least for me. BTW, I'm still trying to work out how can I replicate via a secure channel using OpenSSH. I had to add a "port" parameter to most, if not all, the programs so I could use a manually created tunnel; however, I'm still unable to figure out how to do it automatically (the "script" way). The -R and -L parameters to ssh(1), next to an appropiate way for calling the Replicate program should do it, but I can't find the right combination. Does the "hostssl" entry en pg_hba.conf helps me? I need to automate this... TIA. -- Alvaro Herrera (<alvherre[@]atentus.com>)
On 08 May 2001 18:47:09 -0400, Alvaro Herrera wrote: > > BTW, I'm still trying to work out how can I replicate via a secure channel > using OpenSSH. I had to add a "port" parameter to most, if not all, the > programs so I could use a manually created tunnel; however, I'm still unable > to figure out how to do it automatically (the "script" way). The -R and > -L parameters to ssh(1), next to an appropiate way for calling the Replicate > program should do it, but I can't find the right combination. Sorry for answering my own question, but the solution is using ssh -L -2 -N with OpenSSH, then using Replicate over the locally created socket. Sometimes I just go blind for the easy solutions. -- Alvaro Herrera (<alvherre[@]atentus.com>)