Thread: Issue with UPDATE statement on v8
Hello,
We have recently migrated to Postgres 8 (not sure of exactly which build). We have noticed that a few functions that were working previously are no longer behaving as expected. One function in particular is giving me a strange result.
The function giving us the problem is much more complicated, but for simplicity I‘ve included one that is easier to read and results in the same behavior.
UPDATE t_summary
SET availability = 7
WHERE oid = 28245084
When this query is executed (within a function or without) the database will simply hang. If the UPDATE is turned into a SELECT, the query works just fine. For some reason, the UPDATE is just not working. This same function/query works fines in Postgres 7.2.
The schema for the targeted table is shown below.
CREATE TABLE t_summary (
id varchar(20) NULL,
availability int4 NULL DEFAULT 0,
)
Has anyone else experienced a similar issue? If more information is needed to determine the problem, please let me know. I’ve trimmed down the function’s query and table’s schema for this posting.
Thanks in advance!
kh
On Thu, Sep 22, 2005 at 11:22:22AM -0500, Kenneth Hutchinson wrote: > UPDATE t_summary > SET availability = 7 > WHERE oid = 28245084 > > When this query is executed (within a function or without) the database > will simply hang. If the UPDATE is turned into a SELECT, the query > works just fine. One possibility is that another transaction has updated this row or done a SELECT FOR UPDATE and hasn't committed yet. Does just this one record cause the update to hang or do all updates to the table hang? Have you queried pg_locks in another session while the update is hung? -- Michael Fuhr