这是我的代码:
CREATE OR REPLACE FUNCTION trigger_function() RETURNS TRIGGER AS $$
d_pgsql = 'kupa kupa kupa'
file = open(r'C:\Users\Bartek\Desktop\testowanie\test.txt', 'a')
file.writelines(d_pgsql)
file.close()
$$ LANGUAGE 'plpython3u';
CREATE TRIGGER my_trigger
AFTER INSERT
ON test
FOR EACH ROW
EXECUTE PROCEDURE trigger_function();
执行inserta时,会出现以下错误:
SQL Error [38000]: BŁĄD: PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Bartek\\Desktop\\testowanie\\test.txt'
为什么以及如何解决?