Re: BUG #4939: error query result - Mailing list pgsql-bugs

From Greg Stark
Subject Re: BUG #4939: error query result
Date
Msg-id 407d949e0907232228s7ad30d9o2154452ded6df4ad@mail.gmail.com
Whole thread Raw
In response to Re: BUG #4939: error query result  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #4939: error query result  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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. If no user-visible functions returned
"name" then this wouldn't happen unless people were actually querying
catalog tables.

that would mean changing the return type of these functions:

 getpgusername
 current_user
 session_user
 current_database
 current_schema
 getdatabaseencoding
 pg_client_encoding
 pg_encoding_to_char
 pg_get_userbyid


The only downside I see is that it means a strdup when these functions
are called which might be annoying. However now that I look a number
of them are actually already calling namein anyways. Are they used
internally in places that expect a name?

--
greg
http://mit.edu/~gsstark/resume.pdf

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #4939: error query result
Next
From: "Robert Treat"
Date:
Subject: BUG #4940: Performance regression between 8.2 and 8.3.7