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