pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feed From: A. Kretschmer <andreas.kretschmer@schollglas.com>
To: pgsql-sql@postgresql.org
Subject: Re: Serial
Date: Tue, 3 Apr 2007 12:40:12 +0200
Message-ID: <20070403104012.GD30108@a-kretschmer.de> (raw )
In-Reply-To: <00e101c775da$fce4ec90$1102a8c0@dream >
References: <008301c775d1$4b224420$1102a8c0@dream >
<20070403093222.GB30108@a-kretschmer.de >
<00b101c775d6$2d313840$1102a8c0@dream >
<20070403101446.GC30108@a-kretschmer.de >
<00e101c775da$fce4ec90$1102a8c0@dream >
am Tue, dem 03.04.2007, um 12:29:37 +0200 mailte Shavonne Marietta Wijesinghe folgendes:
> I'm mixed up now. I was suppose to something but i did something else.
>
> OK so i have my FAMOUS table with the n_gen serial NOT NULL
> I got lost a bit. When and where do i use the setval() ??
Only to manipulate the current value of this sequence.
>
> For example i INSERT records via ASP. so i should put the setval() in the
> INSERT INTO of the ASP page??
No. You can define your table like:
create table foo (id serial, ...)
This creates implicit a own sequence and set the default for id to
nextval().
> And even when i do a SELECT i should use the setval()??
For a select? No.
12:39 < akretschmer> ??sequence
12:39 < rtfm_please> For information about sequence
12:39 < rtfm_please> see http://techdocs.postgresql.org/college/001_sequences/index.php
12:39 < rtfm_please> or http://www.postgresql.org/docs/current/interactive/sql-createsequence.html
12:39 < rtfm_please> or http://www.postgresql.org/docs/current/static/functions-sequence.html
Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
view thread (9+ messages) latest in thread
Message-ID: <20070403104012.GD30108@a-kretschmer.de>
Permalink: ../20070403104012.GD30108@a-kretschmer.de/
Also on: postgresql.org/message-id/20070403104012.GD30108@a-kretschmer.de
copy link · copy postgr.es
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: andreas.kretschmer@schollglas.com
Subject: Re: Serial
In-Reply-To: <20070403104012.GD30108@a-kretschmer.de>
* 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