pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
What is the postgres sql command for last_user_id ???
3+ messages / 3 participants
[nested] [flat]

* What is the postgres sql command for last_user_id ???
@ 2005-03-01 15:46 amrit@health2.moph.go.th
  2005-03-02 06:43 ` Re: What is the postgres sql command for last_user_id ??? stig erikson <stigerikson_nospam_@yahoo.se>
  2005-03-02 08:12 ` Re: What is the postgres sql command for last_user_id ??? Michael Fuhr <mike@fuhr.org>
  0 siblings, 2 replies; 3+ messages in thread

From: amrit@health2.moph.go.th @ 2005-03-01 15:46 UTC (permalink / raw)
  To: pgsql-performance

I would like to know whether there is any command which the server will give the
record ID back to the client when client puts the data and the server generates
an autoincrement ID for that record.
For example if many clients try to put the money data to the server and each
record from each client has its own record ID by autoincrement process of the
server [x+1] and i don't need to lock the record since it will bring the system
to slow down. That client wil then want to know which ID that server gives to
that record in order to select that record to print the reciept [bill].
I know that in mysql there is a command "last_record_id" which acts the same as
I mention above. Does anybody know that , please give me the detail?

Amrit,Thailand





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: What is the postgres sql command for last_user_id ???
  2005-03-01 15:46 What is the postgres sql command for last_user_id ??? amrit@health2.moph.go.th
@ 2005-03-02 06:43 ` stig erikson <stigerikson_nospam_@yahoo.se>
  1 sibling, 0 replies; 3+ messages in thread

From: stig erikson @ 2005-03-02 06:43 UTC (permalink / raw)
  To: pgsql-performance

amrit@health2.moph.go.th wrote:
> I would like to know whether there is any command which the server will give the
> record ID back to the client when client puts the data and the server generates
> an autoincrement ID for that record.
> For example if many clients try to put the money data to the server and each
> record from each client has its own record ID by autoincrement process of the
> server [x+1] and i don't need to lock the record since it will bring the system
> to slow down. That client wil then want to know which ID that server gives to
> that record in order to select that record to print the reciept [bill].
> I know that in mysql there is a command "last_record_id" which acts the same as
> I mention above. Does anybody know that , please give me the detail?
> 
> Amrit,Thailand
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
> 

http://www.postgresql.org/docs/8.0/static/functions-sequence.html



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: What is the postgres sql command for last_user_id ???
  2005-03-01 15:46 What is the postgres sql command for last_user_id ??? amrit@health2.moph.go.th
@ 2005-03-02 08:12 ` Michael Fuhr <mike@fuhr.org>
  1 sibling, 0 replies; 3+ messages in thread

From: Michael Fuhr @ 2005-03-02 08:12 UTC (permalink / raw)
  To: amrit@health2.moph.go.th; +Cc: pgsql-performance

On Tue, Mar 01, 2005 at 10:46:02PM +0700, amrit@health2.moph.go.th wrote:

> I would like to know whether there is any command which the server will give the
> record ID back to the client when client puts the data and the server generates
> an autoincrement ID for that record.

See "How do I get the value of a SERIAL insert?" and the question
immediately following it in the FAQ:

http://www.postgresql.org/files/documentation/faqs/FAQ.html#4.11.2

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-03-02 08:12 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-03-01 15:46 What is the postgres sql command for last_user_id ??? amrit@health2.moph.go.th
2005-03-02 06:43 ` stig erikson <stigerikson_nospam_@yahoo.se>
2005-03-02 08:12 ` Michael Fuhr <mike@fuhr.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox