incubator-connectors-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 Thu, 21 Oct 2010 06:14:00 GMT
Space: Apache Connectors Framework (
Page: How to Write an Output Connector (

Comment added by Karl Wright:

Like I said before, creating a unique index creates exactly the same Postgresql constraints
as having multiple primary keys.  The same (or a very similar) SQL error is returned when
the constraint is violated.

In reply to a comment 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, ...).

Change your notification preferences:

View raw message