Re: error when using SELECT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Stewart <astew(at)wam(dot)umd(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: error when using SELECT
Date: 2005-07-26 18:25:14
Message-ID: 17347.1122402314@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andrew Stewart <astew(at)wam(dot)umd(dot)edu> writes:
> I myself am still very new to PostgreSQL, so I'm having trouble telling
> if there is anything wrong with the postgres transaction that is being
> attempted by the bioperl-db maketest. The verbose error output is as
> follows...

> preparing SELECT statement: SELECT SUBSTRING(seq FROM ? FOR ?) FROM
> biosequence WHERE bioentry_id = ?
> ok 30
> ok 31
> DBD::Pg::st execute failed: ERROR: invalid escape string
> HINT: Escape string must be empty or one character.

According to the docs, that syntax is

The substring function with three parameters, substring(string from
pattern for escape-character), provides extraction of a substring that
matches an SQL regular expression pattern.

It would appear that you're supplying an empty string for the second ?
which is a no-no for this particular function.

My guess is that you are trying to port code from another database that
has a different interpretation of this syntax.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dr NoName 2005-07-26 18:25:45 Re: transaction timeout
Previous Message Scott Marlowe 2005-07-26 18:13:55 Re: transaction timeout