agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Andreas Kretschmer <akretschmer@spamfence.net>
To: pgsql-sql@postgresql.org
Subject: Re: Add new field with auto-icrement to existing table
Date: Tue, 6 Jan 2015 18:44:37 +0100
Message-ID: <20150106174437.GA24259@tux> (raw)
In-Reply-To: <CAOBG12nkWeiZwZFR+yG2bYjWC+HWnBoNidVHLEiY67KTek6W1g@mail.gmail.com>
References: <CAOBG12nkWeiZwZFR+yG2bYjWC+HWnBoNidVHLEiY67KTek6W1g@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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°


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



view thread (3+ messages)  latest in thread

Message-ID: <20150106174437.GA24259@tux>
Permalink:  ../20150106174437.GA24259@tux/
Also on:    postgresql.org/message-id/20150106174437.GA24259@tux

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: akretschmer@spamfence.net
  Subject: Re: Add new field with auto-icrement to existing table
  In-Reply-To: <20150106174437.GA24259@tux>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox