X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 129C2D1B49B for ; Tue, 13 Apr 2004 03:20:07 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 49555-09 for ; Tue, 13 Apr 2004 03:20:03 -0300 (ADT) Received: from smtp.istop.com (dci.doncaster.on.ca [66.11.168.194]) by svr1.postgresql.org (Postfix) with ESMTP id 61BD9D1BABB for ; Tue, 13 Apr 2004 03:20:01 -0300 (ADT) Received: from stark.xeocode.com (gsstark.mtl.istop.com [66.11.160.162]) by smtp.istop.com (Postfix) with ESMTP id 7523717C437; Tue, 13 Apr 2004 02:20:01 -0400 (EDT) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1BDHH7-0006Mi-00; Tue, 13 Apr 2004 02:20:01 -0400 To: Tom Lane Cc: Bret Hughes , Stephan Szabo , postgresql sql list Subject: Re: trigger/for key help References: <1081662204.6609.72.camel@bretsony> <20040411080932.Q83278@megazone.bigpanda.com> <1081711155.6399.165.camel@bretsony> <17189.1081720813@sss.pgh.pa.us> <1081724318.2628.20.camel@bretsony> <28212.1081736841@sss.pgh.pa.us> In-Reply-To: <28212.1081736841@sss.pgh.pa.us> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 13 Apr 2004 02:20:00 -0400 Message-ID: <873c78e6wf.fsf@stark.xeocode.com> Lines: 26 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/114 X-Sequence-Number: 17489 Tom Lane writes: > Bret Hughes writes: > > FWIW I tried to use alter table but could never get the parser to accept > > $1 as a constraint name. I used single and double quotes as well as a > > lame attempt \$1. > > Hm, "$1" works for me ... Hm, this reminds me. When I was first learning this stuff I was stymied by the same issue. It took me quite a while to figure out how to drop constraints because of the quoting issue. Of course now it seems obvious, but for someone just starting it adds another roadblock. Is there a reason postgres goes out of its way to pick names that will be harder to work with than necessary? Or is it considered a good thing on the theory that if it's hard to reference it's also hard to accidentally use such names in conflicting ways? Perhaps names like _1 _2 ... would be easier to handle? Or perhaps making $ not require quoting would be helpful? -- greg