Re: How to properly use TRIM()?

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Igor Korot <ikorot01(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: How to properly use TRIM()?
Date: 2026-03-07 15:44:30
Message-ID: fb0589a1-701f-4447-9c49-7001e14e09a5@aklaver.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 3/7/26 12:11 AM, Igor Korot wrote:
> Hi, David,

>> You are asking the wrong question. The right question is “how does one turn an empty array into the null value?” Nullif is correct, you just need to specify an empty array (of the correct type) for the second argument.
>
> I don't think pg_class.reloptions is an ARRAY...

I think it is:

https://www.postgresql.org/docs/current/catalog-pg-class.html

reloptions text[]

> Included is one, storage is not.
>
> Thank you.
>
>>
>> Given that error message, an array of text is the correct type.
>>
>> Array[]::text[]
>>
>> David J.
>>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Igor Korot 2026-03-07 19:13:42 Re: How to properly use TRIM()?
Previous Message David G. Johnston 2026-03-07 14:29:48 Re: How to properly use TRIM()?