kokizzu / plv8js

Automatically exported from code.google.com/p/plv8js
Other
0 stars 0 forks source link

If you remove a column, trigger dies forever. #96

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create table and trigger.
CREATE TABLE test_table (id serial NOT NULL, data json, test_column text, 
CONSTRAINT test_table_pkey PRIMARY KEY (id));
CREATE OR REPLACE FUNCTION test_trigger() RETURNS trigger AS $$ return NEW $$ 
LANGUAGE plv8 VOLATILE;
CREATE TRIGGER test_tg BEFORE INSERT OR UPDATE ON test_table FOR EACH ROW 
EXECUTE PROCEDURE test_trigger();

2. Insert.
INSERT INTO test_table (data) VALUES ('{"test": 1}');
-- Insert OK

2. Drop column.
ALTER TABLE test_table DROP COLUMN test_column;

3. Insert.
INSERT INTO test_table (data) VALUES ('{"test": 1}');
ERROR: cache lookup failed for type 0

What version of the product are you using? On what operating system?
win7/ubuntu/centos, pgsql 9.2/9.3

Have to recreate the table... (

Original issue reported on code.google.com by moskva...@gmail.com on 21 May 2014 at 2:52

GoogleCodeExporter commented 9 years ago
Working for me on 9.5.

Original comment by AMDuns...@gmail.com on 9 Sep 2014 at 10:32