pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: roopa perumalraja <roopabenzer@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: increment the primary key value without using sequences
Date: Sun, 29 Jul 2007 05:00:09 -0700 (PDT)
Message-ID: <945413.94674.qm@web50803.mail.re2.yahoo.com> (raw)

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. 

view thread (2+ messages)  latest in thread

Message-ID: <945413.94674.qm@web50803.mail.re2.yahoo.com>
Permalink:  ../945413.94674.qm@web50803.mail.re2.yahoo.com/
Also on:    postgresql.org/message-id/945413.94674.qm@web50803.mail.re2.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: roopabenzer@yahoo.com
  Subject: Re: increment the primary key value without using sequences
  In-Reply-To: <945413.94674.qm@web50803.mail.re2.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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