Skip site navigation (1) Skip section navigation (2)

Error when lock conflict on REPLACE function

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Error when lock conflict on REPLACE function
Date: 2010-03-15 21:13:33
Message-ID: 4B9EA2FD.8090902@agliodbs.com (view raw or flat)
Thread:
Lists: pgsql-bugs
Severity: Annoyance
Versions Tested: 8.4.2
Platform: Linux RHEL 5.4
Reproduceable: always
Steps to reproduce:

1. Create a function.
2. In one session, start an explicit transaction.
3. Do a CREATE OR REPLACE on the same function, but do not commit.
4. Open a 2nd session, and an explicit transaction in that session.
5. Do a CREATE OR REPLACE on the same function in the 2nd session.
6. COMMIT the 2nd session.
7. COMMIT the 1st session.
8. You get:

ERROR: duplicate key value violates unique constraint
"pg_proc_proname_args_nsp_index"
SQL state: 23505

What should have happened: the 2nd replace should have succeeded.  Or it
should have given a user-friendly error message.  Opinions?

--Josh Berkus

Responses

pgsql-bugs by date

Next:From: venu gopalDate: 2010-03-16 04:46:36
Subject: Facing problem with pg_dump
Previous:From: Gregg LindDate: 2010-03-15 19:04:30
Subject: feature request: Loose index scans

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group