Unix Technical Forum

What is the postgres sql command for last_user_id ???

This is a discussion on What is the postgres sql command for last_user_id ??? within the Pgsql Performance forums, part of the PostgreSQL category; --> I would like to know whether there is any command which the server will give the record ID back ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Performance

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 11:11 AM
amrit@health2.moph.go.th
 
Posts: n/a
Default What is the postgres sql command for last_user_id ???

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 11:11 AM
stig erikson
 
Posts: n/a
Default Re: What is the postgres sql command for last_user_id ???

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/s...-sequence.html
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 11:12 AM
Michael Fuhr
 
Posts: n/a
Default Re: What is the postgres sql command for last_user_id ???

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/docu...AQ.html#4.11.2

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

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:44 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com