Conceptually I don't understand why this doesn't work.
from the psql prompt:
plumbing=# begin;
BEGIN
plumbing=# insert into plan_prices
plumbing-# (plan_id, eff_date, ground, topout, final)
plumbing-# values
plumbing-# (1, '2001-01-01',1000,1000,1000);
INSERT 215620 1
plumbing=# select currval('plan_prices_id_seq');
currval
---------
11
(1 row)
plumbing=# SELECT * from plan_prices ;
id | plan_id | eff_date | ground | topout | final
----+---------+------------+---------+---------+---------
1 | 1 | 2000-01-01 | 1000.00 | 2400.00 | 1700.00
4 | 1 | 2000-06-01 | 0.00 | 0.00 | 0.00
7 | 1 | 2001-01-01 | 1000.00 | 1000.00 | 1000.00
11 | 1 | 2001-01-01 | 1000.00 | 1000.00 | 1000.00
(4 rows)
plumbing=# delete from plan_prices where id=11;
ERROR: triggered data change violation on relation "plan_prices"
plumbing=# ABORT ;
ROLLBACK
--
shaky cellar