Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id CA6B79FB794 for ; Tue, 3 Apr 2007 07:14:53 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 64404-03 for ; Tue, 3 Apr 2007 07:14:46 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.188]) by postgresql.org (Postfix) with ESMTP id CD8179FB70A for ; Tue, 3 Apr 2007 07:14:49 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu6) with ESMTP (Nemesis), id 0ML29c-1HYg2J29PK-0003W0; Tue, 03 Apr 2007 12:14:48 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1HYg2I-0001Z0-00 for pgsql-sql@postgresql.org; Tue, 03 Apr 2007 12:14:46 +0200 Date: Tue, 3 Apr 2007 12:14:46 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: Serial Message-ID: <20070403101446.GC30108@a-kretschmer.de> References: <008301c775d1$4b224420$1102a8c0@dream> <20070403093222.GB30108@a-kretschmer.de> <00b101c775d6$2d313840$1102a8c0@dream> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00b101c775d6$2d313840$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+hvJGyWw99sa+cTpIv56aAsp0R6SojKn20pPF kky2X+XHVAyhIwiSOjHR5nT0ybW/4tjGyN33Yg40ROY2ewYH6B 7VOxKSdHtBcPDEiqNWzd6Mdys/QDE62 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/22 X-Sequence-Number: 28022 am Tue, dem 03.04.2007, um 11:55:10 +0200 mailte Shavonne Marietta Wijesinghe folgendes: > thanks. I read the page you gave. Really? > > CREATE SEQUENCE seq_mytable_n_gen; > > CREATE TABLE mytable > ( > n_gen int nextval('seq_mytable_n_gen'), > mycolumn1 int, > mycolumn2 int > ); > > > i tried creating it like that. The sequence was created without any error. > But for the create table i get > > ERROR: syntax error at or near "nextval" at character 38 > > What should i do? Your question was, how to set the sequence to a new value, and my answer was: use setval(). Now you tried to create a new table. You have a simple syntax error: ,----[ example ] | test=# create sequence testseq; | CREATE SEQUENCE | test=*# create table testtab (id int default nextval('testseq')); | CREATE TABLE `---- You forgot the word 'default'. > > > Shavonne Wijesinghe > > ----- Original Message ----- > From: "A. Kretschmer" Please, no silly text above with fullquote below, i read from top to bottom... Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net