Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1svYR9-00FuuM-K0 for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Oct 2024 08:40:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1svYR8-00DL9T-TX for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Oct 2024 08:40:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1svYR8-00DL7m-Iw for pgsql-bugs@lists.postgresql.org; Tue, 01 Oct 2024 08:40:50 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1svYR4-001zAE-Kq for pgsql-bugs@lists.postgresql.org; Tue, 01 Oct 2024 08:40:49 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-42cae4eb026so50602015e9.0 for ; Tue, 01 Oct 2024 01:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=cybertec.at; t=1727772047; x=1728376847; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=LakcJ6A+s9IHvAtInRh2VQK8zo7vTbROPmUdclPAV9Q=; b=da0rtTq/MyJVctdr3g7y8hWTKbPnldXEnWmqOXC+nxYjfbt/BsajlZdlr2h4gUq3OE UVlcnk4hz+vcoSFihP4PZvlSAeNvXTBTH7U0VRio8n8isvYr/836S3/Ceg0EQhcYJlhJ LA3Yp5d/eyZgtb7Zec92aIXNP5RFC7ZDYDMrA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727772047; x=1728376847; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=LakcJ6A+s9IHvAtInRh2VQK8zo7vTbROPmUdclPAV9Q=; b=gv0auFDV1VLAL1iV5ag7XTLgkNhPchnRPZOu66O1Lmneu0SgODFCUMMar7PZ2WA/7V 7zkAfZ4eWpkInlX+t7JO97cJXCzepYh6hGU7NBpfA05eZJnpN94js2dPZIiG/vU+bciv 0JbeMTj+6axM2Lp37LxMtEdrsxOQ4MOvKqx8XaGiauQwLshoLVBq5zsU1Ay4Ob0gfSwf ijk2oXbFAKE48TaBUZedkzMrKc/n1anPXEdpKxD7GviCmsRLgSX3Q2rx9Bb+j7OXnJrO cHAl0MT+ZhG9PTqVcAKK0/P+aUScUpY4FM8vUkF9o9bNzRyjQDmVTWPNY0CwyyCrsJIR Xdjw== X-Forwarded-Encrypted: i=1; AJvYcCVseryR+wwleEK8yZFbm258Wu4z91LgD9rI0zOG6l9DGT3Ku/Vw6cVhO8ISJPmADXM1SZM/XYqFNBv2@lists.postgresql.org X-Gm-Message-State: AOJu0Yy32Mn9PQPg18qI9HCtIaJ4vpINjemoKxqjItFr5oD9OfAAtXTS 2at6DtDOIHJvFDEQasi9jNrndg+g9QGQeC8k8oyF6njn7ovw9rCbV3lH5I8mwaRnng1XNvXzxj7 K X-Google-Smtp-Source: AGHT+IFXe1dQhuEE7g+vGE2i0/UkP7am3Z+KytdcfKF9aQi71wdbWnlAQbHDEU0G/AyyOrm4oR805Q== X-Received: by 2002:a05:600c:45cb:b0:42c:b905:2bf9 with SMTP id 5b1f17b1804b1-42f5844aaf2mr123928875e9.16.1727772047050; Tue, 01 Oct 2024 01:40:47 -0700 (PDT) Received: from dynamic-pd01.res.v6.highway.a1.net ([2001:871:5e:1fcf:a04d:3862:f91c:eaac]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f57dec19bsm128772755e9.26.2024.10.01.01.40.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 01:40:46 -0700 (PDT) Message-ID: <443cd7906ebe9a96b2f635b4dc33fa93534978dd.camel@cybertec.at> Subject: Re: PostgreSQL appears to truncate column alias names after 31 characters. From: Laurenz Albe To: Manish Singh , pgsql-bugs@lists.postgresql.org Date: Tue, 01 Oct 2024 10:40:46 +0200 In-Reply-To: <1158363234.5085080.1727766363469.JavaMail.zimbra@india.corelynx.com> References: <1158363234.5085080.1727766363469.JavaMail.zimbra@india.corelynx.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.4 (3.52.4-1.fc40) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 t= runcate column alias names > after 31 characters. >=20 > For example (this is from the psql command-line tool): >=20 > SELECT rss_headline_id as abcdefghijklmno pqrstuvwxyz1234 56, title, url > FROM news_rss_headli nes headlines WHERE rss_headline_id =3D 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