Re: Why are default encoding conversions - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Why are default encoding conversions
Date
Msg-id 20060328163133.GD12995@svana.org
Whole thread Raw
In response to Re: Why are default encoding conversions  (Tatsuo Ishii <ishii@sraoss.co.jp>)
List pgsql-hackers
On Wed, Mar 29, 2006 at 01:09:08AM +0900, Tatsuo Ishii wrote:
> BTW, what does the standard say about conversion vs. schema? Doesn't
> conversion belong to schema? If so, then schema specific default
> conversion seems more standard-friendly way.

The standard says nothing about conversions. They're only used when
communicating between the client and the server. By having them belong
to a schema you suggest that your queries be interpreted differently
character set-wise depending on the schema.

SELECT * FROM myschema.mytable;
SET search_path=otherschema;
SELECT * FROM myschema.mytable;

So the second may produce a different output because the schema changed
and the data to the client will be encoded in a different encoding.
Ofcourse, if the client and server are using the same encoding then the
queries will produce the same result. That sounds broken to me.

The reason it doesn't happen now is because (as Tom said) we only do
the lookup once. But can trigger it if you're careful.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] PANIC: heap_update_redo: no block
Next
From: Tom Lane
Date:
Subject: Re: Shared memory