473,799 Members | 3,832 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Scary behavior after power failure

We had a power failure (and a UPS failure) on our database machine. It's
back up now but some spooky stuff is happening. Here's an example:

(Names changed to protect the guilty.) First, the table:

---

CREATE TABLE foo
(
id SERIAL PRIMARY KEY,

bar INT NOT NULL REFERENCES blah (id),
...

UNIQUE(bar, baz, blee)
);

---

Now take a look at this:

---

pdm=# select * from foo where bar = 5;
id | bar
----------+------
13495206 | 5
13495206 | 5
(2 rows)

(Me: huh? How is that possible? The "id" column is the primary key!)

xxx=# delete from foo where id = 13495206;
DELETE 1

xxx=# select * from foo where bar = 5;
id | bar
----------+------
13495206 | 5
(1 row)

xxx=# delete from related_purchas es where id = 13495206;
DELETE 1

xxx=# select * from foo where bar = 5;
id | bar
----------+------
(0 rows)

---

Is there any way I can "sanity check" the remaining tables for craziness
like this?

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

Nov 23 '05 #1
1 1081
John Siracusa <si******@minds pring.com> writes:
We had a power failure (and a UPS failure) on our database machine. It's
back up now but some spooky stuff is happening.
I'm wondering if you are using IDE drives that lie about write
completion. You'd never notice until something like this happens.
Is there any way I can "sanity check" the remaining tables for craziness
like this?


dump, initdb, reload would be my suggestion.

regards, tom lane

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

Nov 23 '05 #2

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

Similar topics

6
4020
by: Stephane Belzile | last post by:
Is there a way I can detect in vb.Net the power has switched to a UPS unit in case of power failure? Thanks
5
2334
by: Christopher Benson-Manica | last post by:
Is there a way, besides writing another method, to make Date.setMonth() do something more useful than nothing when the month in question creates an invalid date? If I try d=new Date(); d.setMonth( 1 ); today, I'd really like to get some kind of an error rather than silent failure.
4
3692
by: Lauren Wilson | last post by:
A2K I have a combo box that shows the content of a last name field from a table. I use it to locate records in the table form. I can open the form and locate several names quickly by placing the cursor inside the drop-down list and typing the first few letters of the name I want to find. Then, for no apparent reason, the list just stops responding to subsequent searches for names that I KNOW are in the list. The list contains no...
7
2634
by: danfisher | last post by:
After a powerfailure of 10hours I have got my database server back up and the phpBB2 that a site uses is not working. Here is the error. Warning: pg_connect() unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host database.lhasi.org and accepting TCP/IP connections on port 5432? in /var/www/html/dealingwithcrohns/phpBB2/db/postgres7.php on line 79 phpBB : Critical Error ...
12
3284
by: gooch | last post by:
I originally posted the following code in a group discussing threads but after further research I think I have a c question about the code. I know there are a couple of non standard c includes here and the POSIX stuff is non standard but this is how I stumbled onto this question. #include <INTEGRITY.h> #include <stdlib.h> #include <stdio.h> #include <pthread.h> #include <signal.h>
66
3146
by: gyan | last post by:
Hi All, I am using sprintf and getting starnge output in following case char temp_rn; memset(temp_rn,'\0',12); sprintf(temp_rn,"0%s",temp_rn); the final value in temp_rn is 00 how it is behaving like this, when source string and output string is
6
2458
by: maxthebaz | last post by:
Our machines have this requirement: if power failure occurs, many important variables are to be resumed from where they were interrupted after the machine is restarted (power on in this case). In other words, the basic idea is to keep a snapshot of the state machine before it is interrupted. The board is provided with: - a 32-bit H8S/2633 Hitachi microprocessor; - a battery-backed memory (BBM), where these variables are stored; BBM area...
12
3070
by: Rajesh S R | last post by:
Can anyone tell me what is the difference between undefined behavior and unspecified behavior? Though I've read what is given about them, in ISO standards, I'm still not able to get the difference. For example: Consider the following code: a = i; We say that the above expression statement produces undefined
2
2179
by: Chris Thomasson | last post by:
I was wondering if the 'SLINK_*' and 'SLIST_*' macros, which implement a simple singly-linked list, will produce _any_ possible undefined behavior: ____________________________ #include <stdio.h> #include <stdlib.h> #include <assert.h>
0
9543
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10488
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10029
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7567
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5588
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4144
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.