manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [CONF] Apache Connectors Framework > How to Write an Output Connector
Date Wed, 20 Oct 2010 16:51:00 GMT
Space: Apache Connectors Framework (
Page: How to Write an Output Connector (

Comment added by Farzad:

Having the index would not allow me to use the insert operation to detect the dups.  The algorithm
is using two columns one for the hashsum, and another for the dup number, where it is incremented
with each duplicate.  The algorithm would:

1) attempt an insert with hashsum X and dupnum = 1
2) if I get 23505 SQL exception, then I'll find the largest dup number, and try another insert
with one plus the largest.

What do you think of this?  Noticed there is a method already called performAlter, however
it only operates on columns, add, delete, etc.  What do you think if I added another method
to allow adding primary key constraints, allow to perform this alter "ALTER TABLE mytable
ADD CONSTRAINT _pk PRIMARY KEY (col1, col2, ...).

In reply to a comment by Karl Wright:
The ManifoldCF database abstraction is, of course, a limited one.  You can't do everything
that you can do in every kind of database there is out there.  However, you \*can\*
effectively define the equivalent of a multiple primary key relationship simply by doing the

(1) create your columns, labeling NONE of them as "primary key".

(2) create a unique index on the columns you want to be your multiple primary key.\\

In PostgreSQL this does the same thing as a multiple primary key.\\

Change your notification preferences:

View raw message