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 1qRF3w-0011JF-0R for pgsql-admin@arkaria.postgresql.org; Wed, 02 Aug 2023 16:51:04 +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 1qRF3u-006dWS-DZ for pgsql-admin@arkaria.postgresql.org; Wed, 02 Aug 2023 16:51:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qRF3t-006dWJ-Tt for pgsql-admin@lists.postgresql.org; Wed, 02 Aug 2023 16:51:02 +0000 Received: from mail-oo1-xc2f.google.com ([2607:f8b0:4864:20::c2f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qRF3r-000ADi-2C for pgsql-admin@lists.postgresql.org; Wed, 02 Aug 2023 16:51:01 +0000 Received: by mail-oo1-xc2f.google.com with SMTP id 006d021491bc7-56c7f47ec42so3915375eaf.2 for ; Wed, 02 Aug 2023 09:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690995058; x=1691599858; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=FKARMyTxdTxERKW1j1ienKAa/SwynQwKBcDKIYG2eiY=; b=DYQBB/ZOsvHSC5hR6+S6WDJ4cJbu3R7r8X/J6XDMKGSlpyLrSWdh//UYZDxDaVqDPl 5WJpnh9VKqjdVP5kpNMcMEx9KJta+7O4YIgu3Jf8x05I92Ve1vVpRtfomN7xrlvWynZU CGjXZDQzNEUtxbyEIJc04orksp3JAHMRECrqlEOaEUBSZj69Wiw2TjHapm+qacwdF4ym b3gc1ZaI6+eIntNGsOl7SxaxscCtiNU4bkbvo30bHLDVlQaS8EQue2mdGXaTifIbih49 niYJ1noBc6kHzILUQ49PKSgzPfHXD6mx4OOnF9CuO44I5LR5+euvohTxoEAz7g4FuKM6 V8fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690995058; x=1691599858; 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=FKARMyTxdTxERKW1j1ienKAa/SwynQwKBcDKIYG2eiY=; b=dY9l1Yc2qF2e+rhTtWkf89ZQYHXBVtAK8nA+A0aJJ7R++blgKL1hrVT+pXJ387F8K4 XZX7MeSmFFsoqKaTYx9X9haKUNdJhRe9Q4FfwdvnbqRdjqwYwRdeEevBr1l778ktUZAJ VLVXFl3UREphJqJHvgx+j7bs4MTHQ2y3TZSgUpr1XOUFZh16sgYz4YWbhIbMeGEXEWYo nUXp9xmJZPqTGc5s0SaL+EFYwt/5PlYVg5IsIaDE4aqubI4UFmSKjNkM0AU5IaDwKycs n73BvyAh3zpCmeF1Wt+XJFh4pGsG8tpwjeMiaqIRe2+Uaygmd5P844Vf2Img+Y4EzoGQ YBaw== X-Gm-Message-State: ABy/qLaQx9GLZ2LRfyHIx2w2vOhGokITZyw5Y8433afasl3LaKI0FNVd D3XMeucPC19ZN+sJB9FHyoFiplcbYzMmeUOIGM7CzRFIiAs= X-Google-Smtp-Source: APBJJlEziOExWHt4/0mSlddgvqvyhaz29UH7a4uXSRDOy+UPDdn6O6GsseOjIGwfiGOyxBFDaReqyOObzHCH81PWKYs= X-Received: by 2002:a4a:d2d0:0:b0:56c:e17e:72ab with SMTP id j16-20020a4ad2d0000000b0056ce17e72abmr6140563oos.2.1690995058225; Wed, 02 Aug 2023 09:50:58 -0700 (PDT) MIME-Version: 1.0 References: <155c25b62f6eab032138b93831ca4fe95158e059.camel@cybertec.at> In-Reply-To: From: "David G. Johnston" Date: Wed, 2 Aug 2023 09:50:41 -0700 Message-ID: Subject: Re: Assign User Defined DataType To Columns To: Phani Prathyush Somayajula Cc: Pgsql-admin Content-Type: multipart/alternative; boundary="000000000000c33f8b0601f37731" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000c33f8b0601f37731 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Seriously, you sent this to three lists at the same time? I'm surprised it came through moderation... Anyway, my response on the admin list is below - though none of the lists you picked were actually the appropriate one. You want the -general list. On Wed, Aug 2, 2023 at 9:42=E2=80=AFAM David G. Johnston wrote: > 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 y= ou > 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. > > --000000000000c33f8b0601f37731 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Seriously, you sent this to three list= s at the same time?=C2=A0 I'm surprised it came through moderation...

Anyway, my response on the admin list is below - though= none of the lists you picked were actually the appropriate one.=C2=A0 You = want the -general list.

On Wed, Aug 2, 2023 at 9:42=E2=80=AFAM David = G. Johnston <david.g.johns= ton@gmail.com> wrote:
On Wed, Aug 2, 2023 at 9:24=E2=80=AFAM Phani Prathyush Somayajula <= ;ph= ani.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 yourself writing user-space c= ode that uses "_{data type}" you are doing something wrong.=C2=A0= That implementation detail is not something that is 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 t= ext column to an array of operation is simply:

operation_text_col::operation[]

And you can get rid of the above CREATE TYPE comma= nd altogether.

David J.

--000000000000c33f8b0601f37731--