Re: Weird issue with truncation of values in array with some tables - Mailing list pgsql-sql

From David G. Johnston
Subject Re: Weird issue with truncation of values in array with some tables
Date
Msg-id CAKFQuwaFeFtWRWe5AzbP5UD6UZD-i8KRCMuSjV-RS8CpTR38dw@mail.gmail.com
Whole thread Raw
In response to Weird issue with truncation of values in array with some tables  (Mike Martin <redtux1@gmail.com>)
List pgsql-sql
On Sun, Aug 16, 2020, 06:49 Mike Martin <redtux1@gmail.com> wrote:
Hi
I have come across a weird issue with truncation of text in an array (in this case using pg_indexes view)

This query truncates the second array element at 63 characters
SELECT ARRAY[indexname,indexdef] FROM pg_indexes

However reversing the order doesn't truncate

SELECT ARRAY[indexdef,indexname] FROM pg_indexes

Anyone know why this behaviour occurs?

It's likely related to the following:


The system uses no more than NAMEDATALEN-1 bytes of an identifier; longer names can be written in commands, but they will be truncated. By default, NAMEDATALEN is 64 so the maximum identifier length is 63 bytes.

David J.

pgsql-sql by date:

Previous
From: Mike Martin
Date:
Subject: Weird issue with truncation of values in array with some tables
Next
From: Tom Lane
Date:
Subject: Re: Weird issue with truncation of values in array with some tables