renaming sequences - Mailing list pgsql-general

From Matthew Hixson
Subject renaming sequences
Date
Msg-id 0068D10E-10EE-11D9-BF0E-000A95D05926@poindextrose.org
Whole thread Raw
List pgsql-general
I had a bunch of tables that had v_ prepended to their names.  I've
renamed all of the tables so that they don't have that prefix anymore
so that v_address is now addresses.  The name of this table's sequence
is still v_addresses_address_id_seq.  This is fine except for the fact
that I'm using JBoss and it assumes that the table's sequence is
addresses_address_id_seq.  (Why it needs to read the sequence I have no
idea.)  So now, every time I try to save an object JBoss is executing
sql that is trying to read from a non-existent sequence.
   Can I rename my sequences and change the tables to point to the new
sequence names or do I have to do something like:

1) Rename addresses to addresses_temp
2) Create addresses from scratch so that Postgres creates a sequence
named addresses_address_id_seq
3) Select all of the data from addresses_temp into addresses.

  Thanks,
     -M@


pgsql-general by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: Re: PostgreSQL 8.0.0 Beta 3 Uploaded
Next
From: Sean Shanny
Date:
Subject: Getting an out of memory failure.... (long email)