pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Torsten Zuehlsdorff <foo@meisterderspiele.de>
To: pgsql-sql@postgresql.org
Subject: Re: Migrate to Postgres - Alias a Keyword?
Date: Tue, 05 Mar 2013 14:45:44 +0100
Message-ID: <5135F708.4070100@meisterderspiele.de> (raw)
In-Reply-To: <CAD1stZv54cCFmDcYfrzb2ias3qx=seOewRh0=qEKsrdOThtSvQ@mail.gmail.com>
References: <CAD1stZv54cCFmDcYfrzb2ias3qx=seOewRh0=qEKsrdOThtSvQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

Hi,

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

i would hack the application, if there is database-layer in. For 
problems like this i created the DDDBL (PHP, documentation in german, 
sorry). It is a layer between application and database with full 
controll over the queries and their result.

This is exactly the point to manipulate the SQL. There are many pitfalls 
- like LIMIT as part of a relation, constant, etc - but it will work.

Greetings from Germany,
Torsten


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



view thread (2+ messages)

Message-ID: <5135F708.4070100@meisterderspiele.de>
Permalink:  ../5135F708.4070100@meisterderspiele.de/
Also on:    postgresql.org/message-id/5135F708.4070100@meisterderspiele.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: foo@meisterderspiele.de
  Subject: Re: Migrate to Postgres - Alias a Keyword?
  In-Reply-To: <5135F708.4070100@meisterderspiele.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox