Re: ALTERING COLLATION - Mailing list pgsql-sql

From Tom Lane
Subject Re: ALTERING COLLATION
Date
Msg-id 2269504.1640879908@sss.pgh.pa.us
Whole thread Raw
In response to ALTERING COLLATION  (aditya desai <admad123@gmail.com>)
List pgsql-sql
aditya desai <admad123@gmail.com> writes:
> I had to alter COLLATION of one of the table column as shown below due to
> business requirements.
> alter TABLE workflow alter status_id  TYPE character varying(10) COLLATE "C"
> Is there any way to do this at server level?

Where's the problem?

test=# create table workflow(status_id character varying(10) collate "en_US");
CREATE TABLE
test=# \d workflow
                      Table "public.workflow"
  Column   |         Type          | Collation | Nullable | Default
-----------+-----------------------+-----------+----------+---------
 status_id | character varying(10) | en_US     |          |

test=# alter TABLE workflow alter status_id  TYPE character varying(10) COLLATE "C";
ALTER TABLE
test=# \d workflow
                      Table "public.workflow"
  Column   |         Type          | Collation | Nullable | Default
-----------+-----------------------+-----------+----------+---------
 status_id | character varying(10) | C         |          |


            regards, tom lane



pgsql-sql by date:

Previous
From: aditya desai
Date:
Subject: ALTERING COLLATION
Next
From: Richard Klingler
Date:
Subject: Return product category with hierarchical info