agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: Tom Lane <tgl@sss.pgh.pa.us>
To: aditya desai <admad123@gmail.com>
Cc: pgsql-sql <pgsql-sql@lists.postgresql.org>
Subject: Re: ALTERING COLLATION
Date: Thu, 30 Dec 2021 10:58:28 -0500
Message-ID: <2269504.1640879908@sss.pgh.pa.us> (raw)
In-Reply-To: <CAN0SRDEC5bFObN0_U_PagctbYbi0iu-riXEZ3S1nzaQWiY1Ytg@mail.gmail.com>
References: <CAN0SRDEC5bFObN0_U_PagctbYbi0iu-riXEZ3S1nzaQWiY1Ytg@mail.gmail.com>
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
view thread (2+ messages)
Message-ID: <2269504.1640879908@sss.pgh.pa.us>
Permalink: ../2269504.1640879908@sss.pgh.pa.us/
Also on: postgresql.org/message-id/2269504.1640879908@sss.pgh.pa.us
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, admad123@gmail.com, pgsql-sql@lists.postgresql.org
Subject: Re: ALTERING COLLATION
In-Reply-To: <2269504.1640879908@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox