Skip site navigation (1) Skip section navigation (2)

Re: BUG #4939: error query result

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, limaozeng <limaozeng(at)163(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4939: error query result
Date: 2009-07-24 13:25:05
Message-ID: 25836.1248441905@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Greg Stark <gsstark(at)mit(dot)edu> writes:
> On Fri, Jul 24, 2009 at 6:02 AM, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I think the only thing we could do about it is downgrade the implicit
>> casts to "name", which seems like a cure worse than the disease ---
>> it'd interfere with searches in the system catalogs.

> We could try to avoid user-visible functions like current_user
> returning "name" data types.

Only if you want to break system catalog searches.  Example:

regression=# explain select * from pg_class where relname = 'foo';
                                         QUERY PLAN                             
             
--------------------------------------------------------------------------------
-------------
 Index Scan using pg_class_relname_nsp_index on pg_class  (cost=0.00..8.27 rows=
1 width=185)
   Index Cond: (relname = 'foo'::name)
(2 rows)

regression=# explain select * from pg_class where relname = 'foo'::text;
                        QUERY PLAN                         
-----------------------------------------------------------
 Seq Scan on pg_class  (cost=0.00..30.87 rows=3 width=185)
   Filter: ((relname)::text = 'foo'::text)
(2 rows)

If we do what you suggest, and don't want to take the above hit, we
would have to make name be a preferred type, which would *definitely*
create a bunch of problems.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Robert SchnabelDate: 2009-07-24 13:58:32
Subject: Re: pgstat wait timeout
Previous:From: alr.nospamformeDate: 2009-07-24 13:14:40
Subject: BUG #4941: pg_stat_statements crash

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group