Re: Add new field with auto-icrement to existing table

From: Brice André <brice(at)famille-andre(dot)be>
To: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Add new field with auto-icrement to existing table
Date: 2015-01-06 20:26:12
Message-ID: CAOBG12nyMVb9rMMyiO+gUjkgLXSUY-7tMXsb2ZNpxQRSOqU3Dw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Exactly what I needed.

Thanks,
Brice

2015-01-06 18:44 GMT+01:00 Andreas Kretschmer <akretschmer(at)spamfence(dot)net>:

> Brice André <brice(at)famille-andre(dot)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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message sqlnewbie2015 2015-01-07 00:05:52 Count values that match elements in csv string
Previous Message Andreas Kretschmer 2015-01-06 17:44:37 Re: Add new field with auto-icrement to existing table