Re: Add new field with auto-icrement to existing table - Mailing list pgsql-sql

From Andreas Kretschmer
Subject Re: Add new field with auto-icrement to existing table
Date
Msg-id 20150106174437.GA24259@tux
Whole thread Raw
In response to Add new field with auto-icrement to existing table  (Brice André <brice@famille-andre.be>)
Responses Re: Add new field with auto-icrement to existing table
List pgsql-sql
Brice André <brice@famille-andre.be> wrote:

> But now, I would want to develop a server-based application. And this
> application would need a single column unique ID for referencing tables
> entries. My current primary key does not fit my needs as it is based on two
> columns. So, I would want to add a new field on all derived tables. And, as I
> don't want to change the synchronisation stuff, the values of this new field
> should be assigned automatically.

Create a new Sequence. I think, that should fit your requirement.

Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°



pgsql-sql by date:

Previous
From: Brice André
Date:
Subject: Add new field with auto-icrement to existing table
Next
From: Brice André
Date:
Subject: Re: Add new field with auto-icrement to existing table