X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 30AD947580B for ; Sun, 23 Feb 2003 22:14:29 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 71287-04 for ; Sun, 23 Feb 2003 22:14:18 -0500 (EST) Received: from wolff.to (wolff.to [66.93.249.74]) by postgresql.org (Postfix) with SMTP id 5D24D474E53 for ; Sun, 23 Feb 2003 22:14:18 -0500 (EST) Received: (qmail 8255 invoked by uid 500); 24 Feb 2003 03:27:52 -0000 Date: Sun, 23 Feb 2003 21:27:52 -0600 From: Bruno Wolff III To: plist@horistjr.com Cc: pgsql-sql@postgresql.org Subject: Re: SQL Statements question, why I get errors... Message-ID: <20030224032752.GA8209@wolff.to> Mail-Followup-To: plist@horistjr.com, pgsql-sql@postgresql.org References: <1519.192.168.100.1.1046038673.squirrel@mail.horistjr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1519.192.168.100.1.1046038673.squirrel@mail.horistjr.com> User-Agent: Mutt/1.3.25i X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/523 X-Sequence-Number: 11921 On Sun, Feb 23, 2003 at 17:17:53 -0500, plist@horistjr.com wrote: > I work a software company and our software is run on databases.. We have > no problem using MS SQL, DB2, ect... One of my customers wanted to try > and use POSTGRESQL.. He tried it and is having problems, so I downloaded > it and am running it on my Red Hat 7.3 box.. I am running version 7.3.2 > of Postgresql.. I hope this is the right place to ask this.. When we > first launch our program we create several tables... Here is an example > of one table we create: > > create table test (f1 int, f2 char(30), f3 char(30), f4 char(30)) > create unique index itest on test (f1 asc) > > The first statement works fine.. However the second statement is when i > get this error: > > Error: parser: parse error at or near "asc" at character 43 > > Does anyone know of how I can get the last statement to work with this > database???? Postgresql doesn't allow you to specify directions for indexes. So leave the "asc" off. For an index on a single column it doesn't really matter anyway (clustered tables might be an exception). Currently multicolumn indexes all have to be in the same direction. If you need one that has mixed directions, the current solution is to create a new operator class that is backwards from normal and use that operator class instead of the normal one in the index.