Re: updating a sequence

From: John Fabiani <johnf(at)jfcomputer(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Cc: Richard Broersma <richard(dot)broersma(at)gmail(dot)com>
Subject: Re: updating a sequence
Date: 2011-11-16 00:28:23
Message-ID: 201111151628.23731.johnf@jfcomputer.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tuesday, November 15, 2011 08:33:54 am Richard Broersma wrote:
> On Tue, Nov 15, 2011 at 8:06 AM, John Fabiani <johnf(at)jfcomputer(dot)com> wrote:
> > alter sequence somename restart with (select max(pk) from sometable).
> >
> > I need this for automating an ETL (using pentaho).
>
> http://www.postgresql.org/docs/9.1/interactive/functions-sequence.html#FUNC
> TIONS-SEQUENCE-TABLE

I don't see how that helps answer my problem. I know how to update a
sequence. I want to pass a value for the restart vaue that depends on a query
- all in one statement. I would think it is a common problem i.e. migrating
data.

Thanks,
Johnf

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Samuel Gendler 2011-11-16 00:33:53 Re: updating a sequence
Previous Message Craig Ringer 2011-11-15 23:27:29 Re: pg_dump : problem with grant on table columns