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 1ufkuZ-00BKWe-R6 for pgsql-general@arkaria.postgresql.org; Sat, 26 Jul 2025 19:50:28 +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 1ufkuX-00BlV2-BB for pgsql-general@arkaria.postgresql.org; Sat, 26 Jul 2025 19:50:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ufkuW-00BlUs-Rs for pgsql-general@lists.postgresql.org; Sat, 26 Jul 2025 19:50:25 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ufkuU-000vcm-2X for pgsql-general@lists.postgresql.org; Sat, 26 Jul 2025 19:50:23 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4561607166aso23178375e9.2 for ; Sat, 26 Jul 2025 12:50:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1753559421; x=1754164221; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=STn6K1zyOPUfQxzlCyp2XAGek8tmJLQPJPcm5xjprwM=; b=QfuNUlwz4zOH42VYZ4jQMI7BIF317r74+c1LCBciD65y+lh+iWLsxiCIeuDU8omHLE XGvNToCGRAZLO3rxGi0q4eFnUpnkf7hdpozMyKC0a1TPiHTvfsTW3McZAKSW1HlC38c2 OhK4Q8jtFiigGsoL2lsFi/a+mQxNMEJlRsD2cK2yv8C8wKn25mA6qIxrcc1dxbDBJAWW Xz4cug0uvboTKcAxbEWdXZEfaBH/dxlCgilZ5e03kSxV7zW4Gs4lx8Z3Nop8SZRg5Dyj 1P8O6KOgQP96/r0FsnqQCWPrEjgVUm3zpwRip8jM9SB0Z/WOWan3BIij+B73KY0biERB aEqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753559421; x=1754164221; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=STn6K1zyOPUfQxzlCyp2XAGek8tmJLQPJPcm5xjprwM=; b=lRyy3MBnRCOqXwlOdyNLiAm2UdGi5Nlrf7OiSsC6akWvNInuaBGFyFStX9OutZmdMP 54rBi0ZShlvlaycHzFu0OglMkijcN36J/adMV6d+7r+u9eNezD6aTqwK16yIoXT9buzG xB3YffnBeHA/dwCUuVQptweebvuvv0mbXzGwidIkOEMrv3P9sEoQ1bz7UtlmaHcnpvGK eaaXOLBa1CXyL9onC9t+3EaSn4bivo2pL74TvHHoNuv+ldUKyD9wssZTa2GokqYij0+z kkhdc5tQ6jwlHc8F8ugUSAh4L2+QroPWQRaW5Ff7G0qZ2zX3sle/iW+Q+PEl7Oz+B554 9N5w== X-Forwarded-Encrypted: i=1; AJvYcCVHrsOkNNe21EAbc6u/WZTtMS7wnPdywYht0gXy0+KfyuMrjtfd9J9fHDrTYZHVxG5YWdJJ02Bq87j4wA3V@lists.postgresql.org X-Gm-Message-State: AOJu0YyaKziGYP+u/47wkH6Rc0IyY35nHwuxgAY+1rJk11eS9zvWza65 ZMBfd6577QUQG8UY4pC6sWdIjFp0Ptg6UUDYepqtTg1YLDFy2a4ibWQVETUKcIcljNM= X-Gm-Gg: ASbGncvGKBXU4NcAQmKDBPNp8szdVcG+lbyowBKA4m5eC0X4lqxz+iWkiJPjs+8QbIH koi6keht0EPLtQ13nEiqaLqOs4+5k6BFBDUFvNLpdU6jHjBdTMTOBd0ZsgEzBg4RGMBuaMthUgL vqQgNYjcn3Ei9SjJzuVTRnMvqK+vDjU9Y8uuhac4ReF8OR/Iao5c/reBypNWBNSL0LZmaXBdLcq qTGGRnXDEZVZpac6btxwIKKWYElMVT0CVBvK4R95PYLv24oogVAOVUde3PehBGW5+YN1iR9spW1 Pb2SRKUBngE7+JRZ1QkVu5EXZQKZQgrS9vimaOkrHhtt7+ES4QEZOYfyIHhA0zGh1gy6j7Y5pTu vkRHjPW2WWK5KV7thYc/y3/IUsIxbu1XlVmCpntd6YsDZVFoF/lA= X-Google-Smtp-Source: AGHT+IGTPrSF7ppAb7iyNITSo1HfOzmsce+cWDUKD7XhR0lfm/aa1rEFWRKyE4toQfiVPSbU8U96hg== X-Received: by 2002:a05:600c:34cb:b0:43c:ec4c:25b4 with SMTP id 5b1f17b1804b1-4587631278dmr65276075e9.10.1753559421010; Sat, 26 Jul 2025 12:50:21 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:255:ce84:8917:ad95:e45:f3d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b778eb27f8sm3698839f8f.16.2025.07.26.12.50.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Jul 2025 12:50:20 -0700 (PDT) Message-ID: Subject: Re: Get info about the index From: Laurenz Albe To: Igor Korot , Christophe Pettus Cc: Adrian Klaver , "pgsql-generallists.postgresql.org" Date: Sat, 26 Jul 2025 21:50:20 +0200 In-Reply-To: References: <090d8588-e74e-4436-8f69-05ce8624379b@aklaver.com> <0BC8BEBF-3B1F-4E69-A1B9-CCCDF9617168@thebuild.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-1.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, 2025-07-26 at 15:13 -0400, Igor Korot wrote: > On Sat, Jul 26, 2025, 2:14=E2=80=AFPM Christophe Pettus wrote: > > > I want to know all individual things: > > > - whether the index is unique. > > > - what type of index it is > > > - whether the field is ASC or DESC. > > > - all other individual arams > >=20 > > pg_index is the source for those.=C2=A0 The one exception is the access= method for the index, which is in pg_class. >=20 > I didn't find the sorting for the field. That's in pg_index.indoption. The flags stored there are defined in src/include/catalog/pg_index.h /* * Index AMs that support ordered scans must support these two indoption * bits. Otherwise, the content of the per-column indoption fields is * open for future definition. */ #define INDOPTION_DESC 0x0001 /* values are in reverse order */ #define INDOPTION_NULLS_FIRST 0x0002 /* NULLs are first instead of last = */ So a value of 3 would mean DESC NULLS FIRST. Yours, Laurenz Albe