pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
keyword LIMIT in SQL-statement, psqlodbc workaround?
2+ messages / 2 participants
[nested] [flat]

* keyword LIMIT in SQL-statement, psqlodbc workaround?
@ 2000-12-21 21:17  Johann Zuschlag <zuschlag2@online.de>
  0 siblings, 1 reply; 2+ messages in thread

From: Johann Zuschlag @ 2000-12-21 21:17 UTC (permalink / raw)
  To: pgsql-interfaces

Hi,

I'm using a commercial application. Well, apart from the problem 
that it crashes my psqlodbc.dll (which I'm trying to debug)
it uses the keyword LIMIT.

Like: CREATE ITEMS (NAME VARCHAR(10), LIMIT NUMERIC...

To my knowledge it worked with PostgreSQL 6.4. Why not with 7.x?
I thought it should be possible. Did I misinterpret SQL-92/98?
MS-SQL and ORACLE are accepting it.

Since I can't persuade my application to put LIMIT in quotes,
I need another solution. Any ideas, workarounds how to do it in
psqlodbc?

regards

Johann






^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: keyword LIMIT in SQL-statement, psqlodbc workaround?
@ 2000-12-23 01:16  Peter Eisentraut <peter_e@gmx.net>
  parent: Johann Zuschlag <zuschlag2@online.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2000-12-23 01:16 UTC (permalink / raw)
  To: Johann Zuschlag <zuschlag2@online.de>; +Cc: pgsql-interfaces

Johann Zuschlag writes:

> I'm using a commercial application. Well, apart from the problem
> that it crashes my psqlodbc.dll (which I'm trying to debug)
> it uses the keyword LIMIT.
>
> Like: CREATE ITEMS (NAME VARCHAR(10), LIMIT NUMERIC...
>
> To my knowledge it worked with PostgreSQL 6.4. Why not with 7.x?

Not sure what was going on in 6.4 but LIMIT is a key word at least since
7.0.  The reason that this is so is the difficulty parsing commands like
this:

	SELECT 'xxx' && LIMIT 5;
                       ^
When the parser is there it does not know whether && is an infix or
postfix operator, in other words whether LIMIT is an operand (as it could
potentially be if your LIMIT column ever needs to be selected) or a
separate clause.  This could perhaps be fixed with more than one token
lookahead and some sweat, but it hasn't been done.

> I thought it should be possible. Did I misinterpret SQL-92/98?
> MS-SQL and ORACLE are accepting it.

It's not part of SQL, but ORACLE has a similar clause IIRC.

> Since I can't persuade my application to put LIMIT in quotes,
> I need another solution. Any ideas, workarounds how to do it in
> psqlodbc?

You could try rebuilding PostgreSQL with LIMIT renamed to something like
XYZLIMIT (look into src/backend/parser), but that strikes me as a brute
force hack.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2000-12-23 01:16 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-12-21 21:17 keyword LIMIT in SQL-statement, psqlodbc workaround? Johann Zuschlag <zuschlag2@online.de>
2000-12-23 01:16 ` Peter Eisentraut <peter_e@gmx.net>

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