我有一個觸發功能對於具有下面的代碼片段表測試環路 - IF TG_OP='UPDATE' THEN
IF OLD.locked > 0 AND
( OLD.org_id <> NEW.org_id OR
OLD.document_code <> NEW.document_code OR
-- Other columns
...........
我有一個PL/pgSQL裏,像這樣 CREATE OR REPLACE FUNCTION foo(colname TEXT, col INT)
RETURNS REAL AS $$
BEGIN
IF (colname = 'a') THEN
RETURN (col * 1.5);
ELSIF (colname = 'b') THEN
我得到這個錯誤時沒有錯誤: DataError: (DataError) invalid input syntax for integer:
"1.50" CONTEXT: PL/pgSQL function "sp_aggregate_cart" line 82
at FOR over EXECUTE statement
'SELECT total_items, subtotal, is_
我有Postres數據庫並且想要比較兩個時間戳字段。 基本查詢: select t1.valu1, t1.valu2 from table1 as t1 where t1.valu1 == t1.valu2
隨着時間戳比較: select t1.valu1, t1.valu2 from table1 as t1
where EXTRACT(EPOCH FROM TIMESTAMP WITH
我想創建一個選擇功能,改變了我的數據 CREATE OR REPLACE FUNCTION PublicatedTask(argument) RETURNS SETOF task AS $$DECLARE
f task%ROWTYPE;
BEGIN
FOR f IN SELECT * FROM Task where layer IN $1 and publicatio
我得到了一些SQL函數 CREATE OR REPLACE FUNCTION tools.update_company(IN company_id integer, OUT value integer)
RETURNS integer AS
$BODY$
BEGIN
select * into value from function_making_int(company_id)