Re: PostgreSQL appears to truncate column alias names after 31 characters.

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Manish Singh <manish(dot)singh(at)india(dot)corelynx(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: PostgreSQL appears to truncate column alias names after 31 characters.
Date: 2024-10-01 08:40:46
Message-ID: 443cd7906ebe9a96b2f635b4dc33fa93534978dd.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, 2024-10-01 at 07:06 +0000, Manish Singh wrote:
> I am using pgsql with laravel.I have noticed that PostgreSQL appears to truncate column alias names
> after 31 characters.
>
> For example (this is from the psql command-line tool):
>
> SELECT rss_headline_id as abcdefghijklmno pqrstuvwxyz1234 56, title, url
> FROM news_rss_headli nes headlines WHERE rss_headline_id = 22833;
> NOTICE: identifier "abcdefghijklmn opqrstuvwxyz123 456" will be
> truncated to "abcdefghijklmn opqrstuvwxyz123 45"

I cannot reproduce that.
Unless you modify the source, identifiers will be cut off after 63 bytes
(NAMEDATALEN - 1; one byte is for the terminating zero byte).

Did you modify the source?
Also, the spaces in your identifier should cause a syntax error.
Can you explain why you don't get such an error?

Yours,
Laurenz Albe

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Takeshi Ideriha 2024-10-01 13:37:47 Re: BUG #18641: Logical decoding of two-phase commit fails with TOASTed default values
Previous Message PG Bug reporting form 2024-10-01 07:47:34 BUG #18643: EXPLAIN estimated rows mismatch