pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Patricia Yábar <pyabar@unica.edu>
To: pgsql-php@postgresql.org
Subject: problems with nextval
Date: Thu, 19 Dec 2002 10:13:50 +0100
Message-ID: <3E018DCE.9215A996@unica.edu> (raw)

Hello,
firsts at all sorry for my english and I hope write well.

I create a table using the instruction:

$q=pg_exec($conn,"create table xxx as select codi,
telephone,netxval('name_sequence') as id order by codi,telephone");
and when I list the table the value of nextval is incorrect.
For example two registers sequentially  that I saw when i
proved only the select  was create with the value of netxval change.
With out netxval the sequence is correct
I saw in select with out netxval
name:  telephone

John   123
John   456

was create with netxval
name   telephone      id (value of netxval)
John    456              1
John    123              2

Then I create only the table and then fill the values. making a
separated query for netxval and the registers was good.
Mi conclusion is, that using netxval in this cases is not good but I
want to know if I'm right or there are  others solutions that I can use
when I want to this.
Thanks.







Message-ID: <3E018DCE.9215A996@unica.edu>
Permalink:  ../3E018DCE.9215A996@unica.edu/
Also on:    postgresql.org/message-id/3E018DCE.9215A996@unica.edu

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: pyabar@unica.edu
  Subject: Re: problems with nextval
  In-Reply-To: <3E018DCE.9215A996@unica.edu>
  References: <3E018DCE.9215A996@unica.edu>

* 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