473,394 Members | 1,812 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,394 software developers and data experts.

Problem with sequences on a reload of a pg_dump file

To all,

We dumped our instance from a 7.4.2 instance compiled with a block size
of 32k running on OSX 10.3.3 server.. We loaded this dump on Fedora
2.6.5-1.358smp running postgresql 7.4.2 compiled with the standard 8k
blocks size.

My problem is that all the sequences were reset to start a 1. :-( Did
I do something wrong as this has never happened before? Also, can I
simply figure out what the next value should be and manually update the
last_value column in each affected sequence?

Thanks.

--sean

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #1
3 1873
Sean Shanny <sh**************@earthlink.net> writes:
My problem is that all the sequences were reset to start a 1. :-( Did
I do something wrong as this has never happened before?
Did the reload actually complete, or did it fail partway through?
Also, can I
simply figure out what the next value should be and manually update the
last_value column in each affected sequence?


No, but you could use setval().

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #2
Tom,

It looks like I probably caused this. :-( I was not paying attention
and rebooted the machine while it was doing the index building. :-(
This is about an 1/2 TB warehouse instance so I am going to look at the
last several thousand lines of the dump file to see if I can replay what
I need to correct the situation. Not a good day.

--sean

Tom Lane wrote:
Sean Shanny <sh**************@earthlink.net> writes:

My problem is that all the sequences were reset to start a 1. :-( Did
I do something wrong as this has never happened before?


Did the reload actually complete, or did it fail partway through?
Also, can I
simply figure out what the next value should be and manually update the
last_value column in each affected sequence?


No, but you could use setval().

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match


Nov 23 '05 #3
non non c plus possible
va falloir penser à arreter tout de même !!!!
Sean Shanny wrote:
To all,

We dumped our instance from a 7.4.2 instance compiled with a block
size of 32k running on OSX 10.3.3 server.. We loaded this dump on
Fedora 2.6.5-1.358smp running postgresql 7.4.2 compiled with the
standard 8k blocks size.

My problem is that all the sequences were reset to start a 1. :-(
Did I do something wrong as this has never happened before? Also,
can I simply figure out what the next value should be and manually
update the last_value column in each affected sequence?

Thanks.

--sean

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

---------------------------(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 23 '05 #4

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

Similar topics

4
by: CSN | last post by:
Is there a way to have p/k sequences get automatically set to max(id)+1 after COPY's like the following? copy table1 (id,name) from stdin; 1 abc 2 def 3 fhi \.
0
by: Martin Hart | last post by:
Hi, postgresql 7.4beta4 on linux and postgresql 7.3.4 on linux We have a database that we routinely backup using "pg_dump -a" We have to do this (dump the data only) because of various...
1
by: Rory Campbell-Lange | last post by:
I am using 7.3.2 I've made a mistake and saved a database like this pg_dump -a -d <db> > out.sql ....instead of using a binary output format, which I guess I need. I can't reload the db due...
2
by: D. Dante Lorenso | last post by:
First I created a function that selected the next available pin code from a table of pre-defined pin codes: CREATE FUNCTION "public"."get_next_pin_code" () RETURNS varchar AS' DECLARE...
20
by: Development - multi.art.studio | last post by:
Hello everyone, i just upgraded my old postgres-database from version 7.1 to 7.4.2. i dumped out my 7.1 database (with pg_dump from 7.1) as an sql-file with copy-commands and to one file using...
4
by: Philip | last post by:
I'm rather new to database stuff. I've been using postgresql for a couple years, but that doesn't mean I understand what I'm doing. I have simply followed the "HOW-TOs". But now I think I'm about...
1
by: Ben-Nes Michael | last post by:
Hello Im getting strange errors when restoring data from pg_dump files: ERROR: duplicate key violates unique constraint "products_pkey" CONTEXT: COPY products, line 1: "98 Super Pak Ruby...
1
by: Plant Thomas | last post by:
Hi, I have a problem restoring a database from Postgresql 7.3 ( backup created with 'pg_dump -Ft -b > test.tar' ) to a new database on PostgreSQL 7.4.3 on Cygwin. I get the following error: ...
6
by: Ilia Chipitsine | last post by:
Dear Sirs, I want to dump all databases, but separately each database in its own file, not all databases in one single file as pg_dumpall does. How can I implement that ? Cheers, Ilia...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.