Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id B63A29FB644 for ; Tue, 3 Apr 2007 07:40:22 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 58551-08 for ; Tue, 3 Apr 2007 07:40:19 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.183]) by postgresql.org (Postfix) with ESMTP id 84C669FB2A0 for ; Tue, 3 Apr 2007 07:40:18 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu0) with ESMTP (Nemesis), id 0MKwh2-1HYgQu4AKp-000415; Tue, 03 Apr 2007 12:40:16 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1HYgQu-0001nY-00 for pgsql-sql@postgresql.org; Tue, 03 Apr 2007 12:40:12 +0200 Date: Tue, 3 Apr 2007 12:40:12 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: Serial Message-ID: <20070403104012.GD30108@a-kretschmer.de> References: <008301c775d1$4b224420$1102a8c0@dream> <20070403093222.GB30108@a-kretschmer.de> <00b101c775d6$2d313840$1102a8c0@dream> <20070403101446.GC30108@a-kretschmer.de> <00e101c775da$fce4ec90$1102a8c0@dream> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00e101c775da$fce4ec90$1102a8c0@dream> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! User-Agent: Mutt/1.5.9i X-Provags-ID: V01U2FsdGVkX1+yat+5MO6zH8/UhplHwShdYd8klOdv8vSGbre RF6c1HCqWOAdYEr9dhD63owaPapaEFVD11TpYXVRHh8IxkmqZy /k/SbulppgfdxvzYZTS3SPtMJlrzJLc X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/24 X-Sequence-Number: 28024 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