pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
increment the primary key value without using sequences
2+ messages / 2 participants
[nested] [flat]

* increment the primary key value without using sequences
@ 2007-07-29 12:00 roopa perumalraja <roopabenzer@yahoo.com>
  2007-07-29 13:37 ` Re: increment the primary key value without using sequences Michael Glaesemann <grzm@seespotcode.net>
  0 siblings, 1 reply; 2+ messages in thread

From: roopa perumalraja @ 2007-07-29 12:00 UTC (permalink / raw)
  To: pgsql-sql

Hi all,
   
  I would like to know if its possible to increment the primary key field value of stocks table without using sequences by getting the next value of the pk field from the sequnce table ?
   
  insert into stocks (prim_id, date,time, code, price, volume) (select ..... from temp_stocks)
   
  sequence
  sequence_code | next_value
  prim_id               101
   
  stocks table (prim_id, date, time, code, price, volume)
   
  temp_stocks table (date, time, code, price, volume)
   
  If it can be done, can you please explain me with an example.
   
  Thanks a lot in advance.

       
---------------------------------
Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when. 

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

* Re: increment the primary key value without using sequences
  2007-07-29 12:00 increment the primary key value without using sequences roopa perumalraja <roopabenzer@yahoo.com>
@ 2007-07-29 13:37 ` Michael Glaesemann <grzm@seespotcode.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Glaesemann @ 2007-07-29 13:37 UTC (permalink / raw)
  To: roopa perumalraja <roopabenzer@yahoo.com>; +Cc: pgsql-sql


On Jul 29, 2007, at 7:00 , roopa perumalraja wrote:

> I would like to know if its possible to increment the primary key  
> field value of stocks table without using sequences by getting the  
> next value of the pk field from the sequnce table ?

Why? Any other solution will cause performance issues.

Michael Glaesemann
grzm seespotcode net





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


end of thread, other threads:[~2007-07-29 13:37 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-07-29 12:00 increment the primary key value without using sequences roopa perumalraja <roopabenzer@yahoo.com>
2007-07-29 13:37 ` Michael Glaesemann <grzm@seespotcode.net>

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