Forum OpenACS Q&A: Problem with Postgres

Collapse
Posted by Grzegorz Mucha on
I have the following problem: In my Postgres 7.0.3 installation,
I can't delete records!

Everytime I issue a 'DELETE' statement in psql (or try to delete
something with ACS), it responds with
'DELETE 0', even though I am sure the statement is perfectly correct
and there are rows in the database to be deleted (I even replaced the
DELETE FROM with SELECT * FROM and it shows the records). What can be
the cause.

I do this as user nsadmin, which is the owner of the whole database,
yet it does not help (haven't tried it as postgres, but I suppose the
problem lies elsewhere).

I suspected there is a CREATE RULE, that INSTEAD of deleting records,
does something else, but found nothing.

Please help!

Collapse
Posted by Dan Wickstrom on
Even if you're sure it's correct, it would help if you posted your delete statement.
Collapse
Posted by Don Baccus on
You can also ask over in the Postgres bugs mailing list, which can be found by wandering around through the poorly-organized postgres web site at www.postgresql.org.
Collapse
Posted by Grzegorz Mucha on
well, in an act of desperation I tried
DELETE FROM ec_user_class_user_map;

The second thing I tried was, just to check out:
DELETE FROM ec_sale_prices;

So.... Postgres wasn't complaining about referential integrity, it simply returned DELETE 0 again and again.

Collapse
Posted by Dan Wickstrom on
This seems familiar.  Try restarting the postmaster and see if that makes a difference.
Collapse
Posted by Grzegorz Mucha on
Well, I tried restarting and it didn't work.

After all, this is not some kind of Windows :). I'm looking further...

Collapse
Posted by Don Baccus on
I strongly recommend you contact the pg bugs list.  If this is cockpit  error on your part, it is probably something others will do and an indication that the documentation needs to be improved.  If it is a bug in pg 7.0.3 it's of show-stopper status and they'll want to hear about it ASAP.
Collapse
Posted by Grzegorz Mucha on
Finally, I don't know what can it be about.
Even though I can't delete from ec_sale_prices or ec_user_class_user_map I can still do this in ec_orders or ec_items (provided I don't try to mess with referential integrity). I dropped the database, reloaded it, tried to vacuum analyze, all for nothing, so I am waiting for any new suggestions.