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.98.2) (envelope-from ) id 1xHkf7-00000003HOy-05hB for pgsql-bugs@arkaria.postgresql.org; Fri, 16 Oct 2026 16:20:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xHkf4-0000000FLJN-44wZ for pgsql-bugs@arkaria.postgresql.org; Fri, 16 Oct 2026 16:20:02 +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.98.2) (envelope-from ) id 1xHj2D-0000000Eg3n-33ia for pgsql-bugs@lists.postgresql.org; Fri, 16 Oct 2026 14:35:49 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1xHj2A-00000002V5I-3Orq for pgsql-bugs@lists.postgresql.org; Fri, 16 Oct 2026 14:35:49 +0000 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-c40e30c26a4so92417366b.0 for ; Fri, 16 Oct 2026 07:35:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=databricks.com; s=google; t=1792161345; x=1792766145; darn=lists.postgresql.org; h=to:date:message-id:subject:mime-version:content-transfer-encoding :content-type:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=iy0HU/1Ax15vmJg/ncNBXqGetnKn1jLlh8VhAP+OMjY=; b=UMpCqASrtoKMLor4ZuNmPiJeRb51Y54GBOl5/ejQnQPNX2aKbEVvX32PD+ag38RVVi 888Ogf/AMEwProXSQlp2aywJI6UtANolTRjq/j/pqvSb/bOmFDgmHwvSQpITkA8FoqO8 olb5so4kNPxZcoRW8y20ZvJoO1UuNfE7QPVIJ2NWCX9L7po58c2YqsrMeDec1PMjQANn n4MIiFfVhDIO2PmYkVwE/JJemC9Oq/VBNoR5KUFG6m7+/Jvko9u1Cfo+XL2ZCBIttlXx mRHdDEM9GCJg1oT0eW7VseBds2iOPkS3sTQDVRDBOAau+iuAItbklvvPOBovb2UuQ5hM 18bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792161345; x=1792766145; h=to:date:message-id:subject:mime-version:content-transfer-encoding :content-type:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=iy0HU/1Ax15vmJg/ncNBXqGetnKn1jLlh8VhAP+OMjY=; b=vnOK6ADVl1+eGkO6iqhArTIGZ7idy+NEGVpdcDOwXMHHmhTnA9qRSujnBFu/6wFJ8Y zsXllhwJF/MoXSl2Xrm31MWqV7th+3nrj0uSXl+U8GBDYjCe0WhT3WSyR6zM9BHfQBYf afLl+BcqZQRYhSq/O9jdBjTC06cFrHaAPJhvuMVzQET0Dtb0DJgrETZoypsnI8LLCG6r TYsRmpNe/XZ6LcGyWAZGK85wSxQH/7g9Ja0mbftv5EWZgOd4Py8r0H6qZmIhjmBkRFoX o9O7sQqf3L0WFlolH4/5KVReu3n5qaP4wBYLvZ1Lh6d5pxowYhqs+p2N1ZvP7cbxVhBS Pq+g== X-Gm-Message-State: AFq9FYI8TaxjiK0ACcxu/ufZobPjtY0I9XxN0EHQNgU7MfEoG5e4Cj5g y5LX+v/uMCPKgkwHfUexQFQ6bUs8m+TdVpuPwOnoLib0cKiD6eUNrj6jt1nl11wLiM0zEPja8Wa OSdUp8ro= X-Gm-Gg: AYBFou1Lv87bEVnPeCd2s4v30BKyY+rfZYPkTuLBqHgufaHUVulgRz2W3WXZntghRW0 tjkZ3Xo16QK/LBEAxX8xlxz2VnQ5YK3GG5VOyTPOdS2OA7fBpvvZNZrMPqQ1PgAOdyV8dEoBwKF 1FVvQaozGknFWcW25wfXN3mVGqa2ty920B5YMYJLUPYnRNeCP2v82SZsjQSLaidxCYoZpbPSg/i 2EReaQbQM7nGQ9BVWt9Ve9E0eCcsjIs60NiQslEnkzNALmhnZZ1Va6gBIWFARtNdbzOWXsLL4Io vNxE+tBOZi/xv6CrLL6ncfgDW3B+BFqopFIVQ9GEzPwCwNr/yZ39emw3VIuuWHufxSyLLQLCFZb B947d2ozQ3k3BHM97UY/ZUaXGPu2KHu44jD8QwLSQwTbqg78KHxhuC/faY7n/c40P9dJH9LU2gB qzoZeV6W2abayCjvOCOMsHVA52Z2DhsZJqw9qkDGjhQsxXwJyrWHvNyJSs8OzF4D0Bw4tu3QWKC kNfoQVfsDYNi7t2PLdrJb5LNri+a0VzvJ1E X-Received: by 2002:a17:907:6d07:b0:c2d:c6e7:9e9a with SMTP id a640c23a62f3a-c401fa297bdmr289299766b.11.1792161345099; Fri, 16 Oct 2026 07:35:45 -0700 (PDT) Received: from smtpclient.apple ([75.125.237.176]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c40913c711asm74529766b.36.2026.10.16.07.35.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Oct 2026 07:35:44 -0700 (PDT) From: George MacKerron Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.700.51.1.3\)) Subject: Inconsistency in psql output with \d+x PATTERN Message-Id: Date: Fri, 16 Oct 2026 15:35:33 +0100 To: pgsql-bugs@lists.postgresql.org X-Mailer: Apple Mail (2.3864.700.51.1.3) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello. While working on https://github.com/neondatabase/psql-describe, I came = across what I think is minor bug in the output of psql=E2=80=99s `\d` = with a pattern or name. Using psql 19rc1, this command is not listed by `\?` as accepting the = expanded (x) option: ``` db=3D# \? ... Informational (options: S =3D show system objects, x =3D expanded mode, + =3D = additional detail) \d[Sx+] list tables, views, and sequences \d[S+] NAME describe table, view, sequence, or index ``` And, in general, setting the x option -- either globally with `\x on` or = temporarily with `\d+x PATTERN` -- is ignored. However, it is not ignored when describing sequences. For example: ``` db=3D# create table example_table (col int); CREATE TABLE db=3D# create sequence example_sequence; CREATE SEQUENCE db=3D# create index example_idx on example_table(col); CREATE INDEX db=3D# \d+x example_* Index "public.example_idx" Column | Type | Key? | Definition | Storage | Stats target=20 --------+---------+------+------------+---------+-------------- col | integer | yes | col | plain |=20 btree, for table "public.example_table" Sequence "public.example_sequence" -[ RECORD 1 ]------------------ Type | bigint Start | 1 Minimum | 1 Maximum | 9223372036854775807 Increment | 1 Cycles? | no Cache | 1 Table "public.example_table" Column | Type | Collation | Nullable | Default | Storage | = Compression | Stats target | Description=20 = --------+---------+-----------+----------+---------+---------+------------= -+--------------+------------- col | integer | | | | plain | = | |=20 Indexes: "example_idx" btree (col) Access method: heap ``` This inconsistency seems like a bug to me. Proximately, the bug appears to arise on line 1780 of = src/bin/psql/describe.c (REL_19_RC1), where a new, shadowing `myopt` = variable is created without setting `myopt.topt.expanded =3D false`. History: =E2=80=A2 In 2005, commit 3332e38189b2 disables expanded output for \d = NAME. =E2=80=A2 In 2017, commit 2a14b9609df1 redesigns sequence descriptions = as a separate query and (presumably unintentionally) bypasses that = disabling. =E2=80=A2 In 2025, commit 00f4c2959d6 adds the temporary x modifier. Its = regression test explicitly verifies that \d+x table remains = non-expanded, but does not test a sequence. All the best, George