Re: [GENERAL] Prepared statements and unknown types

2010-09-30 Thread Thom Brown
On 30 September 2010 14:36, Igor Neyman wrote: >> -Original Message- >> From: Thom Brown [mailto:t...@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

Re: [GENERAL] Prepared statements and unknown types

2010-09-30 Thread Igor Neyman
> -Original Message- > From: Thom Brown [mailto:t...@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-

Re: [GENERAL] Prepared statements and unknown types

2010-09-29 Thread Thom Brown
On 29 September 2010 20:02, Tom Lane wrote: > Peter Bex writes: >> On Wed, Sep 29, 2010 at 07:33:53PM +0100, Thom Brown wrote: >>> Okay, I understand what's happening.  But does the planner need to >>> understand the type of literals in the select list if it's not used >>> anywhere else? > >> Fie

Re: [GENERAL] Prepared statements and unknown types

2010-09-29 Thread Tom Lane
Peter Bex writes: > On Wed, Sep 29, 2010 at 07:33:53PM +0100, Thom Brown wrote: >> Okay, I understand what's happening. But does the planner need to >> understand the type of literals in the select list if it's not used >> anywhere else? > Fields sent back to the client also carry their type wit

Re: [GENERAL] Prepared statements and unknown types

2010-09-29 Thread Thom Brown
On 29 September 2010 19:41, Peter Bex wrote: > On Wed, Sep 29, 2010 at 07:33:53PM +0100, Thom Brown wrote: >> Okay, I understand what's happening.  But does the planner need to >> understand the type of literals in the select list if it's not used >> anywhere else? > > Fields sent back to the clie

Re: [GENERAL] Prepared statements and unknown types

2010-09-29 Thread Peter Bex
On Wed, Sep 29, 2010 at 07:33:53PM +0100, Thom Brown wrote: > Okay, I understand what's happening. But does the planner need to > understand the type of literals in the select list if it's not used > anywhere else? Fields sent back to the client also carry their type with them. There's no "unknow

Re: [GENERAL] Prepared statements and unknown types

2010-09-29 Thread Thom Brown
On 29 September 2010 19:15, Peter Bex wrote: > On Wed, Sep 29, 2010 at 07:08:22PM +0100, Thom Brown wrote: >> 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

Re: [GENERAL] Prepared statements and unknown types

2010-09-29 Thread Peter Bex
On Wed, Sep 29, 2010 at 07:08:22PM +0100, Thom Brown wrote: > 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

[GENERAL] Prepared statements and unknown types

2010-09-29 Thread Thom Brown
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.