Problem with transaction

From: Alexander Haväng <eel(at)musiknet(dot)se>
To: pgsql-general(at)postgresql(dot)org
Subject: Problem with transaction
Date: 2000-11-17 10:40:39
Message-ID: 20001117114039.C30658@ljudo.shortlist.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi :)

I'm kinda new with SQL, and kinda new with postgres, but I'm having trouble
with a simple transaction that works just fine on Informix so it should
work here on postgres too unless I'm messing it up somehow.

This is my table
CREATE TABLE hosts (
hid SERIAL PRIMARY KEY,
name VARCHAR(40) NOT NULL UNIQUE,
hostname VARCHAR(255) NOT NULL
);

This is my psql session:
filterlogic=> begin;
BEGIN
filterlogic=> insert into hosts (name, hostname) VALUES ('sun', 'www.sun.com');
INSERT 403520 1
filterlogic=> delete from hosts where name='sun';
ERROR: triggered data change violation on relation "hosts"
ERROR: triggered data change violation on relation "hosts"

If I do a commit before the delete, it works just fine.
Why is this, and what can I do to get around this?

Regards,
Eel

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Jerusalem 2000-11-17 11:11:41 Re: I know installation questions are boring ...
Previous Message Alexey Borzov 2000-11-17 08:36:01 Re[2]: [HACKERS] Re: PHPBuilder article -- Postgres vs MySQL