X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6100B4762E1 for ; Wed, 23 Apr 2003 14:11:56 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 27073474E42 for ; Wed, 23 Apr 2003 14:11:25 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 2E705D5F7; Wed, 23 Apr 2003 11:11:25 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 2435A5C0A; Wed, 23 Apr 2003 11:11:25 -0700 (PDT) Date: Wed, 23 Apr 2003 11:11:25 -0700 (PDT) From: Stephan Szabo To: "DUDLEY,DONALD (HP-Boise,ex1)" Cc: "'pgsql-sql@postgresql.org'" Subject: Re: SQL Reserved words In-Reply-To: Message-ID: <20030423110949.V86759-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-25.2 required=5.0 tests=BAYES_10,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/344 X-Sequence-Number: 13045 On Tue, 22 Apr 2003, DUDLEY,DONALD (HP-Boise,ex1) wrote: > I am importing a database from Informix (SE 7.25) on HP-UX 11i to postgres > 7.3.2 on RH 8 Linux. > In running the "CREATE TABLE" scripts while building the new database, pgSQL > seems to be choking on several of the column names. > When I looked in the appendix B1 of the Users Manual, I see that some of the > column names are reserved words, either by pgSQL or by ANSI SQL. > Some of the column names are: 'desc' (for 'description', collides with > keyword for 'DESCENDING'), and 'group' (used in 'GROUP BY' clause). > I'd like not to have to alter the many queries used in scripts and programs > to change 'desc' to descr, and group to grp, for example. > Is there a way to tell pgSQL that you're referencing a column name and not a > reserved word? Informix handled them ok... You can use double quotes around the names (in all cases where you refer to it) to use it as an identifier, but that doesn't help if you don't want to change the queries.