Thread: Bug?: Text after right paren in query is ignored

Bug?: Text after right paren in query is ignored

From
Steve Peterson
Date:
Is this a bug or some artifact of the SQL language that I've never
seen before?

SELECT v_id
FROM table
WHERE col = 'V')
AND blah

executes without errors, ignoring the closing paren and everything thereafter.

Platform:  PostgreSQL 8.0.3 on Intel / Windows XP

Re: Bug?: Text after right paren in query is ignored

From
Alvaro Herrera
Date:
On Thu, Sep 29, 2005 at 10:04:04PM -0500, Steve Peterson wrote:
> Is this a bug or some artifact of the SQL language that I've never
> seen before?
>
> SELECT v_id
> FROM table
> WHERE col = 'V')
> AND blah
>
> executes without errors, ignoring the closing paren and everything
> thereafter.

Not here.  How are you executing that query, exactly?

--
Alvaro Herrera       Valdivia, Chile   ICBM: S 39º 49' 17.7", W 73º 14' 26.8"
"Some men are heterosexual, and some are bisexual, and some
men don't think about sex at all... they become lawyers" (Woody Allen)

Re: Bug?: Text after right paren in query is ignored

From
Alvaro Herrera
Date:
On Fri, Sep 30, 2005 at 10:37:05PM -0500, Steve Peterson wrote:
> The query is submitted using the JDBC driver, via
> the SQLExplorer plugin for Eclipse.
>
> Is there a way for me to see the query as it was
> submitted to the backend?  If so I'll take a look and see what it looks
> like.

Sure.  Use the log_statement configuration parameter in postgresql.conf.

--
Alvaro Herrera                         Architect, http://www.EnterpriseDB.com
Thou shalt study thy libraries and strive not to reinvent them without
cause, that thy code may be short and readable and thy days pleasant
and productive. (7th Commandment for C Programmers)

Re: Bug?: Text after right paren in query is ignored

From
Steve Peterson
Date:
The query is submitted using the JDBC driver, via=20
the SQLExplorer plugin for Eclipse.

Is there a way for me to see the query as it was=20
submitted to the backend?  If so I'll take a look and see what it looks lik=
e.

S

At 09:58 AM 9/30/2005, Alvaro Herrera wrote:
>On Thu, Sep 29, 2005 at 10:04:04PM -0500, Steve Peterson wrote:
> > Is this a bug or some artifact of the SQL language that I've never
> > seen before?
> >
> > SELECT v_id
> > FROM table
> > WHERE col =3D 'V')
> > AND blah
> >
> > executes without errors, ignoring the closing paren and everything
> > thereafter.
>
>Not here.  How are you executing that query, exactly?
>
>--
>Alvaro Herrera       Valdivia, Chile   ICBM: S 39=BA 49' 17.7", W 73=BA 14=
' 26.8"
>"Some men are heterosexual, and some are bisexual, and some
>men don't think about sex at all... they become lawyers" (Woody Allen)

Re: Bug?: Text after right paren in query is ignored

From
Oliver Jowett
Date:
Alvaro Herrera wrote:
> On Fri, Sep 30, 2005 at 10:37:05PM -0500, Steve Peterson wrote:
>
>>The query is submitted using the JDBC driver, via
>>the SQLExplorer plugin for Eclipse.
>>
>>Is there a way for me to see the query as it was
>>submitted to the backend?  If so I'll take a look and see what it looks
>>like.
>
>
> Sure.  Use the log_statement configuration parameter in postgresql.conf.

This won't log anything with recent JDBC drivers and pre-8.1 backends.

-O

Re: Bug?: Text after right paren in query is ignored

From
Steve Peterson
Date:
Any known way to log at the JDBC level?  When I get a little time I'm
going to write a test that bypasses Eclipse and SQLExplorer.

On Wed, 5 Oct 2005, Oliver Jowett wrote:

> Alvaro Herrera wrote:
> > On Fri, Sep 30, 2005 at 10:37:05PM -0500, Steve Peterson wrote:
> >
> >>The query is submitted using the JDBC driver, via
> >>the SQLExplorer plugin for Eclipse.
> >>
> >>Is there a way for me to see the query as it was
> >>submitted to the backend?  If so I'll take a look and see what it looks
> >>like.
> >
> >
> > Sure.  Use the log_statement configuration parameter in postgresql.conf.
>
> This won't log anything with recent JDBC drivers and pre-8.1 backends.
>
> -O
>

Re: Bug?: Text after right paren in query is ignored

From
Bruce Momjian
Date:
Steve Peterson wrote:
> Any known way to log at the JDBC level?  When I get a little time I'm
> going to write a test that bypasses Eclipse and SQLExplorer.
>
> On Wed, 5 Oct 2005, Oliver Jowett wrote:
>
> > Alvaro Herrera wrote:
> > > On Fri, Sep 30, 2005 at 10:37:05PM -0500, Steve Peterson wrote:
> > >
> > >>The query is submitted using the JDBC driver, via
> > >>the SQLExplorer plugin for Eclipse.
> > >>
> > >>Is there a way for me to see the query as it was
> > >>submitted to the backend?  If so I'll take a look and see what it looks
> > >>like.
> > >
> > >
> > > Sure.  Use the log_statement configuration parameter in postgresql.conf.
> >
> > This won't log anything with recent JDBC drivers and pre-8.1 backends.

This will be fixed in 8.1.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: Bug?: Text after right paren in query is ignored

From
Oliver Jowett
Date:
Steve Peterson wrote:
> Any known way to log at the JDBC level?  When I get a little time I'm
> going to write a test that bypasses Eclipse and SQLExplorer.

Pass 'logLevel=2' as a URL parameter in the JDBC URL; that will log all
protocol-level messages sent and received, including the query text.

-O