Re: Charset/collate support and function parameters

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: db(at)zigo(dot)dhs(dot)org
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Charset/collate support and function parameters
Date: 2004-10-31 06:45:20
Message-ID: 20041031.154520.68034584.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Sun, 31 Oct 2004, Tatsuo Ishii wrote:
>
> > > and now we could add functions that work with this charset
> > >
> > > CREATE FUNCTION bar (x VARCHAR(255) CHARACTER SET foo) ....
> > >
> > > What we are saying is that we don't want to be able to do this?
> >
> > Not sure we want to add above. Is it something defined in the
> > standard?
>
> The syntax in sql2003 do allow it. The exact semantics is difficult to
> get a clear picture of from the spec (as always).

I wonder what is the intention to allow such that syntax. It seems
it's just useless since we could make a function bar() which accepts
any charsets.

> I thought this question was the whole argument. We can't have something
> like the above with the pg overloading since then the resolving process
> will be too hard according to Tom.
>
> > 2) make shared tables such as pg_database and pg_shadow can handle
> > multiple charsets. this is necessary because database names and
> > user names could be repsented in different charsets
>
> Shouldn't we just define the charset for user names and database names?
> Either one fixed or one that's set during initdb. You don't mean that we
> want different user numes to be defined using different charsets?

What I have in my mind was:

CREATE DATABASE foo CHARSET bar;

If we allow this, we need 2).

> The rest of the points looks good to me. The main problem is still what to
> do with the function definitions as above. Is it something we want or not?
>
> Is the charset something that makes two text types different or not?

I understand your point. If we are going to allow that, probably we
have to regard each text type distinct which has different charset or
collation each other. This will lead to
number-of-types-explosion-problem which I really want to avoid...
--
Tatsuo Ishii

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dennis Bjorklund 2004-10-31 07:13:01 Re: Charset/collate support and function parameters
Previous Message Tom Lane 2004-10-31 06:38:25 Re: not null partial index?