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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: John McCawley <nospam(at)hardgeus(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Any form of connection-level "session variable" ?
Date: 2007-01-04 20:13:24
Message-ID: 25636.1167941604@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>> John McCawley <nospam(at)hardgeus(dot)com> writes:
>>> CREATE FUNCTION new_get_emp_id() RETURNS INTEGER AS $$ select emp_id
>>> from secureview.tbl_employee where username = (SELECT current_user) $$
>>> LANGUAGE SQL IMMUTABLE;

One other thing: that no-op sub-SELECT isn't doing anything for you
except adding overhead ... you might've needed it to allow index use
back in 7.2 or before, but not in any remotely modern PG release.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Ribe 2007-01-04 20:17:41 Bug in 8.2 (&8.1) dump & restore
Previous Message Erik Jones 2007-01-04 20:01:08 Re: Any form of connection-level "session variable" ?