"ownership" of sequences, pseudo random unique id

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: "ownership" of sequences, pseudo random unique id
Date: 2009-08-20 11:40:57
Message-ID: 20090820134057.2da3a692@dawn.webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I've

create table pr(
code varchar(16) primary key,
...
);
create sequence pr_code_seq owned by pr.code; -- uh!

pr.code will *mostly* be obtained as

to_hex(feistel_encrypt(nextval('pr_code')))
and sometimes 'manually' inserting unique codes.

actually stuff like:
alter table pr drop column code;
or just
drop table pr

seems to work as expected (they drop the sequence too).

Should I be concerned of anything since it looks like a hack?

--
Ivan Sergio Borgonovo
http://www.webthatworks.it

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-08-20 11:59:02 Re: ERROR: could not access file "$libdir/xxid": No such file or directory
Previous Message Harald Fuchs 2009-08-20 11:35:47 Re: unique index for periods