Re: Unable to Delete a Row

Поиск
Список
Период
Сортировка
От Kevin Crenshaw
Тема Re: Unable to Delete a Row
Дата
Msg-id D8439C286CD66D4EBD89F853EBCE6E210F7B9E@ccs1.tiewireinc.com
обсуждение исходный текст
Ответ на Unable to Delete a Row  ("Kevin Crenshaw" <kcrenshaw@tiewireinc.com>)
Ответы Re: Unable to Delete a Row
Список pgsql-novice

Paul,

 

Thanks for responding.  I tried your suggestion and it didn’t work.  However, I found that when I removed a trigger from the contacts table, the deletion completed successfully.  Here is the text for the trigger function:

 

CREATE OR REPLACE FUNCTION tg_remove_contact() RETURNS TRIGGER AS $$

      BEGIN

            UPDATE synchronization SET db_updated = current_timestamp, action = 'exch_del'

                  WHERE OLD.contactid = synchronization.contactid;

      RETURN NULL;

      END;

$$ LANGUAGE 'plpgsql';

 

CREATE TRIGGER tg_del_contact BEFORE DELETE

      ON contacts

      FOR EACH ROW

      EXECUTE PROCEDURE tg_remove_contact();

 

Do you know why this trigger would prevent me from deleting a row from the contacts table?

 

Thanks!

 

 

kevin crenshaw

 

 


From: paul@entropia.co.uk [mailto:paul@entropia.co.uk]
Sent: Wednesday, May 25, 2005 10:32 AM
To: pgsql-novice@postgresql.org
Subject: Re: [NOVICE] Unable to Delete a Row

 

Try:

DELETE FROM CONTACTS WHERE CONTACTID = '853';

 

>

> I am running Postgres v8.0.1 on Win XP Pro. When I try to delete a record, which I know exists,

> I simply get ˜DELETE 0™ as a response. Please Help!

>

> Here is a little more info:

>

> DELETE FROM CONTACTS WHERE CONTACTID = 853;

>

> Query returned successfully: 0 rows affected, 62 ms execution time.

> -- Executing query:

> Select * from contacts where contactid = 853;

>

>

> Total query runtime: 15 ms.

> Data retrieval runtime: 16 ms.

> 1 rows retrieved.

>

> -- Executing query:

> EXPLAIN ANALYSE Delete from contacts where contactid = 853;

>

>

> Total query runtime: 63 ms.

> Data retrieval runtime: 0 ms.

> 3 rows retrieved.

>

> Thanks in advance

>

> kevin crenshaw

>

>

 

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Celia McInnis"
Дата:
Сообщение: COPY with multiple character delimiter?
Следующее
От: Steve Tucknott
Дата:
Сообщение: Re: Unable to Delete a Row