By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,829 Members | 1,798 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,829 IT Pros & Developers. It's quick & easy.

renaming sequences

P: n/a
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@
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.