From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Manish Singh <manish.singh@india.corelynx.com>
To: pgsql-bugs@lists.postgresql.org
Subject: Re: PostgreSQL appears to truncate column alias names after 31 characters.
Date: Tue, 01 Oct 2024 10:40:46 +0200
Message-ID: <443cd7906ebe9a96b2f635b4dc33fa93534978dd.camel@cybertec.at> (raw)
In-Reply-To: <1158363234.5085080.1727766363469.JavaMail.zimbra@india.corelynx.com>
References: <1158363234.5085080.1727766363469.JavaMail.zimbra@india.corelynx.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: laurenz.albe@cybertec.at, manish.singh@india.corelynx.com, pgsql-bugs@lists.postgresql.org
Subject: Re: PostgreSQL appears to truncate column alias names after 31 characters.
In-Reply-To: <443cd7906ebe9a96b2f635b4dc33fa93534978dd.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox