Bug?: Text after right paren in query is ignored

Started by Steve Petersonover 20 years ago8 messagesbugs
Jump to latest
#1Steve Peterson
steve@zpfe.com

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

#2Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Steve Peterson (#1)
Re: Bug?: Text after right paren in query is ignored

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)

#3Steve Peterson
steve@zpfe.com
In reply to: Alvaro Herrera (#2)
Re: Bug?: Text after right paren in query is ignored

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.

S

At 09:58 AM 9/30/2005, Alvaro Herrera wrote:

Show quoted text

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)

#4Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Steve Peterson (#3)
Re: Bug?: Text after right paren in query is ignored

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)

#5Oliver Jowett
oliver@opencloud.com
In reply to: Alvaro Herrera (#4)
Re: Bug?: Text after right paren in query is ignored

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

#6Steve Peterson
stevep@zpfe.com
In reply to: Oliver Jowett (#5)
Re: Bug?: Text after right paren in query is ignored

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:

Show quoted text

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

#7Bruce Momjian
bruce@momjian.us
In reply to: Steve Peterson (#6)
Re: Bug?: Text after right paren in query is ignored

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
#8Oliver Jowett
oliver@opencloud.com
In reply to: Steve Peterson (#6)
Re: Bug?: Text after right paren in query is ignored

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