Re: Trouble making set_sql work...

[prev] [thread] [next] [Date index for 2004/07/13]

From: Stuart Johnston
Subject: Re: Trouble making set_sql work...
Date: 19:44 on 13 Jul 2004
colm-cdbi@xxxxxxxxx.xx.xx wrote:
> On Tue, Jul 13, 2004 at 11:50:04AM -0500, Stuart Johnston wrote:
> 
>>>However, Colm is right, you can't do 'LIMIT ?'.
>>>
>>>Could anyone offer suggestion on how I could do this?  I was just
>>>hoping to make it dynamic so that I could easily generate a top
>>>10-20-100-whatever list.
>>>
>>
>>What DB are you using?  I have found that PostgreSQL (at least 7.2) does 
>>support LIMIT placeholders as long as you use an older DBD::Pg (1.22 
>>works).
> 
> 
> Isn't this deliberate, though?  I have a vague understanding that the
> issue is that if you have 'LIMIT ?' you can't see some of the benefits
> of preparing the statement on the server side on databases that support
> this (like Postgres).  Perhaps someone who knows a lot more about this
> than me could clarify this?

That someone is certainly not me but perhaps I can add to the confusion 
a little.  I'm not sure but I don't think that DBD::Pg supported 
server-side prepares until just last month:

http://gborg.postgresql.org/pipermail/dbdpg-general/2004-June/000967.html

Also, later versions of DBD::Pg do still support LIMIT placeholders but 
you have to specify the bind type.  Version 1.22 automatically sets the 
bind type but it was decided that the code it uses to guess the type was 
not accurate enough so it was removed.  WFM, though.

I don't know how any of this affects performance.


Stuart Johnston

(message missing)

Trouble making set_sql work...
Andy Harrison 14:28 on 13 Jul 2004

Re: Trouble making set_sql work...
colm-cdbi 14:54 on 13 Jul 2004

Re: Trouble making set_sql work...
colm-cdbi 15:10 on 13 Jul 2004

Re: Trouble making set_sql work...
Andy Harrison 14:58 on 13 Jul 2004

Re: Trouble making set_sql work...
Jesse Sheidlower 15:04 on 13 Jul 2004

Re: Trouble making set_sql work...
Andy Harrison 16:36 on 13 Jul 2004

Re: Trouble making set_sql work...
John Beppu 16:46 on 13 Jul 2004

Re: Trouble making set_sql work...
Stuart Johnston 16:50 on 13 Jul 2004

Re: Trouble making set_sql work...
Andy Harrison 17:32 on 13 Jul 2004

Re: Trouble making set_sql work...
colm-cdbi 18:38 on 13 Jul 2004

Re: Trouble making set_sql work...
Andy Harrison 19:33 on 13 Jul 2004

Re: Trouble making set_sql work...
Drew Taylor 19:44 on 13 Jul 2004

Re: Trouble making set_sql work...
colm-cdbi 20:08 on 13 Jul 2004

Re: Trouble making set_sql work...
Andy Harrison 20:52 on 13 Jul 2004

Re: Trouble making set_sql work...
colm-cdbi 18:57 on 13 Jul 2004

Re: Trouble making set_sql work...
Jay Strauss 15:10 on 13 Jul 2004

Re: Trouble making set_sql work...
Perrin Harkins 17:51 on 13 Jul 2004

Re: Trouble making set_sql work...
Andy Harrison 18:23 on 13 Jul 2004

Re: Trouble making set_sql work...
Stuart Johnston 19:44 on 13 Jul 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52