Is a backend id or something available for use as a foreign key?

Поиск
Список
Период
Сортировка
От Markus Bertheau
Тема Is a backend id or something available for use as a foreign key?
Дата
Msg-id 1090672507.6022.7.camel@teetnang
обсуждение исходный текст
Ответы Re: Is a backend id or something available for use as a foreign key?
Список pgsql-sql
Hi,

I have this application which has various users. I want the results of
functions to depend on which user is currently logged on. The usual
reply to this is to use CURRENT_USER. But in my case the application's
users are separate from the database users; the application always uses
the same user to connect to the database. Is there a backend id
available or something similar that would allow me to define a view like
this:

CREATE VIEW my_user_name AS
SELECTu.user_name as user_name
FROMusers uJOIN user_has_backend ub ON (u.user_id = ub.user_id)
WHEREub.backend_id = CURRENT_BACKEND_ID;


Thanks

-- 
Markus Bertheau <twanger@bluetwanger.de>



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

Предыдущее
От: Karsten Hilbert
Дата:
Сообщение: Re: surrogate key or not?
Следующее
От: David Garamond
Дата:
Сообщение: Re: surrogate key or not?