updating a sequence

From: John Fabiani <johnf(at)jfcomputer(dot)com>
To: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: updating a sequence
Date: 2011-11-15 16:06:30
Message-ID: 201111150806.30911.johnf@jfcomputer.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,
I have need of a statement that updates the sequence but uses a max() to find
the number.

alter sequence somename restart with (select max(pk) from sometable).

I need this for automating an ETL (using pentaho).

Postgres 8.4

Thanks in advance,
Johnf

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Broersma 2011-11-15 16:33:54 Re: updating a sequence
Previous Message Brice André 2011-11-15 13:36:34 pg_dump : problem with grant on table columns