Re: table sequence, renumbering

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: "J(dot)V(dot)" <jvsrvcs(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: table sequence, renumbering
Date: 2011-10-04 16:03:28
Message-ID: 4E8B2E50.8000702@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/10/2011 16:51, J.V. wrote:
> What is the absolute fastest way to populate a primary key / id column
> from a named db sequence (disabled constraints and want to renumber the
> primary key / id column from sequence.
>
> cannot use auto inc or serial column because need to use generic
> hibernate mapping files for multiple DB's in the end, but want a stored
> proc to simple reorder a primary key int column pulling from a named
> sequence, if there is a single command.

Something like this? -

update my_table set my_column = nextval('my_sequence');

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2011-10-04 16:14:02 Re: stored function (possible to access file system or call java program)?
Previous Message Scott Marlowe 2011-10-04 16:00:48 Re: table sequence, renumbering