information_schema for all users

Поиск
Список
Период
Сортировка
От Luca Giandoso
Тема information_schema for all users
Дата
Msg-id 3ac7d4e0607090052v4e401a85k927b81b002149e88@mail.gmail.com
обсуждение исходный текст
Ответы Re: information_schema for all users
Список pgsql-sql
I wold like to make a plpgsql function that return column names and
their data types of a specific table.
I have done this using:

CREATE OR REPLACE FUNCTION _get_table_definition(refcursor) RETURNS
refcursor SECURITY DEFINER AS
$$
DECLARE
BEGIN   OPEN $1 FOR SELECT column_name as field_name, data_type as
field_type FROM information_schema.columns WHERE
table_name='_table_name';   RETURN $1;
END;
$$ LANGUAGE plpgsql;

but it works only with the database owner although i have used
"SECURITY DEFINER".
How can I make it works for everyone that calls the function?

I use PostgreSQL 8.1.4


В списке pgsql-sql по дате отправления:

Предыдущее
От: Richard Broersma Jr
Дата:
Сообщение: Re: table joining duplicate records
Следующее
От: mbobi@mac.com
Дата:
Сообщение: distinct with sum