Re: contrib mode - pgenv
От | Mike Mascari |
---|---|
Тема | Re: contrib mode - pgenv |
Дата | |
Msg-id | 3F6D8613.60700@mascari.com обсуждение исходный текст |
Ответ на | Re: contrib mode - pgenv (Peter Eisentraut <peter_e@gmx.net>) |
Ответы |
Re: contrib mode - pgenv
Re: contrib mode - pgenv |
Список | pgsql-patches |
Peter Eisentraut wrote: > Mike Mascari writes: > > >>Out of sheer shame for a stupid remark, I have implemented a pgenv >>contrib module which provides three functions: >> >>set_session_variable (name, value) >>get_session_variable (name) >>reset_session_variables() > > > How is this better than temporary tables? Well, I basically implemented it as a result of this thread: http://archives.postgresql.org/pgsql-general/2003-09/msg01347.php But I can imagine people doing something like this: Earlier: -------- CREATE TABLE budgets ( deptid text not null, budget numeric(16,2); INSERT INTO budgets VALUES ('Peter', 100000); CREATE VIEW v_budgets AS SELECT * FROM budgets WHERE deptid = get_session_variable('deptid'); Upon connecting: --------------- SELECT set_session_variable('deptid', 'Peter'); SELECT * FROM v_budgets; I assume the PHP folks have other reasons as well. Although I'm not sure... Mike Mascari mascarm@mascari.com
В списке pgsql-patches по дате отправления: