473,654 Members | 3,108 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

zombie primary key lurches out of database to devour the brains of the unwary

Using PG 7.4.5 on Mac OS X 10.3 ...

I have a primary key that I can't destroy and can't create. One weird
symptom is that when I use \d in psql to attempt to display the
constraint, there is no output at all! Normally, psql either shows the
constraint or reports that the constraint doesn't exist.

(BTW, I know that the default clauses below are kind of weird, but I am
using PG to process data for a database that doesn't use NULL and uses
0 and empty strings as default values. The DDL is generated
automatically, so the defaults don't all make sense, but they should be
harmless. Don't worry; the app is almost ported to PG ;-)

In the transcript below, snp_main_chr22 is the table, and there is
supposed to be a primary key snp_main_chr22_ pk on the refsnp_id column:

egenome_test=# egenome_test=# \d snp_main_chr22
Table "build.snp_main _chr22"
Column | Type | Modifiers
-------------+-----------------------+-------------------------------
refsnp_id | integer | default 0
variation | character varying(10) | default ''::character varying
het | character varying(20) | default ''::character varying
validated | character varying(5) | default ''::character varying
chr | character varying(2) | default ''::character varying
assay_size | integer | default 0
pop_size | integer | default 0
seq_pos | integer | default 0
transcribed | character varying(1) | default ''::character varying
egenome_test=#

egenome_test=# alter table snp_main_chr22 drop constraint
snp_main_chr22_ pk;
ERROR: constraint "snp_main_chr22 _pk" does not exist

egenome_test=# drop table snp_main_chr22 cascade;
DROP TABLE

egenome_test=# \d snp_main_chr22_ pk

egenome_test=# \d snp_main_chr22_ pk_gibberish
Did not find any relation named "snp_main_chr22 _pk_gibberish".

egenome_test=# CREATE TABLE snp_main_chr22 (
refsnp_id integer DEFAULT 0,
variation varchar(10) DEFAULT '',
het varchar(20) DEFAULT '',
validated varchar(5) DEFAULT '',
chr varchar(2) DEFAULT '',
assay_size integer DEFAULT 0,
pop_size integer DEFAULT 0,
seq_pos integer DEFAULT 0,
transcribed varchar(1) DEFAULT ''
);
egenome_test(# egenome_test(# egenome_test(# egenome_test(#
egenome_test(# egenome_test(# egenome_test(# egenome_test(#
egenome_test(# egenome_test(# CREATE TABLE

egenome_test=# ALTER TABLE snp_main_chr22
ADD CONSTRAINT snp_main_chr22_ pk
PRIMARY KEY (refsnp_id)
;
egenome_test-# egenome_test-# egenome_test-# NOTICE: ALTER TABLE / ADD
PRIMARY KEY will create implicit index "snp_main_chr22 _pk" for table
"snp_main_chr22 "
ERROR: relation "snp_main_chr22 _pk" already exists

egenome_test=# egenome_test=# \d snp_main_chr22
Table "build.snp_main _chr22"
Column | Type | Modifiers
-------------+-----------------------+-------------------------------
refsnp_id | integer | default 0
variation | character varying(10) | default ''::character varying
het | character varying(20) | default ''::character varying
validated | character varying(5) | default ''::character varying
chr | character varying(2) | default ''::character varying
assay_size | integer | default 0
pop_size | integer | default 0
seq_pos | integer | default 0
transcribed | character varying(1) | default ''::character varying
egenome_test=#
Thanks for any advice.

Kevin Murphy
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #1
1 1201
Kevin Murphy <mu****@genome. chop.edu> writes:
I have a primary key that I can't destroy and can't create. One weird
symptom is that when I use \d in psql to attempt to display the
constraint, there is no output at all!
That's strange. Maybe some sort of catalog corruption? Try "psql -E"
to see the queries issued by \d, and then execute them by hand to see
what you get.
egenome_test=# alter table snp_main_chr22 drop constraint
snp_main_chr22_ pk;
ERROR: constraint "snp_main_chr22 _pk" does not exist


Note that this only says the table doesn't have a constraint by that
name. There could for instance be a non-constraint-associated index
or table by that name. I'm not sure why you're not seeing it in \d,
though, if that were the case.

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
3574
by: John Simmons | last post by:
How is it that even though I have the column "username" in my database set as a Primary key, using my PHP script to add new users to the database works without any errors even when signing up using an existing username. I have a database full of the same usernames!
4
7730
by: A. Tillman | last post by:
We are having a really big problem with a zombie process/transaction that is blocking other processes. When looking at Lock/ProcessID under Current Activity I see a bunch of processes that are blocked by process 94 and process 94 is blocked by process -2. I assume -2 is a zombie that has an open transaction. I cannot find this process to kill and it seems that this transaction is surviving database restarts. I know which table is...
9
6857
by: 101 | last post by:
Taking a course on SQL. They are saying you can get better performance by having multiple files for a group. They then graphically show an example of "Primary" with multiple data files. I have tried altering PRIMARY to have multiple data files and I get and error. I have tried creating a new database with multiple PRIMARY files and get an error. I can ALTER and CREATE secondary files with multiple data files with no
4
3670
by: ctclibby | last post by:
Hi All Seem to be getting zombie sessions. /tmp/sess_ exist and are owned by daemon. I am guessing and these could come from brower crashes, networks gone down ... etc ... even from stuff that I haven't done properly. So for the big question. Can I run a cron job and delete these? Or does PHP also store stuff in another location and could cause me grief down the road? Thanks in advance!
0
1336
by: nisimura | last post by:
Hi, I noticed that when I used SocketServer.ForkingMixIn (ForkingTCPServer), there were always zombie processes around. I searched for where waitpid() is called in ForkingMixIn and found it in SocketServer.py: def process_request(self, request, client_address): """Fork a new subprocess to process the request.""" self.collect_children()
0
2608
by: buttslapper | last post by:
Hi, Recently we discovered in our production server this kind of exception : We are wondering what causes the transaction to be zombied, and why do we get a nullreferenceexception in this method ? As you will see in the call stack, at every 5 minutes (timer), we are inserting data in a transaction. In a day, we can have 2-3 occurence of this problème.
6
1795
by: asadikhan | last post by:
Hello, I have a bit of a design issue around this application I am developing, and I just want to run it through some of the brains out here. So I have a table called ErrorCheck which contains fields ErrorID (PK) and ErrorName. There is another table called Client which contains fields ClientID (PK) and ClientName. Then there is a relationship table called ClientErrorCheck which contains foreign keys ErrorID and
3
2429
by: nghivo | last post by:
I created a DB2 database, and during the creation process (the step that catalog was created, I guess), my current directory ran out of space. After that, I can not drop the database and got the error message: SQL1013N The database alias name or database name "TEST" could not be found. SQLSTATE=42705 If I tried to to catalog the database, the I got the message: SQL1005N The database alias "test" already exists in either the...
2
2410
by: anilchowdhury | last post by:
main() { pid_t child; child=fork(); if(child > 0) {sleep(60); }
0
8372
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8706
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8475
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5621
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
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
4293
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2709
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
1
1915
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1592
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.