Skip site navigation (1) Skip section navigation (2)

renaming sequences

From: Matthew Hixson <hixson(at)poindextrose(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: renaming sequences
Date: 2004-09-28 01:30:37
Message-ID: 0068D10E-10EE-11D9-BF0E-000A95D05926@poindextrose.org (view raw or flat)
Thread:
Lists: 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

Next:From: Sean ShannyDate: 2004-09-28 03:21:58
Subject: Getting an out of memory failure.... (long email)
Previous:From: Marc G. FournierDate: 2004-09-27 23:54:05
Subject: Re: [GENERAL] PostgreSQL 8.0.0 Beta 3 Uploaded

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group