Prepared statements and unknown types

From: Thom Brown <thom(at)linux(dot)com>
To: PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Prepared statements and unknown types
Date: 2010-09-29 18:08:22
Message-ID: AANLkTikt0grVcBCEHumGnc+RoP6OuyNdbN7r7xst92_Y@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Could someone explain why the following doesn't work?

test=# PREPARE meow(unknown) AS
test-# SELECT $1 as meow;
ERROR: could not determine data type of parameter $1

The problem is that using PDO in PHP, prepared statements aren't
possible if values are used instead of columns in the select list.

This appears to be allowed for MySQL and SQL Server.

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Bex 2010-09-29 18:15:17 Re: Prepared statements and unknown types
Previous Message Dianne Yumul 2010-09-29 17:26:36 Get next OID