Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 2D008B5DBE1 for ; Sat, 11 Jun 2011 12:08:21 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 09193-04 for ; Sat, 11 Jun 2011 15:08:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd-17937.dedibox.fr (sd-17937.dedibox.fr [88.191.100.74]) by mail.postgresql.org (Postfix) with ESMTP id ACB4BB5DBCA for ; Sat, 11 Jun 2011 12:08:13 -0300 (ADT) Received: from [192.168.10.3] (ASte-Genev-Bois-153-1-38-31.w83-200.abo.wanadoo.fr [83.200.88.31]) by sd-17937.dedibox.fr (Postfix) with ESMTPA id DFC783B8F5; Sat, 11 Jun 2011 17:08:12 +0200 (CEST) Subject: Re: Subselects not allowed? From: Guillaume Lelarge To: Leif Biberg Kristensen Cc: pgsql-sql@postgresql.org Date: Sat, 11 Jun 2011 17:08:12 +0200 In-Reply-To: <201106111701.54145.leif@solumslekt.org> References: <201106111701.54145.leif@solumslekt.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.0.2 (3.0.2-2.fc15) Content-Transfer-Encoding: 7bit Message-ID: <1307804893.25444.5.camel@laptop> Mime-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201106/35 X-Sequence-Number: 35501 On Sat, 2011-06-11 at 17:01 +0200, Leif Biberg Kristensen wrote: > Can anybody tell me why this doesn't work? > Because it's not supported. The START clause expects a value, not a subquery. > pgslekt=> CREATE SEQUENCE sources_source_id_seq START WITH (SELECT > MAX(source_id) FROM sources); > ERROR: syntax error at or near "(" > LINE 1: CREATE SEQUENCE sources_source_id_seq START WITH (SELECT MAX... > ^ > pgslekt=> > > regards, Leif > -- Guillaume http://blog.guillaume.lelarge.info http://www.dalibo.com