Re: BUG #6214: can't change Column COLLATE

Lists: pgsql-bugs
From: "yulin liu" <e9320(dot)tw(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6214: can't change Column COLLATE
Date: 2011-09-19 06:47:28
Message-ID: 201109190647.p8J6lSTU035042@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 6214
Logged by: yulin liu
Email address: e9320(dot)tw(at)gmail(dot)com
PostgreSQL version: PostgreSQL 9.1
Operating system: CentOS release 5.4
Description: can't change Column COLLATE
Details:

can't change Column COLLATE pg_catalog."default" to pg_catalog."zh_TW.euctw"


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "yulin liu" <e9320(dot)tw(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6214: can't change Column COLLATE
Date: 2011-09-19 15:58:29
Message-ID: 18103.1316447909@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

"yulin liu" <e9320(dot)tw(at)gmail(dot)com> writes:
> can't change Column COLLATE pg_catalog."default" to pg_catalog."zh_TW.euctw"

Use ALTER TABLE ... ALTER COLUMN ... TYPE ... COLLATE ...

regards, tom lane


From: 小豕 <e9320(dot)tw(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6214: can't change Column COLLATE
Date: 2011-09-20 01:29:08
Message-ID: CAD7ESE3JhFdMDUtK_nG8oq7Mr_e0c7BYJd+utfwVfMvhhipX_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Use ALTER TABLE item ALTER COLUMN title TYPE character varying(2000)
COLLATE pg_catalog."zh_TW.euctw";
but, SQL state: 42704 "UTF8" "pg_catalog.zh_TW.euctw" not found

2011/9/19 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>

> "yulin liu" <e9320(dot)tw(at)gmail(dot)com> writes:
> > can't change Column COLLATE pg_catalog."default" to
> pg_catalog."zh_TW.euctw"
>
> Use ALTER TABLE ... ALTER COLUMN ... TYPE ... COLLATE ...
>
> regards, tom lane
>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: 小豕 <e9320(dot)tw(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6214: can't change Column COLLATE
Date: 2011-09-20 04:32:17
Message-ID: 29054.1316493137@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

=?Big5?B?pHCoqA==?= <e9320(dot)tw(at)gmail(dot)com> writes:
> Use ALTER TABLE item ALTER COLUMN title TYPE character varying(2000)
> COLLATE pg_catalog."zh_TW.euctw";
> but, SQL state: 42704 "UTF8" "pg_catalog.zh_TW.euctw" not found

I hope that's not the exact phrasing of the error message ... but
what it's probably trying to tell you is that you can't use an EUC_TW
based locale in a database with UTF8 encoding. Try zh_TW.utf8.

regards, tom lane


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: 小豕 <e9320(dot)tw(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6214: can't change Column COLLATE
Date: 2011-09-20 05:58:57
Message-ID: 1316498337.9044.0.camel@fsopti579.F-Secure.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

On tis, 2011-09-20 at 00:32 -0400, Tom Lane wrote:
> =?Big5?B?pHCoqA==?= <e9320(dot)tw(at)gmail(dot)com> writes:
> > Use ALTER TABLE item ALTER COLUMN title TYPE character varying(2000)
> > COLLATE pg_catalog."zh_TW.euctw";
> > but, SQL state: 42704 "UTF8" "pg_catalog.zh_TW.euctw" not found
>
> I hope that's not the exact phrasing of the error message ... but
> what it's probably trying to tell you is that you can't use an EUC_TW
> based locale in a database with UTF8 encoding. Try zh_TW.utf8.

It's usually easier to just use COLLATE "zh_TW", and it will pick up the
right encoding.