Re: Assign User Defined DataType To Columns

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Assign User Defined DataType To Columns
Дата
Msg-id CAKFQuwYXZF7dnmOk2_EPx0aYx-ND8-iJeQG=ioyu24mfRiK-mg@mail.gmail.com
обсуждение исходный текст
Ответ на Assign User Defined DataType To Columns  (Phani Prathyush Somayajula <phani.somayajula@pragmaticplay.com>)
Список pgsql-admin
On Wed, Aug 2, 2023 at 9:24 AM Phani Prathyush Somayajula <phani.somayajula@pragmaticplay.com> wrote:

Hi All,

 

I’ve a user defined data type as :

CREATE TYPE uibackend."_operation" (


If you find yourself writing user-space code that uses "_{data type}" you are doing something wrong.  That implementation detail is not something that is exposed to the user.  If you want to deal with arrays of a type you say:  {data type}[]

So casting some random text column to an array of operation is simply:

operation_text_col::operation[]

And you can get rid of the above CREATE TYPE command altogether.

David J.

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

Предыдущее
От: Phani Prathyush Somayajula
Дата:
Сообщение: Assign User Defined DataType To Columns
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Assign User Defined DataType To Columns