pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #5805: "not determine data type" for params in comments
2+ messages / 2 participants
[nested] [flat]

* BUG #5805: "not determine data type" for params in comments
@ 2010-12-29 16:00  Maxim Turchin <nehxby@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Maxim Turchin @ 2010-12-29 16:00 UTC (permalink / raw)
  To: pgsql-bugs


The following bug has been logged online:

Bug reference:      5805
Logged by:          Maxim Turchin
Email address:      nehxby@gmail.com
PostgreSQL version: 8.4
Operating system:   Ubuntu Linux
Description:        "not determine data type" for params in comments
Details: 

I use php PDO extention. If in prepared statement exists comments with
string like ":somestring", this string is parameter, and need to fill.

Example SQL:
select
  /* :some_old_param, */
  :someparam1,
  :someparam2
from sometable;

When i fill last 2 param, and not fill first old param (in comment!), i get
error "not determine data type of parameter $1".

postgresql log:

2010-12-29 17:43:10 EET ERROR:  could not determine data type of parameter
$1
2010-12-29 17:43:10 EET STATEMENT: select
  /* $1, */
  $2,
  $3
from sometable;



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #5805: "not determine data type" for params in comments
@ 2010-12-31 12:43  Robert Haas <robertmhaas@gmail.com>
  parent: Maxim Turchin <nehxby@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Robert Haas @ 2010-12-31 12:43 UTC (permalink / raw)
  To: Maxim Turchin <nehxby@gmail.com>; +Cc: pgsql-bugs

On Wed, Dec 29, 2010 at 11:00 AM, Maxim Turchin <nehxby@gmail.com> wrote:
> 2010-12-29 17:43:10 EET ERROR:  could not determine data type of parameter
> $1
> 2010-12-29 17:43:10 EET STATEMENT: select
>  /* $1, */
>  $2,
>  $3
> from sometable;

You could fix this either by having your driver specify a type for the
parameter, or by changing the query to select $1::text rather than
just $1.  I'm not exactly sure how to do either of those things on the
PHP side, but there's probably a way...

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2010-12-31 12:43 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-12-29 16:00 BUG #5805: "not determine data type" for params in comments Maxim Turchin <nehxby@gmail.com>
2010-12-31 12:43 ` Robert Haas <robertmhaas@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox