0
我有一個表「B2S」PSQL程序功能無法識別列
Column | Type | Modifiers
-----------+-----------------------+-----------
id | character varying(50) | not null
list | character varying | not null
issue | date | not null
due | date |
1.I想使因自動列30天內較發行列,每當我們做一個新行
Triggers:
b2sinsert
BEFORE INSERT OR UPDATE ON b2s
FOR EACH ROW EXECUTE PROCEDURE dueupdate()
下面是該過程:
BEGIN NEW.due = (issue + INTERVAL '30 days'); NEW.issue = issue; NEW.list = list; NEW.id = id; RETURN NEW; END;
當我試圖在表中插入一個元素,我得到以下錯誤:
ERROR: column "issue" does not exist
LINE 1: SELECT (issue + INTERVAL '30 days')
^
QUERY: SELECT (issue + INTERVAL '30 days')
CONTEXT: PL/pgSQL function dueupdate() line 1 at assignment
那麼,如果第一個提供的「表」是books2學生,那麼我不會在那裏看到這樣一個專欄 - 那麼爲什麼你試圖在那裏寫一個值呢?也 - 可怕的標籤。你怎麼能在同一時間將問題標記爲psql和mysql? – murison 2015-03-19 07:57:27
我試圖使觸發發生**後**插入或更新以達到相同的結果 – Rice 2015-03-19 20:48:45