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 1g7SQ3-0001e3-DG for pgsql-general@arkaria.postgresql.org; Tue, 02 Oct 2018 21:41: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 1g7SPz-0007fT-43 for pgsql-general@arkaria.postgresql.org; Tue, 02 Oct 2018 21:41:23 +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 1g7SPy-0007fL-OQ for pgsql-general@lists.postgresql.org; Tue, 02 Oct 2018 21:41:22 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g7SPv-0006Tv-TF for pgsql-general@lists.postgresql.org; Tue, 02 Oct 2018 21:41:21 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 6029E21C89; Tue, 2 Oct 2018 17:41:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 02 Oct 2018 17:41:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=JMSx9y+/xwWAFtK4yo/x8hhlSWvyl ymS01p1bGcUhHA=; b=q8FPfpBUHTXTbIJISR9jS5qZDNDbOQPgkJAjXwcMsRXhP yWjbKRgua4G+zDrKztW5gUHZw1VuSiQUyIwq2vE6EhPWcRrlo0wyPb9x25zfSuKU F/JYlJ1ZjxYZFViRGrDdMsmlvMbAj2IOusWRfyA7bFcfwILibnRIBFc3XwgQkzmb A9BddZ6P7OvyBUThFS+yThsw6YlqWMBu2+7IGDVGHpAnltWx1BzTzbigwp4UDUam 8chCSwwi4FDVIx9G60d/VavEYpfIyOKzf7mXaTByXVzotJrf2ithQgACnd93NWzx E5pyS4d7wDj7fKjd2EUsfLNAye7cbzQk+RWS58seQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=JMSx9y +/xwWAFtK4yo/x8hhlSWvylymS01p1bGcUhHA=; b=m2Dqeau0UXr1btwf0bnsfr 8R5UnB9xgKQpFL0XZchMx44puwe1Vf1B11NaSjLmAXbDp6WplJ+rwqt5letw5OV3 3BKFji8myAgvEIWgEhiFgqIjneHt7FfhrY9OHQ9zo/mYA89A9s0ZOg6/1cqSLWJC E03ZUKBnyZdlkUmdzd3CPNxvrlQxH7B8eIGb90J9EJ8w7RfvqdEcoB5IL87jb2iT WHD7HG2VwLVFulz9LnLXEE2i916EbV0TzuNomh0PUEkBQrUt/5U2JblT+YFn9XLg Yg86071xRteOuml9JPoMLQfzOqlyJNYf4kCJtvmvJNCk73W3PMxl3ReKV1RDk/rA == X-ME-Sender: X-ME-Proxy: Received: from ranger.suse (c-73-239-117-238.hsd1.wa.comcast.net [73.239.117.238]) by mail.messagingengine.com (Postfix) with ESMTPA id 56DB8102DE; Tue, 2 Oct 2018 17:41:18 -0400 (EDT) Subject: Re: metadata about creation and size of tables To: Martin Mueller , "pgsql-general@lists.postgresql.org" References: From: Adrian Klaver Message-ID: Date: Tue, 2 Oct 2018 14:41:16 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 10/2/18 1:38 PM, Martin Mueller wrote: > I’ve looked at the documentation to find where to find some data that > are very to find Mysql:  the creation and modification data of a table > and the size of particular tables. > > Where do I find an answer to the question “which is the last table I > created” or “when did I last modify this table?”  In the data directory, Postgres does not track these times. You can search the list archives for past discussions on the pros and cons. > tables seem to have numbers, but there doesn’t seem to be an easy > mapping of those numbers to the table names. From: https://www.postgresql.org/docs/10/static/functions-admin.html#FUNCTIONS-ADMIN-DBOBJECT select pg_relation_filepath('id_test'), pg_relation_filenode('id_test'); pg_relation_filepath | pg_relation_filenode ----------------------+---------------------- base/733941/2976140 | 2976140 > > I thumbed through the documentation, but didn’t see any heading that was > likely to have that information.  Is there some where  a “table of > tables” that lets you look up various metadata? https://www.postgresql.org/docs/10/static/catalogs.html For tables in particular: https://www.postgresql.org/docs/10/static/catalog-pg-class.html There is also: https://www.postgresql.org/docs/10/static/information-schema.html And in psql there are the \ commands: https://www.postgresql.org/docs/10/static/app-psql.html In psql \? will get you a list of these with descriptions As an example: test_(aklaver)> \d id_test Table "public.id_test" Column | Type | Collation | Nullable | Default --------+-------------------+-----------+----------+------------------------------------- id | integer | | not null | nextval('id_test_id_seq'::regclass) fld_1 | character varying | | | fld_2 | boolean | | | test_(aklaver)> \d+ id_test Table "public.id_test" Column | Type | Collation | Nullable | Default | Storage | Stats target | Description --------+-------------------+-----------+----------+-------------------------------------+----------+--------------+------------- id | integer | | not null | nextval('id_test_id_seq'::regclass) | plain | | fld_1 | character varying | | | | extended | | fld_2 | boolean | | | | plain | | -- Adrian Klaver adrian.klaver@aklaver.com