Re: can't delete record

From: Michael Fork <mfork(at)toledolink(dot)com>
To: Cedar Cox <cedarc(at)visionforisrael(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: can't delete record
Date: 2001-03-06 20:28:01
Message-ID: Pine.BSI.4.21.0103061525520.5931-100000@glass.toledolink.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

I believe your foreign key is stopping the delete:

SurID character varying(50) NOT NULL .... ON DELETE RESTRICT,
^^^^^^^^^^^^^^^^^^
Make sure all tuples that SurID references are deleted, then try it
again.

Michael Fork - CCNA - MCP - A+
Network Support - Toledo Internet Access - Toledo Ohio

On Tue, 6 Mar 2001, Cedar Cox wrote:

>
> testdb=# select * from tblstsc1options where sc1optionid=1;
> sc1optionid | sc1optionname | sc1optionvalue | surid
> -------------+---------------+----------------+-------
> 1 | blah | | 1.2
> (1 row)
>
> testdb=# delete from tblstsc1options where sc1optionid=1;
> DELETE 0
> testdb=#
>
> --
> I must be really, really tired and I'm missing something. Can anyone
> help ;) FYI, I'm on PG 7.0.2.
>
> As far as I can see, I don't have any rules on this table and the trigger
> function returns new, not null. This is the table definition:
>
> CREATE TABLE tblStSC1Options (
> SC1OptionID int4 NOT NULL,
> SC1OptionName character varying(50) NOT NULL CHECK
> (SC1OptionName<>''),
> SC1OptionValue float4 CHECK (SC1OptionValue>0),
> SurID character varying(50) NOT NULL REFERENCES tblStSC1 ON UPDATE
> CASCADE ON DELETE RESTRICT,
> PRIMARY KEY (SC1OptionID)
> );
>
>
> Thanks,
> -Cedar
>
>

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Cedar Cox 2001-03-06 20:36:49 can't delete record
Previous Message helen 2001-03-06 17:58:41 ODBC Call Failed -