incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Connectors Framework > How to Write an Output Connector
Date Thu, 21 Oct 2010 06:14:00 GMT
Space: Apache Connectors Framework (https://cwiki.apache.org/confluence/display/CONNECTORS)
Page: How to Write an Output Connector (https://cwiki.apache.org/confluence/display/CONNECTORS/How+to+Write+an+Output+Connector)
Comment: https://cwiki.apache.org/confluence/display/CONNECTORS/How+to+Write+an+Output+Connector?focusedCommentId=24183789#comment-24183789

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: https://cwiki.apache.org/confluence/users/viewnotifications.action

Mime
View raw message