Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5cSZ-00032U-NW for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Sep 2018 20:00:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5cSY-00089q-0Q for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Sep 2018 20:00:26 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5cSX-00089Y-Gv for pgsql-hackers@lists.postgresql.org; Thu, 27 Sep 2018 20:00:25 +0000 Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g5cSU-00007H-Up for pgsql-hackers@postgresql.org; Thu, 27 Sep 2018 20:00:24 +0000 Received: by mail-io1-xd30.google.com with SMTP id n18-v6so2770650ioa.9 for ; Thu, 27 Sep 2018 13:00:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=Wq/qVizSqYaIAtbh2pIdNmo69HsbbL0vYjrzN2OA8uE=; b=ezzfM4HZaKzNR3idlai8uHn6rXlTQS+iy5vIGEGXa9O2g5ZMfvyrp2SZdXusdGpa7Z 9+phs5x1coClbrK4hjE/SCiOLp6cUFO8P91fmo5uAZJvW9vgceu42q1i2aSNSnHmb0ac OrOVq8S4GO338xQCCf/yUrmzaMIXf8m0Pa6iaifGguJW4QuUMzWheBura9uc3aPLdclT tctJON8D0jQ0NQ/OCB2qgHytxtFhI+Z39UMRptHgS2+FCjr63sqzK7tK2vqcV16DGtcI /wMn1c7alzzBVzXIQ6gqI4p5aB6aT0CqxIziW8aoM7jfBplG6cOsgrS13YggkHXhU9dO qzhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=Wq/qVizSqYaIAtbh2pIdNmo69HsbbL0vYjrzN2OA8uE=; b=I4rgqSJ7MaL7paLs56FgQg9RQqpcrruxyFxn0Bf/bDTehGnC30F8lDpo/zaaBP1HYx kn578u5C69s0d3sQAvcbTMxb67lKEUNJ7dzLp8jGtyhwnR+17QOz6pF8Jo1lxuGP+2Al HYZpyqZET1nF2d43CP6F/SjgdlGYlCT2V2Epuh89z1y+0RSg4WqOjb0JOufTC+rHRwnw Ey1R33FF4qcyVZzX+TO01DrVll/Yy0NFzpIfIVbqQOyK45XUYE+uA8kmO1zxUm3+C/Ce NDNrXswX5K5iudS9xLUOiI+mxZYZQEIlbUAsxR4Ilv+Zp0Lu8IyQ57C7zDctQumlRTm3 5RJA== X-Gm-Message-State: ABuFfohXpBKlkHq17HN+WgVdgLUsoTV6KYEEzIQRDylrbel883Q6rCrP IJw6w24wgWE+cZr/UmDpKDo0VnUAM3A= X-Google-Smtp-Source: ACcGV63FjiLTn2rCUvs6V3LXk4GNEBzgD+qdFP1Binwf+VYQz4oDe7wPcDPKt8iGXQ4w4CcOzKCy2w== X-Received: by 2002:a6b:b583:: with SMTP id e125-v6mr9847612iof.201.1538078422241; Thu, 27 Sep 2018 13:00:22 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id z2-v6sm970694iob.72.2018.09.27.13.00.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Sep 2018 13:00:21 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id D0ECF805397; Thu, 27 Sep 2018 15:00:20 -0500 (CDT) Date: Thu, 27 Sep 2018 15:00:20 -0500 From: Justin Pryzby To: pgsql-hackers@postgresql.org Cc: Alvaro Herrera Subject: \d+ fails on index on partition Message-ID: <20180927200020.GJ776@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk For indices inherited from relkind=p: pryzbyj=# CREATE TABLE tt(i int)PARTITION BY RANGE(i); pryzbyj=# CREATE TABLE tt1 PARTITION OF tt DEFAULT; pryzbyj=# CREATE INDEX ON tt((0+i)); pryzbyj=# ALTER INDEX tt1_expr_idx ALTER COLUMN 1 SET STATISTICS 123; pryzbyj=# \d+ tt1_expr_idx ERROR: 42809: "tt1_expr_idx" is an index LOCATION: heap_open, heapam.c:1305 Failing due to: ********* QUERY ********** SELECT inhparent::pg_catalog.regclass, pg_catalog.pg_get_expr(c.relpartbound, inhrelid), pg_catalog.pg_get_partition_constraintdef(inhrelid) FROM pg_catalog.pg_class c JOIN pg_catalog.pg_inherits i ON c.oid = inhrelid WHERE c.oid = '40129092' AND c.relispartition; ************************** pg_get_partition_constraintdef() doesn't like being passed a relkind='I', "ATTACH"ed index, which I guess is included in pg_inherit (commit 8b08f7d48): pryzbyj=# SELECT inhparent::regclass, inhrelid::regclass, * FROM pg_inherits WHERE inhrelid='tt1_expr_idx'::regclass; inhparent | tt_expr_idx inhrelid | tt1_expr_idx inhrelid | 40129092 inhparent | 40129091 inhseqno | 1 I'll spare you the burden of any fix I might attempt to cobble together. Justin