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.96) (envelope-from ) id 1vyx7n-000ZCu-0z for pgsql-general@arkaria.postgresql.org; Sat, 07 Mar 2026 19:15:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vyx7l-009G6T-2L for pgsql-general@arkaria.postgresql.org; Sat, 07 Mar 2026 19:15:42 +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.96) (envelope-from ) id 1vyx7l-009G6L-1F for pgsql-general@lists.postgresql.org; Sat, 07 Mar 2026 19:15:41 +0000 Received: from mail-yw1-x112f.google.com ([2607:f8b0:4864:20::112f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vyx7j-00000001Nsx-2Wv5 for pgsql-general@lists.postgresql.org; Sat, 07 Mar 2026 19:15:41 +0000 Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-7985ce90542so100844157b3.0 for ; Sat, 07 Mar 2026 11:15:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772910938; cv=none; d=google.com; s=arc-20240605; b=SSH3jMT49LBa/B7MmgoGDwO9J0B5M4Su9xMdYY2qwYQPSohQWCm50eWvp449p3HL7K Hv20SM8d0gGvTNeuQ/u3xt9Tv1UuvydrZWUqI1p4iK/tfj+QkmYwFUc1d4piVH/bD2hC WdA/bdEilh+MGtCEhGNuIsZMb311m77k8cDAicFvpAITKgOd44c5+ujKovmTQWtvLJU0 CrL1KPgOEwCD75QByue86CMCWlxvjxnCDwGuJoNPCJPly+aaeE/he3jRWo86b0D0mpK9 y52bBkozgeFpYVxs3D1QdsxwTNkHUFbdYcbWRyBccBm8ZYrbZadaBJSYtzy6YQ9ru85a ng3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=iMWliv4GWrLSFkePoQjB31QKCmc6OjttH3odZ5rksXk=; fh=kyAsYl77KsxRDd0MpChrI1Mi1G/EXxKHRVc31UaZmY8=; b=MpWVR3lHeS6x4gqu9a6k+WA9Q/gFM1usOkrAOXhdf5ATYFq5/efXZ4DW1VcWgIqBIN CoXv9c47y9p4UpFZNqLyjzMrh/I/Ph3hRtpBjx2thhm/tDiVJvZlb6xR8UwM4durBb/K sAdjKf9wSRglGo1rPLg4UFTVyuzmhDGHhQtBC/ttHbI36TzPEIqvHsaCCUjendPtQv5M UuRYTXM9ls1xpRjljUqQbFVk+A+OQT2MFw+X2Aj4tat54TeJlrTyV8l4ghV5HaBp5p8G pmNtqeTeajDsLzlXZmzGDsx5sI0bCldBNzeLn3RXOZYELVjMD4jD8xc7M67HupvwhQLs wXvQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772910938; x=1773515738; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=iMWliv4GWrLSFkePoQjB31QKCmc6OjttH3odZ5rksXk=; b=kuOsk1Gkwn9rPfmZYKmAI5Ps7TT0juJJvLh9OfzHbx0pQ0IWQChM5ovy7NB+qkDFyc RERGXgSa9MoWMZgtEXD/+s45LxzZqfLPQB6GaPy9cHPuUbzVftapHg6eJdtPCPMO5wTu JUmmmosmpGazMVPRiA+5h9LlTCWcnzRUh9Mk5VxKG8aoK5NnaH9H7C1706sU/v5MryIJ gPD9lN633An11W7JdY7AV+hk14T7XsF0UA3jvT+xEfpVtkgs6Z/WBXNPJay8kYBq0RyA w4542X+QCPwTbfAM9UYx6r2rd3tD3n4xKpD2oYS5wQ3GyD8CbEVF2/X6FovpLcKWF8hI msYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772910938; x=1773515738; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=iMWliv4GWrLSFkePoQjB31QKCmc6OjttH3odZ5rksXk=; b=P37F/atsTTQLB5QxJK45REw/jQQp2QgCmyparph9MgiS1X0KbriTtvsrSbOvh+gYEo JTV27TtzTFDxrh01YcztETYbWi7KeIpO+koq12ZJmcn6A1jOk9QjbJnzbFcxYcv/zwKo ucSWyl0Ppg2m0RTP/Q7vubJSz+sKruLVe9VmjBaQgTdCZm7W34rEMQEvjD81rpREPiMS GlkAcYAYTc3NZR0Mp42nQC1gLirZZWt6N0hKg1aSw3v/3fJlQoi0VGNwYB7GNDF/pfrh ErQIdsIWvqCm/GdHREJ0y7gHHMOvtmhpnKXGkaX4YKqrIe1cMlBnysaegoQMUGI9vVh/ Bpig== X-Gm-Message-State: AOJu0YymW9LRJfcNptXZM3cXblomTFvLoODd9Dn0DNuYU3JYcXwYf3d3 LDCo+O6WlXipDj3VCiLMw5upvll6kl3me/bzEVTZP6FJL0j3duvHjgdRTGMQxC390kgR6p1siVV 98mMzpfVqpfODgnMyRkPPVRNMfUhy+nI= X-Gm-Gg: ATEYQzxUnXCcdj2brk8UsRapVMyFR17Ripd9z2ALZH/CXaddwT4EPKruPnJ7Bu7CugB qhMih7wQ5yluvMfryX8GR6FT41kqlZ1CF4q2dA+gmWaOKll6IvENZt1OQMfjrAnCIiBa38JBY5R 4RlbmUVsEqv46bxDVDC2f1c2orOdQW87+yhtuqKbOzo2zjpekiu66NXzZJZ0PUt9tZ/nxsQv3mY jqq9GwjtLgH+YarGVxBNd4iFnw464KyPQz/QsOnlecubV1Rum4bWHBv/I6ddT0PU8E/+QyX+LV1 cFU9GRDIw//ZHA== X-Received: by 2002:a05:690c:e3ee:b0:797:b1d7:6aa0 with SMTP id 00721157ae682-798dd6aeb9emr62908927b3.3.1772910938529; Sat, 07 Mar 2026 11:15:38 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Igor Korot Date: Sat, 7 Mar 2026 11:15:27 -0800 X-Gm-Features: AaiRm53ZucqiXM7xlhdSZGact1NcJ8TF8X8gbWFgUBNx9cmL24EDGT1bdhWWt1U Message-ID: Subject: Re: How to properly use TRIM()? To: "David G. Johnston" Cc: "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000b5a29d064c73fefb" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000b5a29d064c73fefb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, David, On Fri, Mar 6, 2026 at 11:41=E2=80=AFPM David G. Johnston < david.g.johnston@gmail.com> wrote: > On Saturday, March 7, 2026, Igor Korot wrote: > >> >> included, NULLIF( TRIM( c.reloptions ), '' ) AS storage FROM pg_index >> idx, pg_class c, pg_namespace n, pg_class t, pg_indexes ixs WHERE >> ixs.indexname =3D c.relname AND c.oid =3D idx.indexrelid AND t.oid =3D >> idx.indrelid AND n.oid =3D c.relnamespace AND idx.indisprimary AND >> n.nspname =3D 'public' AND t.relname =3D 'leagues'; >> ERROR: function pg_catalog.btrim(text[]) does not exist >> LINE 1: ...num) OFFSET idx.indnkeyatts) AS included, NULLIF( TRIM( c.re.= .. >> > > > You are asking the wrong question. The right question is =E2=80=9Chow do= es one > turn an empty array into the null value?=E2=80=9D Nullif is correct, you= just need > to specify an empty array (of the correct type) for the second argument. > > Given that error message, an array of text is the correct type. > > Array[]::text[] > So what is the proper syntax? Thank you. > David J. > > --000000000000b5a29d064c73fefb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi, David,

On Fri, Mar 6, 2026 = at 11:41=E2=80=AFPM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Saturday, March 7, 2026, Igor Korot <ikorot01@gmail.com> wrot= e:

included, NULLIF( TRIM( c.reloptions ), '' ) AS storage FROM pg_ind= ex
idx, pg_class c, pg_namespace n, pg_class t, pg_indexes ixs WHERE
ixs.indexname =3D c.relname AND c.oid =3D idx.indexrelid AND t.oid =3D
idx.indrelid AND n.oid =3D c.relnamespace AND idx.indisprimary AND
n.nspname =3D 'public' AND t.relname =3D 'leagues';
ERROR:=C2=A0 function pg_catalog.btrim(text[]) does not exist
LINE 1: ...num) OFFSET idx.indnkeyatts) AS included, NULLIF( TRIM( c.re...<= br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0

You are asking the wrong question.= =C2=A0 The right question is =E2=80=9Chow does one turn an empty array into= the null value?=E2=80=9D =C2=A0Nullif is correct, you just need to specify= an empty array (of the correct type) for the second argument.
Given that error message, an array of text is the correct type= .

Array[]::text[]

So what is the proper syntax?

Thank you.

David J.

--000000000000b5a29d064c73fefb--