Migrate to Postgres - Alias a Keyword?

From: Huan Ruan <huan(dot)ruan(dot)it(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Migrate to Postgres - Alias a Keyword?
Date: 2013-03-04 23:17:53
Message-ID: CAD1stZv54cCFmDcYfrzb2ias3qx=seOewRh0=qEKsrdOThtSvQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi All

We are migrating from Firebird to Postgres. We try to minimise changes
required to the application code which has lots of SQLs in it. One of
the incompatibilities between these two is the way to limit the number of
rows returned by a SELECT query.

In Postgres, *SELECT * FROM TestTable LIMIT 10*
In Firebird, *SELECT * FROM TestTable ROWS 10*

What I'm trying to do here is to get Postgres to accept ROWS as if it's
LIMIT. Looks like this is possible by adding an alias
in /src/include/parser/kwlist.h, although ROWS is already defined in it for
other purpose.

Does anyone has a suggestion on this? Can I achieve this without
recompiling our own copy of Postgres?

Thanks
Huan

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Torsten Zuehlsdorff 2013-03-05 13:45:44 Re: Migrate to Postgres - Alias a Keyword?
Previous Message Ben Morrow 2013-03-02 23:45:38 Re: Need help revoking access WHERE state = 'deleted'