Обсуждение: Proposed dbmirror change

Поиск
Список
Период
Сортировка

Proposed dbmirror change

От
Achilleus Mantzios
Дата:
hi again

i made one mod to dbmirror.

1) I implemented a mechanism to exclude attributes (columns) from
dbmirror'ed tables.

I added one table

CREATE TABLE dbmirror_exclude_attributes (
    tblname character varying(100) NOT NULL,
    attnames text[] NOT NULL
);

ALTER TABLE ONLY dbmirror_exclude_attributes
    ADD CONSTRAINT dbmirror_exclude_attributes_pkey PRIMARY KEY (tblname);

and one function

bool isExcluded(char *cpTableName,TupleDesc tTupleDesc, int iColumnCounter);

which is called in packageData, and examines to see if this
column should be excluded.
The contents of dbmirror_exclude_attributes are like:
dynacom=# SELECT * from dbmirror_exclude_attributes;
         tblname          |         attnames
 --------------------------+---------------------------
 "public"."mariner"       | {parentid,relationtypeid}
 "public"."marinerpapers" | {mpaid}
 (2 rows)

dynacom=#

One use of it would be the selective mirroring of only a subset of
all of one table's columns, excluding e.g. huge bytea columns,
where the communication link is for instance ultra expensive and
unreliable SAT connection.

Another use case would be the exclusion of sensitive information
like credit card numbers or medical data.

What do you all think?

-Achilleus