Re: Weird issue with truncation of values in array with some tables

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Weird issue with truncation of values in array with some tables
Дата
Msg-id CAKFQuwaFeFtWRWe5AzbP5UD6UZD-i8KRCMuSjV-RS8CpTR38dw@mail.gmail.com
обсуждение исходный текст
Ответ на Weird issue with truncation of values in array with some tables  (Mike Martin <redtux1@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Mike Martin
Дата:
Сообщение: Weird issue with truncation of values in array with some tables
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Weird issue with truncation of values in array with some tables