Re: BUG #4939: error query result
От | Tom Lane |
---|---|
Тема | Re: BUG #4939: error query result |
Дата | |
Msg-id | 25836.1248441905@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: BUG #4939: error query result (Greg Stark <gsstark@mit.edu>) |
Список | pgsql-bugs |
Greg Stark <gsstark@mit.edu> writes: > On Fri, Jul 24, 2009 at 6:02 AM, Tom Lane<tgl@sss.pgh.pa.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
В списке pgsql-bugs по дате отправления: