Re: [SQL] session_id

2004-11-21 Thread Bruce Momjian
Riccardo G. Facchini wrote: > No, I can't provide it because your'e right. currval() is NOT affected > by other sessions. > > Thanks anyway for the suggestion, using pg_backend_pid() solved the > uniqueness I needed. I'll keep the nextval/currval for another > opportunity. FYI, we needed a unique

Re: [SQL] session_id

2004-11-18 Thread Riccardo G. Facchini
--- Michael Fuhr <__> wrote: > On Wed, Nov 17, 2004 at 06:25:25AM -0800, Riccardo G. Facchini wrote: > > > > --- Richard Huxton <__> wrote: > > > > > > Add a new sequence to your database: > > [snip] > > > Good idea, but it won't work for what I need. > > I'll be able to do get the nextval('my

Re: [SQL] session_id

2004-11-17 Thread Michael Fuhr
On Wed, Nov 17, 2004 at 06:25:25AM -0800, Riccardo G. Facchini wrote: > > --- Richard Huxton <__> wrote: > > > > Add a new sequence to your database: [snip] > Good idea, but it won't work for what I need. > I'll be able to do get the nextval('my_session_id') as soon as the > session initiates, b

Re: [SQL] session_id

2004-11-17 Thread Richard Huxton
Riccardo G. Facchini wrote: Add a new sequence to your database: CREATE SEQUENCE my_session_id; Then, at the start of every session: SELECT nextval('my_session_id'); and whenever you need the value: SELECT currval('my_session_id'); Good idea, but it won't work for what I need. I'll be able t

Re: [SQL] session_id

2004-11-17 Thread Riccardo G. Facchini
--- Richard Huxton <__> wrote: > Achilleus Mantzios wrote: > > O Richard Huxton Ýãñáøå óôéò Nov 17, 2004 : > > > > > >>Riccardo G. Facchini wrote: > >> > >>>hi all, > >>> > >>>is there a way to determine the session id on a database session? > >>> > >>>I would need to have a unique number whene

Re: [SQL] session_id

2004-11-17 Thread Richard Huxton
Achilleus Mantzios wrote: O Richard Huxton έγραψε στις Nov 17, 2004 : Riccardo G. Facchini wrote: hi all, is there a way to determine the session id on a database session? I would need to have a unique number whenever a session is started, and have this available as a function or view result. Why

Re: [SQL] session_id

2004-11-17 Thread Riccardo G. Facchini
--- Achilleus Mantzios <__> wrote: > O Richard Huxton Ýãñáøå óôéò Nov 17, 2004 : > > > Riccardo G. Facchini wrote: > > > hi all, > > > > > > is there a way to determine the session id on a database session? > > > > > > I would need to have a unique number whenever a session is > started, and >

Re: [SQL] session_id

2004-11-17 Thread Riccardo G. Facchini
--- Richard Huxton <__> wrote: > Riccardo G. Facchini wrote: > > hi all, > > > > is there a way to determine the session id on a database session? > > > > I would need to have a unique number whenever a session is started, > and > > have this available as a function or view result. > > Add a n

Re: [SQL] session_id

2004-11-17 Thread Achilleus Mantzios
O Richard Huxton έγραψε στις Nov 17, 2004 : > Riccardo G. Facchini wrote: > > hi all, > > > > is there a way to determine the session id on a database session? > > > > I would need to have a unique number whenever a session is started, and > > have this available as a function or view result. W

Re: [SQL] session_id

2004-11-17 Thread Richard Huxton
Riccardo G. Facchini wrote: hi all, is there a way to determine the session id on a database session? I would need to have a unique number whenever a session is started, and have this available as a function or view result. Add a new sequence to your database: CREATE SEQUENCE my_session_id; Then,

[SQL] session_id

2004-11-17 Thread Riccardo G. Facchini
hi all, is there a way to determine the session id on a database session? I would need to have a unique number whenever a session is started, and have this available as a function or view result. thanks. ---(end of broadcast)--- TIP 8: explain