Re: [HACKERS] session id and global storage

2006-06-29 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > Rodrigo De Leon wrote: >> You could do this: >> >> SELECT procpid||' '||backend_start >> FROM pg_stat_activity >> WHERE datname = current_database() >> AND usename = session_user >> AND client_addr = inet_client_addr() >> AND client_port = inet_client_p

Re: [HACKERS] session id and global storage

2006-06-29 Thread Rodrigo De Leon
That's pretty roundabout. We already expose (hex coded) pid.starttime as a session identifier in log_line_prefix (it's the %c escape) so I don't see any reason not to provide either the same thing directly in a function, or at least to expose the backend pid. That would be nice. ---

Re: [HACKERS] session id and global storage

2006-06-29 Thread Andrew Dunstan
Rodrigo De Leon wrote: Hi, I cant find any function, which tells me something like session id. Is there something like that? I need it in my AM, because I need to know, if something which I wrote in file was written in this current session or previously. How about select procpid||' '||backend

Re: [HACKERS] session id and global storage

2006-06-29 Thread Rodrigo De Leon
Hi, I cant find any function, which tells me something like session id. Is there something like that? I need it in my AM, because I need to know, if something which I wrote in file was written in this current session or previously. How about select procpid||' '||backend_start from pg_stat_activi

Re: [HACKERS] session id and global storage

2006-06-01 Thread Andrew Dunstan
Hannu Krosing said: > Ühel kenal päeval, N, 2006-06-01 kell 10:10, kirjutas David Hoksza: >> It seems MyProcID is what I was searching for... >> > > On a buzy server with lots of connects, procID will repeat quite often. > log_line-prefix has a sessionid gadget: Session ID: A unique identifier

Re: [HACKERS] session id and global storage

2006-06-01 Thread Hannu Krosing
Ühel kenal päeval, N, 2006-06-01 kell 10:10, kirjutas David Hoksza: > It seems MyProcID is what I was searching for... > On a buzy server with lots of connects, procID will repeat quite often. -- Hannu Krosing Database Architect Skype Technologies OÜ Akadeemia tee 21 F, Tallinn

Re: [HACKERS] session id and global storage

2006-06-01 Thread David Hoksza
It seems MyProcID is what I was searching for... David Hoksza DH> Something like this would be maybe possible, but this select can DH> return more rows, when the user is connected with more instances... DH> David Hoksza DH> >>>

Re: [HACKERS] session id and global storage

2006-05-31 Thread David Hoksza
Something like this would be maybe possible, but this select can return more rows, when the user is connected with more instances... David Hoksza >> Hi, I cant find any function, which tells me something like session >> id. Is there something like that? I need it