|
PostgreSQL 8.1.3 on
i686-pc-mingw32
Windows
XP SP2
Summary
of Insert failure (There IS NO DUPLICATE
KEY):
depot_development=# INSERT INTO line_items ("order_id", "product_id",
"quantity", "unit_price") VALUES(1, 2, 2, 989.99);
ERROR: duplicate key violates unique constraint "line_items_pkey" See
attached file for more info. Bugreport.txt is psql narrative. Dumpdd.sql
is the dump of entire (tiny) database, without the offending
insert.
Thanks
in Advance
Warren
Seltzer
|
-- Microsoft Windows XP SP 2 -- Fails to insert new row into line_items with bogus error report -- serial field 'id' not working. -- This is the short form. I'll also attach a file dumpdd.sql with the dump output. Using verbosity verbose -- didn't change the error message (see below).
depot_development=# \set
VERSION = 'PostgreSQL 8.1.3 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC)
3.4.2 (mingw-special)'
AUTOCOMMIT = 'on'
VERBOSITY = 'default'
PROMPT1 = '%/%R%x%# '
PROMPT2 = '%/%R%x%# ... '
PROMPT3 = '>> '
DBNAME = 'depot_development'
USER = 'depot'
PORT = '5432'
ENCODING = 'UTF8'
depot_development=# \dt line_items
List of relations
Schema | Name | Type | Owner
--------+------------+-------+-------
public | line_items | table | depot
(1 row)
depot_development=# \d line_items;
Table "public.line_items"
Column | Type | Modifiers
------------+---------+---------------------------------------------------------
id | integer | not null default nextval('line_items_id_seq'::regclass)
product_id | integer | not null default 0
order_id | integer | not null default 0
quantity | integer | not null default 0
unit_price | real | not null default 0.0
Indexes:
"line_items_pkey" PRIMARY KEY, btree (id)
depot_development=# select * from line_items;
id | product_id | order_id | quantity | unit_price
----+------------+----------+----------+------------
1 | 4 | 1 | 1 | 9999.99
2 | 5 | 2 | 1 | 1.99
3 | 10 | 2 | 1 | 88.98
4 | 9 | 3 | 1 | 22.88
5 | 8 | 4 | 1 | 1
6 | 15 | 4 | 1 | 18.88
7 | 4 | 4 | 1 | 9999.99
8 | 11 | 5 | 3 | 17.99
9 | 16 | 6 | 1 | 44.99
10 | 15 | 6 | 1 | 18.88
11 | 14 | 6 | 1 | 95
12 | 2 | 6 | 1 | 79.99
13 | 20 | 7 | 1 | 989.99
14 | 12 | 7 | 1 | 79.99
15 | 13 | 7 | 1 | 39.99
(15 rows)
depot_development=# INSERT INTO line_items ("order_id", "product_id",
"quantity", "unit_price") VALUES(1, 2, 2, 989.99);
ERROR: duplicate key violates unique constraint "line_items_pkey"
--
-- PostgreSQL database dump
--
SET client_encoding = 'utf8';
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog;
--
-- Name: line_items_id_seq; Type: SEQUENCE SET; Schema: public; Owner: depot
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('line_items', 'id'),
10, true);
--
-- Name: orders_id_seq; Type: SEQUENCE SET; Schema: public; Owner: depot
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('orders', 'id'), 11,
true);
--
-- Name: products_id_seq; Type: SEQUENCE SET; Schema: public; Owner: depot
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('products', 'id'),
1, false);
--
-- Name: users_id_seq; Type: SEQUENCE SET; Schema: public; Owner: depot
--
SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('users', 'id'), 1,
false);
--
-- Data for Name: line_items; Type: TABLE DATA; Schema: public; Owner: depot
--
COPY line_items (id, product_id, order_id, quantity, unit_price) FROM stdin;
1 4 1 1 9999.9902
2 5 2 1 1.99
3 10 2 1 88.980003
4 9 3 1 22.879999
5 8 4 1 1
6 15 4 1 18.879999
7 4 4 1 9999.9902
8 11 5 3 17.99
9 16 6 1 44.990002
10 15 6 1 18.879999
11 14 6 1 95
12 2 6 1 79.989998
13 20 7 1 989.98999
14 12 7 1 79.989998
15 13 7 1 39.990002
\.
--
-- Data for Name: orders; Type: TABLE DATA; Schema: public; Owner: depot
--
COPY orders (id, name, email, address, pay_type, shipped_at) FROM stdin;
1 warren s [EMAIL PROTECTED] here cc 2005-11-24
21:24:04
2 ffff fffffff gggg here check \N
3 Gaga Waga [EMAIL PROTECTED] Oh boy, a good place! po
2005-11-24 21:24:04
4 framis booby [EMAIL PROTECTED] 144 paragon lane check
2005-12-16 15:26:39
5 George W Bush [EMAIL PROTECTED] 1600 Pennsylvania
Avenue\r\nWashington, DC 10001 po \N
6 Abner Doubleday [EMAIL PROTECTED] 1222222 Parking Avenue\r\nNew
York, New York, 10001 check \N
7 Frobish Malaprop [EMAIL PROTECTED] 3.1415926 Pie
Street\r\nWeirdsville, West Dakota 90909\r\nUSA cc \N
\.
--
-- Data for Name: products; Type: TABLE DATA; Schema: public; Owner: depot
--
COPY products (id, title, description, image_url, price, date_available) FROM
stdin;
2 Sox Switcher Changes right sox into left sox and vice versa. Uses
much less electricity than former models, rated Energy Star #1.
/images/gakugaku.gif 79.989998 2000-01-01 00:00:00
3 True Happiness Improve your mood and your prospects all in one easy
package. You will be satisfied with all that happens and have no reason to
complain. Faith in Heaven is included. This is a yearly subscription rate.
http://www.purplemoon.com/Stickers/transfer-happiness.jpg 44.990002
2010-12-31 23:59:00
4 Immortality Live forever whether you want to or not! This makes an
excellent gift along with "True Happiness". Order both together today! This
is a one-time price, not a yearly subscription, so order today.
/images/PSpiral1.gif 9999.9902 2005-11-13 13:38:00
5 A Bucket of Warm Spit Certified to be more valuable than the
Vice-Presidency of the United States (VPOTUS). Rushed to your home or office
in a heated and insulated container by former Pizza couriers in one hour or
less. Contains two liters.\r\n\r\n789.32 kilograms, wrapped.\r\n\r\nignore
this:\r\n\r\n×××\r\n/'קר×××××פ][.ץתצ×× ××ס×שâ¬×°
\r\nױײװâ¬âªâªâª 333⪠67.âª345×¥\r\n /images/PSpiral1.gif
23.99 2005-11-13 13:36:00
8 Spit Remover Suck the spit right out of your mouth!
/images/PSpiral1.gif 1 2005-11-13 00:50:00
9 Space Elevator Let those satellites climb themselves to orbit with
your 21st century space elevator! /images/warren2.jpg 22.879999
2005-11-13 01:00:00
10 Stapler Sexer Check the gender of every stapler in your office with
our new Stapler Sexer from Zydeco! /images/PSpiral1.gif 88.980003
2005-11-13 01:15:00
11 Mt. St. Helens Ash 2 grams of volcanic ash left over from the
titanic explosion of Mount St. Helens. Once common, this ash is now a
collectors item. /images/seedring.gif 17.99 2005-11-13 14:13:00
12 Global Positioning System With your own lever you can move the
earth. Archimedes demonstrated that all you need to reposition the planet
earth is a properly placed lever. We supply the lever at a good price, you
supply the proper position. /images/seedring.gif 79.989998 2005-11-13
14:20:00
13 Meteor Insurance Prepare yourself for the big one! When a comet
or meteor strikes the earth, you may not survive, but your estate could be
worth millions. This is a monthly premium rate. The benefit is a cool $100,000
upon proof of death by meteor.\r\n\r\nDoes not cover volcanoes, termites,
terrorism, death by gangrene or toenail fungus. /images/gakugaku.gif
39.990002 2002-11-14 14:25:00
14 New Orleans Mud 1 milliliter of mud from the New Orleans flood of 2005,
swept from the streets of New Orleans by idealistic volunteers and city
employees. /images/donguri.gif 95 2000-01-01 13:22:00
15 A Dead Mouse Our housecat has volunteered to help build the family
business. She has been bringing us dead mice for years -- now we know why!
One per customer. /images/donguri.gif 18.879999 2002-11-15 13:26:00
16 Stomach Enlarger Let's face it, size matters. Impress your
lover with the size of your stomach after a few easy treatments with our new
stomach enlarger. Walk with new confidence knowing you have the largest
stomach in the room.\r\n\r\nSpecify male or female. /images/Pspiral1.gif
44.990002 2004-11-24 22:33:00
17 Buggy Whip The effective people in any society are those who get
things done faster. So, what are you waiting for? Improve the speed of your
carriage or buggy by stimulating the equine component to ever higher levels of
performance! Get going or move over! /images/PSpiral1.gif 89.989998
2000-02-29 15:15:00
18 Malaria Parasite Your own live Plasmodium Falciparum in a warm
test tube. Kept alive by our patented "Nurture Bath" technology, this microbe
can be injected into your friends bloodstream for a great
surprise!\r\n\r\nOrder yours today!
http://images.google.com/images?q=tbn:rLWbmi1lSbIJ:www.washington.edu/newsroom/news/images/malariacell-lr.jpg
909.77002 2005-12-19 14:12:00
19 World Peace Let peace reign throughout the planet! Finally, an end
to war and violence in your lifetime! \r\n\r\nBuy now and avoid the holiday
rush. http://www.purplemoon.com/Stickers/peace-earth.jpg 1000000.9
2005-12-19 14:25:00
20 Diphtheria Bacillus A whole passel of "Corynebacterium diphtheriae"
in infectious form -- ready to strike. Do not confuse with the malaria
parasite, available separately. Put some in your friends beer as a great "Gag"
gift!\r\n\r\nThe CDC describes diphtheria as "an upper respiratory tract
illness characterized by sore throat, low-grade fever, and an adherent membrane
of the tonsil(s), pharynx, and/or nose". Death is by asphyxiation.\r\n\r\n
http://www.vaccines.mil/documents/images/diph.gif 989.98999
2005-12-19 14:30:00
6 Bellybutton Lint 1 gram of lint collected from the bellybuttons
of monks meditating in the Himalayas mountains of Tibet. A steal at twice the
price! /images/PSpiral1.gif 88.879997 2005-11-12 23:57:00
\.
--
-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: depot
--
COPY users (id, name, hashed_password) FROM stdin;
1 goober 99c6d7afd123ee19d03dc3df1bc8d703d1edc1a9
2 The Lone Ranger 563b023f7576666c5300a959f3a35668577d7933
3 Warren f26b540b92c5e65b0b9ef22d8d53e7e81c94b04e
\.
--
-- PostgreSQL database dump complete
--
---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster
