Chris Jones <[EMAIL PROTECTED]> writes:

> I don't think that solves my problem.  Sure, it guarantees that the IDs are
> unique, but not the strings.  
>
> My whole goal is to be able to create a unique identifier for each string,
> in such a way that I dont have the same string listed twice, with different
> identifiers.

I don't think that your original solution solves that problem either.  You
first posted this schema:

> My schema looks as follows:
> 
> CREATE TABLE rawfen ( fen VARCHAR(80) );
> CREATE INDEX rawfen_idx_fen ON rawfen(fen);

but you didn't indicate that rawfen_idx_fen is a UNIQUE INDEX so it won't
complain if there are duplicate strings.  To accomplish this (but not solving
your timing issue), you need this:

  CREATE TABLE rawfen ( fen VARCHAR(80) );
  CREATE UNIQUE INDEX rawfen_idx_fen ON rawfen(fen);

or, more concisely,

  CREATE TABLE rawfen ( fen VARCHAR(80) UNIQUE);

As previously stated, you can guarantee a unique id for each string with

  CREATE TABLE rawfen (id INTEGER PRIMARY KEY, fen VARCHAR(80) UNIQUE);

Cheers,

Derrell

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to