I've been designing a db where I've encountered a similar issue.
My current thinking is that I can use Postgres' inheritance to solve the
issue.
CREATE TABLE object (
tuple_id SERIAL PRIMARY KEY
);
CREATE TABLE t1 (
some_field text
) INHERITS (object);
Any tuple which inherits from object will need to abide by the
UNIQUE constraint of the object table.
John
Ana Roizen wrote:
> The motivation of this question is the following:
>
> It began by wanting to drop a column from a table. As i understood
> there is no DROP COLUMN option in Postrgres. So someone suggested me to
> make a SELECT INTO a new table , including the columns I didn't want to
> drop. But doing this would generate new oids for the tuples in my old
> table. So any table containing foreign references to tuples of my table
> would be lost.
> Am I correct?
>
> What to use instead of postgres'oid to identify tuples?
> I rather not use primary keys as in standard relational model.
> I thought of creating my own column "identifier of tuple" in each
> table, forcing the values to be unique.
> What do you think of this ? Any suggestion on how to implement it ? Any
> suggestion for another way of identifying?
>
> I would appreciate all the help you could give.
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com