[英]postgresql schemas conflict
我創建了一個名為test1的新數據庫,一個新用戶test1_user,並將數據庫test1上的所有權限都授予了test1_user。 此外,我創建了模式test1_user。 現在,我還創建了新的架構functions_package,其所有者為test1_user。
我的代碼:
CREATE OR REPLACE FUNCTION functions_package.newFunction(file_id
utl_file.file_type) RETURNS VOID AS $body$
BEGIN
functions_package.old_function1(file_id);
functions_package.old_function2(file_id);
functions_package.old_function3(file_id);
End;
--
$body$
LANGUAGE PLPGSQL
SECURITY DEFINER
STABLE;
我在schema functions_package下創建了幾個函數,現在我試圖創建一個使用舊函數的新函數,但即時消息越來越錯誤:
ERROR: syntax error at or near "functions_package"
LINE 3: functions_package.old_function('aa');
我M trying to create the new function from user test1_user; I
M trying to create the new function from user test1_user; I
正在嘗試在新函數中調用的schema functions_package中的每個函數都遇到此錯誤。 在所有舊功能中,我根本沒有召集任何功能,因此我沒有這種錯誤。 一些幫助 ?
您缺少函數名稱前的select
:嘗試:
CREATE OR REPLACE FUNCTION functions_package.newFunction(file_id
utl_file.file_type) RETURNS VOID AS $body$
BEGIN
perform functions_package.old_function1(file_id);
perform functions_package.old_function2(file_id);
perform functions_package.old_function3(file_id);
End;
--
$body$
LANGUAGE PLPGSQL
SECURITY DEFINER
STABLE;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.