Re: SQL Statements question, why I get errors...

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: <plist(at)horistjr(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: SQL Statements question, why I get errors...
Date: 2003-02-23 22:57:47
Message-ID: 200302231457.47596.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Plist,"

> 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:

You're in for a long, painful process if you think you can port a production
application to PostgreSQL (or between *any* two database platforms) without
an expert DBA. Perhaps you should consider a consultant?

> create table test (f1 int, f2 char(30), f3 char(30), f4 char(30))
> create unique index itest on test (f1 asc)

Some databases (MSSQL) require seperate indexes for ascending (ASC) and
descending (DESC) sorts. Postgresql does not; since 7.2.0, we have been able
to use the same index for both types of sorts. As such, Postgresql does not
support the "ASC" syntax in index creation. Simply change your statement to:

create unique index itest on test (f1);

... and it will work.

--
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2003-02-23 23:07:23 Re: syntax question
Previous Message Josh Berkus 2003-02-23 22:52:00 Re: syntax question