Обсуждение: how to get unique identifier for a client

Поиск
Список
Период
Сортировка

how to get unique identifier for a client

От
gorsa
Дата:
hi all
is there a way to get a unique identifier for a client? something like
a machine id. session_user does not seem to work since a user can log
on to many workstations. been through the list so i'm not searching
for getting the ip address since the list said something like it's not
supported in unix-sockets, though i'll take it since i'm using
postgres in windows environment. thanks in advance :)

Re: how to get unique identifier for a client

От
"Grzegorz Jaśkiewicz"
Дата:
I would gather all possible inputs of data that you can use for it. 
Will the data be stored in one place for all customers ? if so - you'll be okay with uuid of some sort, as primary key on a table.
if you need data to depend on outside data, either write a query, that would generate it, taking those outside params as input, or write C procedure, that will gather that data, and return some unique key. 

So it all depends on what are you actually trying to achieve. 

Re: how to get unique identifier for a client

От
"Scott Marlowe"
Дата:
On Fri, Oct 10, 2008 at 3:38 AM, gorsa <gorsa.1972@gmail.com> wrote:
> hi all
> is there a way to get a unique identifier for a client? something like
> a machine id. session_user does not seem to work since a user can log
> on to many workstations. been through the list so i'm not searching
> for getting the ip address since the list said something like it's not
> supported in unix-sockets, though i'll take it since i'm using
> postgres in windows environment. thanks in advance :)

Does this unique identifier need to be something with permanence from
one connection to the next?  If not, then select * from
pg_stat_activity should have uniquely identifying information in it.

Re: how to get unique identifier for a client

От
gorsa
Дата:
hi! unfortunately the unique identifier must not change from
connection to connection, so that there can be a meaningful review of
the usage table. is there a similar problem that you've encountered in
the past that has this requirement?