ERROR: fmgr_info: function 24809: cache lookup failed
От | Jessica Blank |
---|---|
Тема | ERROR: fmgr_info: function 24809: cache lookup failed |
Дата | |
Msg-id | Pine.LNX.4.44.0212170558110.392-100000@ensim.rackshack.net обсуждение исходный текст |
Ответы |
Re: ERROR: fmgr_info: function 24809: cache lookup failed
Re: ERROR: fmgr_info: function 24809: cache lookup Re: ERROR: fmgr_info: function 24809: cache lookup failed |
Список | pgsql-general |
Hi all. I feel awfully stupid. Migrating my skillset from Oracle to Postgres, I am trying (in vain) to create a trigger and a sequence to "auto increment" the primary key in a table, so I won't have to worry about setting it; each time you INSERT into the table, the primary key will be automagically assigned. Problem is, it isn't working... I get "cache lookup failed" whenever I try to INSERT on that table! THE TABLE: CREATE TABLE SENTENCES ( SENTENCEID NUMERIC, CHAPTERID NUMERIC, SOFFSET INTEGER, PRIMARY KEY (SENTENCEID) ); THE SEQUENCE: CREATE SEQUENCE sentenceid_seq; THE FUNCTION: CREATE FUNCTION sentenceid_fcn() RETURNS OPAQUE AS ' BEGIN SELECT nextval(sentenceid_seq) INTO :new.sentenceid FROM dual; END; ' language plpgsql; THE TRIGGER: CREATE TRIGGER sentenceid_trig BEFORE INSERT ON sentences FOR EACH ROW EXECUTE PROCEDURE sentenceid_fcn(); END; And when I try to INSERT into SENTENCES, without my SENTENCEID, hoping that the function/trigger/sequence will kick in and assign it for me... architxts=# INSERT INTO SENTENCES (CHAPTERID, SOFFSET) VALUES (123, 147); ERROR: fmgr_info: function 24809: cache lookup failed I'm certain I'm doing SOMETHING terribly wrong. Could someone help? PLEEEEASE? Why am I getting that error? Many thanks in advance! -- J e s s i c a L e a h B l a n k
В списке pgsql-general по дате отправления: