Re: Any form of connection-level "session variable" ?

Поиск
Список
Период
Сортировка
Искать
От
Erik Jones
Тема
Re: Any form of connection-level "session variable" ?
Дата
Msg-id
459D5D04.7050309@myemma.com
Ответ на
Список
Дерево обсуждения
Any form of connection-level "session variable" ? John McCawley <nospam@hardgeus.com>
Re: Any form of connection-level "session variable" ? John McCawley <nospam@hardgeus.com>
Re: Any form of connection-level "session variable" ? Tom Lane <tgl@sss.pgh.pa.us>
Re: Any form of connection-level "session variable" ? Erik Jones <erik@myemma.com>
Re: Any form of connection-level "session variable" ? Tom Lane <tgl@sss.pgh.pa.us>
Re: Any form of connection-level "session variable" ? John McCawley <nospam@hardgeus.com>
Re: Any form of connection-level "session variable" ? Tom Lane <tgl@sss.pgh.pa.us>
Re: Any form of connection-level "session variable" ? John McCawley <nospam@hardgeus.com>
Re: Any form of connection-level "session variable" ? Scott Ribe <scott_ribe@killerbytes.com>
Re: Any form of connection-level "session variable" ? David Fetter <david@fetter.org>
Re: Any form of connection-level "session variable" ? Scott Ribe <scott_ribe@killerbytes.com>
Re: Any form of connection-level "session variable" ? Joe Conway <mail@joeconway.com>
Tom Lane wrote:
> John McCawley  writes:
>   
>> I think I got it:
>> CREATE FUNCTION new_get_emp_id() RETURNS INTEGER AS $$ select emp_id 
>> from secureview.tbl_employee where username = (SELECT current_user) $$ 
>> LANGUAGE SQL IMMUTABLE;
>> I made the function immutable so it only calls it once, therefore no 
>> longer requiring a call per-row.
>>     
>
> Since it's obviously *not* immutable, this will come back to bite you
> sooner or later (probably sooner).  Labeling it STABLE would be
> reasonable, although I'm not certain how much that helps you.  Do you
> have indexes on the columns it's being compared to?
>   
Besides, a temp table is pretty much a session variable.

-- 
erik jones 
software development
emma(r)

В списке pgsql-general по дате отправления
От: Tom Lane
Дата:
От: Tom Lane
Дата:
FAQ