473,407 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Bug with rename bigserial column

I just ran into a dump/restore problem with a bigserial column
on a renamed table.

BIGSERIAL columns when created will automagically create
the sequence also. The sequence name is derived from
the table name and column name.

I had a table named 'audio_usage' and defined a column like this:

ausage_id BIGSERIAL

who's default value was

NEXTVAL('public.audio_usage_ausage_id_seq')

I then renamed my table to 'audio_file_usage'. But the column
in the table remained unchanged. (that ok?)

Well, then I did a pg_dump and a pg_restore to migrate my dev
environment to qa. Well, sure enough, the dump was fine,
but when the restore happened, the newly renamed table combined
with the same bigserial column automagically created it's
sequence, but the sequence created is different from the
default NEXTVAL which still refers to the original table_column_seq
name.

I've corrected the problem manually, but it does seem like a bug
somewhere.

Dante

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #1
3 2206
On Saturday 10 January 2004 21:31, D. Dante Lorenso wrote:
I just ran into a dump/restore problem with a bigserial column
on a renamed table. [snip] I've corrected the problem manually, but it does seem like a bug
somewhere.


Sounds like a bug. You might want to have a look and see if it's restoring the
value of the old or new sequence.

There's a bug form on the website or a -bugs mailing list if you prefer that.
A short example showing the sequence of commands will almost certainly help
too, as will the version of PG you're running.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #2
On Sun, 11 Jan 2004, Richard Huxton wrote:
On Saturday 10 January 2004 21:31, D. Dante Lorenso wrote:
I just ran into a dump/restore problem with a bigserial column
on a renamed table.

[snip]
I've corrected the problem manually, but it does seem like a bug
somewhere.


Sounds like a bug. You might want to have a look and see if it's restoring the
value of the old or new sequence.

There's a bug form on the website or a -bugs mailing list if you prefer that.
A short example showing the sequence of commands will almost certainly help
too, as will the version of PG you're running.


I think previous discussions on this couldn't decide between not renaming the
underlying sequence and the one where the sequence is also renamed when the
table is.

Of course in this instance it's slightly different in that it does sound like a
bug of the dump/restore process with the not renaming sequence behaviour
employed.

I think this applies to 7.4.x as well as 7.3.x but could swear to it.
--
Nigel J. Andrews
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #3
On Sunday 11 January 2004 13:14, Nigel J. Andrews wrote:
On Sun, 11 Jan 2004, Richard Huxton wrote:
On Saturday 10 January 2004 21:31, D. Dante Lorenso wrote:
I just ran into a dump/restore problem with a bigserial column
on a renamed table.
[snip]
I've corrected the problem manually, but it does seem like a bug
somewhere.


Sounds like a bug. You might want to have a look and see if it's
restoring the value of the old or new sequence.

I think previous discussions on this couldn't decide between not renaming
the underlying sequence and the one where the sequence is also renamed when
the table is.

Of course in this instance it's slightly different in that it does sound
like a bug of the dump/restore process with the not renaming sequence
behaviour employed.


Yep - it sounds like the column definition is doing one thing, while the
sequence definition is doing the other.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: TroelsM | last post by:
Hi there ! I am trying to rename a column i Access Set Conn1 = Server.CreateObject("ADODB.Connection") Conn1.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &...
2
by: Paul Casner | last post by:
I have a data warehouse that is about 10 terabyte's worth of data that must be loaded once a month. I am trying to use the DB2 version 8 rename table command but I discovered when you execute this...
0
by: Eric | last post by:
I need to rename a column in an Access Table. SQL RENAME doesn't seem to work. I found a message board from google that suggested RENAME doesn't work with Access at all. Any suggestions on how to...
0
by: juliane26 | last post by:
Even so it should not be there, it sometimes is: somebody wants to rename a column. Today we do unload / recreate table / load using our own db utilities to do so. Now we evaluate Object...
1
by: EricRogers | last post by:
Thanks for any help in advance! Here 5 different cmdStrings that I have tried but they all have a syntax error in it that I cannot spot: (cmdString is dimmed as a String) cmdString = "ALTER TABLE...
1
by: Carl Pearson | last post by:
Howdy, All, Was trying to modify all tables in a particular database starting with the same prefix, i.e., "tbl_". Decided I'd rather have them all start with "_tbl_" instead. Being lazy,...
2
by: mike_dba | last post by:
I am running V9 FP2 on DPF. I understand that V9 LUW now lets you rename a column. I can't seem to get the sytax right. Can anyone point me to what is wrong? db2 "ALTER TABLE myschema.mytable...
1
by: Gladiator | last post by:
Hi Team , Can some one tell me why we dont we have a DROP column or rename a column command in DB2 ? I Have a very Huge table and need to rename a column . The only option i have to do to rename...
4
by: ShadowLocke | last post by:
Hi, I have a table that has a column with name "comment" in it. I think that "comment" is an oracle keyword so i would like to rename this column. when i use the syntax "alter table tablename...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.