Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qRTEk-001rWm-1L for pgadmin-hackers@arkaria.postgresql.org; Thu, 03 Aug 2023 07:59:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qRTDk-00BA1F-CD for pgadmin-hackers@arkaria.postgresql.org; Thu, 03 Aug 2023 07:58:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qREvs-006aE7-CH; Wed, 02 Aug 2023 16:42:44 +0000 Received: from mail-oa1-x2b.google.com ([2001:4860:4864:20::2b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qREvn-000Awk-Gr; Wed, 02 Aug 2023 16:42:44 +0000 Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-1bba7717d3bso5237170fac.1; Wed, 02 Aug 2023 09:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690994557; x=1691599357; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=zPvoIj7ccuU4PTlxxPd5efSJFLZnBzG7bsgXkn0YbDo=; b=a8CEATLiMkhnm898GsUDBAzsudW1/sTgaMIklWbsD/sw9hjTqHyruOew4dEPuHVy8q DLg7TVbKPprCkyi8KSvD8g6TxslTF+Ehcdt184dbCN2dWaYkLI4D+go/uL3agOXMlImq 9clNd6D71GaDwTq3s7ieBR/qhaJhIiWOpam+PxInJDIEv5n1zn3pYk5KdFzdX6TWIwZn OlwoKfc0GtJbKf8N3/FbhzPcGjSDXk7KQ0QRqXHbAoWNtZdGt31YYhZvQneKzZwCOIj+ zR5UgEHWAw2+rITzWBFfNxq17tPp9s0vq5TvEBZVLa+rEJK+lJr4RflbWvSJlakK6COs sksw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690994557; x=1691599357; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zPvoIj7ccuU4PTlxxPd5efSJFLZnBzG7bsgXkn0YbDo=; b=JsXcF6Q1VNbnWLLZIEe4+WuRuDRsXF3H+CD17pRqQae8pxFd0omCjTviyY6TZ6klum imcxIrRVsbissbifoqtQnixOQS2fmKy2SA2SkpqZveLUHvyJFGksiqG1+llOt8E2snnl rGOA/K9GqX3cV9HTd0Ycuvr8pZ4vyCjDA+IFojCtL46jl3eSi7kSjK4a9rasg04gXS6h 03ewmknZuC0YnTtwtCs8Y07vU6+CmBLMNi9DZL07/6lriC9y1TuQbPF/51QD+d9o3iVj w0WVSi7rq0X4LEOM7441lsCDeGUqAp7hldICa/b+dwF3EJpRejkgrkpFmoWiZHU5c3YM YYxQ== X-Gm-Message-State: ABy/qLYUi0t31GLCKCiCPt90SZzVTxHXU3Im5Ypm0HdfRXWbGi4tJgdw VpSoIby39mihQoQPBF9cLTUYQqDIDeRMNqJsV1M= X-Google-Smtp-Source: APBJJlHkEPaaKMHgoLcl0V45ElptemJa/TZPVVDyBR3nD/navyo74gX1SyaH1UE+RfpA6LmeyXNk70QZ+OdLkdsIRzQ= X-Received: by 2002:a05:6871:710:b0:1a2:7012:1ca7 with SMTP id f16-20020a056871071000b001a270121ca7mr19056359oap.19.1690994557502; Wed, 02 Aug 2023 09:42:37 -0700 (PDT) MIME-Version: 1.0 References: <155c25b62f6eab032138b93831ca4fe95158e059.camel@cybertec.at> In-Reply-To: From: "David G. Johnston" Date: Wed, 2 Aug 2023 09:42:20 -0700 Message-ID: Subject: Re: Assign User Defined DataType To Columns To: Phani Prathyush Somayajula Cc: Pgsql-admin , "pgadmin-hackers@postgresql.org" , pgAdmin Support Content-Type: multipart/alternative; boundary="000000000000eacb9b0601f359cb" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000eacb9b0601f359cb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Aug 2, 2023 at 9:24=E2=80=AFAM Phani Prathyush Somayajula < phani.somayajula@pragmaticplay.com> wrote: > Hi All, > > > > I=E2=80=99ve 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. --000000000000eacb9b0601f359cb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Aug 2, 2023 at 9:24=E2=80=AFAM Phani Prathyush Som= ayajula <phani.somayajula@pragmaticplay.com> wrote:
=

Hi All,

=C2=A0

I=E2=80=99ve a user defined data type as :

CREATE TYPE uibackend."_operation" (=


If you find yours= elf writing user-space code that uses "_{data type}" you are doin= g something wrong.=C2=A0 That implementation detail is not something that i= s exposed to the user.=C2=A0 If you want to deal with arrays of a type you = say:=C2=A0 {data type}[]

So casting some random text c= olumn to an array of operation is simply:

operation_te= xt_col::operation[]

And you can get rid of the above C= REATE TYPE command altogether.

David J.

--000000000000eacb9b0601f359cb--