[BioC] max query length in RdbiPgSQL

Seth Falcon sfalcon at fhcrc.org
Fri Sep 16 16:05:38 CEST 2005


On 13 Sep 2005, wdmccoy at geo.umass.edu wrote:

> I have been using RdbiPgSQL successfully for a year or two.  I
> commonly save my queries in text files that I can use either in
> PostgreSQL's psql (useful for testing and editing) or in R using
> readLines().  For example (in R):
>
> library(RdbiPgSQL)
> conn <- dbConnect(PgSQL(), host = "localhost", dbname = "agdb")
> test.sql < readLines("queryfile")
> test.df <- dbGetQuery(conn, paste(test.sql, collapse = " "))
>
> This works fine for all the multiline files I have tried -- except
> one.  I have recently encountered a problem with a moderately
> complex, long query (459 characters).  I can execute the query with
> no problem in psql and it returns the 14 rows that I expect.  When I
> execute the query in R as above, I get a dataframe with the expected
> column names, but no rows.  I get no error message.  I am wondering
> if the query string is too long.  Is there a maximum length for
> queries in RdbiPgSQL.

Disclaimer: I haven't had an opportunity to play with the RdbiPgSQL
package.

A quick look at the code does not reveal any obvious max length for
queries.

Can you try a different long query?  For example, it should be easy to
construct very long queries using AS:

SELECT name AS "really long string here" FROM someTable LIMIT 20;

And there are probably better ways that I'm not thinking of.

459 seems not that big, so I suspect there is something else going
on.  I would examine the query, perhaps there is a quoting/comment
char issue?   

+ seth



More information about the Bioconductor mailing list