Re: Prepared statements and unknown types - Mailing list pgsql-general

From Igor Neyman
Subject Re: Prepared statements and unknown types
Date
Msg-id F4C27E77F7A33E4CA98C19A9DC6722A20690D356@EXCHANGE.corp.perceptron.com
Whole thread Raw
In response to Prepared statements and unknown types  (Thom Brown <thom@linux.com>)
Responses Re: Prepared statements and unknown types  (Thom Brown <thom@linux.com>)
List pgsql-general

> -----Original Message-----
> From: Thom Brown [mailto:thom@linux.com]
> Sent: Wednesday, September 29, 2010 2:08 PM
> To: PGSQL Mailing List
> Subject: Prepared statements and unknown types
>
> 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
>

Sorry, for being late to this conversation.
Possibly it works for SQL Server, because SS has SQL_VARIANT data type
(kind of "anytype").

Regards,
Igor Neyman

pgsql-general by date:

Previous
From: "Vishnu S."
Date:
Subject: Re: PostgreSQL server not starting.
Next
From: Tom Lane
Date:
Subject: Re: [9.0] On temporary tables