| От | Fred Blaise |
|---|---|
| Тема | pg/plsql question |
| Дата | |
| Msg-id | 1110897332.3954.6.camel@localhost.localdomain обсуждение исходный текст |
| Ответы |
Re: pg/plsql question
Re: pg/plsql question |
| Список | pgsql-general |
Hello all
I am trying to grant privs to a user on all tables. I think I understood
there was no command to do that.... :// so I wrote the following:
create or replace function granting() RETURNS integer AS '
declare
v_schema varchar;
v_user varchar;
begin
v_user := "user"
v_schema := "public"
FOR t in select tablename from pg_tables where schemaname =
v_schema
LOOP
grant select on t to v_user;
END LOOP;
return 1;
end;
' LANGUAGE plpgsql;
I then login to psql, and do a \i myscript.sql. It returns CREATE
FUNCTION, but I cannot see anything. The tables are not granted, etc...
Also I am trying to find out how to debug this. How can I print out to
STDOUT the value of t for example?
Thanks for any help
Best,
fred
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера