Re: Chante domain type - Postgres 9.2

Поиск
Список
Период
Сортировка
От Gavin Flower
Тема Re: Chante domain type - Postgres 9.2
Дата
Msg-id 30756de1-2e55-661f-c06e-42d48350a1b4@archidevsys.co.nz
обсуждение исходный текст
Ответ на Chante domain type - Postgres 9.2  (Patrick B <patrickbakerbr@gmail.com>)
Ответы Re: Chante domain type - Postgres 9.2  (Jan de Visser <jan@de-visser.net>)
Список pgsql-general
On 26/09/16 17:58, Patrick B wrote:
> Hi guys,
>
> I've got this domain:
>
>     CREATE DOMAIN public.a_city
>       AS character varying(80)
>       COLLATE pg_catalog."default";
>
>
> And I need to increase the type from character varying(80) to
> character varying(255).
>
> How can I do that? didn't find info about it. I'm using Postgres 9.2
>
> Thanks!
> Patrick

Why not simply use the 'text' data type?

To change the data type on a column you can use:
ALTER [ COLUMN ] /column_name/ [ SET DATA ] TYPE /data_type/ [ COLLATE
/collation/ ] [ USING /expression/ ]

see:
https://www.postgresql.org/docs/9.2/static/sql-altertable.html


Note that 9.5 is the latest version of pg, with 9.6 being released very soon!


Cheers,
Gavin



В списке pgsql-general по дате отправления:

Предыдущее
От: Patrick B
Дата:
Сообщение: Chante domain type - Postgres 9.2
Следующее
От: "Charles Clavadetscher"
Дата:
Сообщение: Re: Question on replace function [solved]