Re: Constraint exclusion issue

From: Emanuel Calvo Franco <postgres(dot)arg(at)gmail(dot)com>
To: Mathieu De Zutter <mathieu(at)dezutter(dot)org>
Cc: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Constraint exclusion issue
Date: 2010-01-17 15:45:56
Message-ID: f205bb121001170745h4e1cb439u742b76c6f7d27bd2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2010/1/16 Mathieu De Zutter <mathieu(at)dezutter(dot)org>:
> On Sat, Jan 16, 2010 at 7:26 PM, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> wrote:
>> On Sat, Jan 16, 2010 at 11:02 AM, Mathieu De Zutter
>> <mathieu(at)dezutter(dot)org> wrote:
>>> shs-dev=# explain select * from parent where (c,n) = '("b",0)';
>>> ERROR:  input of anonymous composite types is not implemented
>>
>> Shouldn't that be 'b' not "b" ?
>
> It is special syntax to avoid escapes:
>
> shs-dev=# select '("b",0)'::y;
>   y
> -------
>  (b,0)
>

To avoid escapes use E'string'.

In that case the ' will be include into the string, so it will be not more
1 char lenght.

Or something like this:
select ('(' || quote_literal('b') || ',0)')::y

> shs-dev=# select ('("b,",0)'::y).c;
> ERROR:  value too long for type character(1)
> LINE 1: select ('("b,",0)'::y).c;
>
> --

--
Emanuel Calvo Franco
DBA at: www.siu.edu.ar
www.emanuelcalvofranco.com.ar
Join: http://www.thevenusproject.com/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dan Langille 2010-01-17 16:29:11 PGCon 2010
Previous Message Jamie Kahgee 2010-01-17 15:26:54 Data Generators