Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oszvn-0008Ie-JU for pgsql-general@arkaria.postgresql.org; Thu, 10 Nov 2022 05:16:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oszvm-0000AB-E7 for pgsql-general@arkaria.postgresql.org; Thu, 10 Nov 2022 05:16:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oszvl-00006m-5o for pgsql-general@lists.postgresql.org; Thu, 10 Nov 2022 05:16:50 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oszvh-0006uB-7V for pgsql-general@lists.postgresql.org; Thu, 10 Nov 2022 05:16:48 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id BF5C83200904; Thu, 10 Nov 2022 00:16:42 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 10 Nov 2022 00:16:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1668057402; x= 1668143802; bh=+R9l14kfy1XZI6Pu1/6RJDuMW0/DfvXP27eJ4+ruG7Y=; b=z SfCAFs1vXvgIQlg9TDtfRdrnnRa1n0zDNHDXqbBoyFpqQH8hB0KJl5Ml56o9UcEY LSxmN+8xOMvYzyKx4pRslwOHKf1Fivk4P4wKFLpJWH5anV+OJVwPDawFYaK1Xlsg 6gNfSQHRgbT9Tcdk0sziVwygeKQLqmmX199RZNHCiucUHQQHbOQ5VC1UV/58q1fL 4KCM0RvDw6z2LlcX3Xe0mKKPcr/RSQKnczFowWOAgGQbP2TZBlJcIb7cjo8KxVg7 FMUsK4ffLsa5ZxTO+VUTEXZfCIrQXROphw8HgQ37hLzcFrKuT1JTNOd0NfKHo/In FU1XvTf/0WPsTRCtEteLA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1668057402; x= 1668143802; bh=+R9l14kfy1XZI6Pu1/6RJDuMW0/DfvXP27eJ4+ruG7Y=; b=C U3I9jaPH3LJsn+0vrtxZ+UTfPOrCPHoryU5Hp07kEPqWR5RvgZitw3HJKGzqQDAC IjMH3Sp+lAomNBQa43v6MTuNdQS+BOBtKcvCuGzDS+iNwlYpPUiv3/43K9kXloP6 7KMEuD5m3oqpofS4a05ctU/ZkYZC1Ruy62Sc+d9TghweCM1bLvWSn1Y3SLyBgus2 kq8VhHzB+Ff/P26TekdIEHWVVOYf6B2dV9W40eug7tcX8IidocPxrEnw2zyCIcCt 4gdBVttemaWGO48JcoOZn+2dnvBy6mUfEIRS4D1hG2ryPDpe9aOT+f5F7rzL+H3Q NwhfKLQmyaWGGsFtN49JA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrfeefgdekvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeelfffgjeeuvdfgffdvleefudduteevieefudehtddt tdeghedugfehgeefheeugeenucffohhmrghinheptghhrghrthhiohdrtghomhdpphhosh htghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 10 Nov 2022 00:16:41 -0500 (EST) Message-ID: <70f8bec0-ff5e-1c9b-b8a4-c0bdf56a4cbb@aklaver.com> Date: Wed, 9 Nov 2022 21:16:40 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: List user databases To: Ian Lawrence Barwick , Igor Korot Cc: "pgsql-generallists.postgresql.org" References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/9/22 20:57, Ian Lawrence Barwick wrote: > 2022年11月10日(木) 13:41 Igor Korot : >> >> Hi, ALL, >> According to https://chartio.com/resources/tutorials/how-to-list-databases-and-tables-in-postgresql-using-psql/, >> there are generally 3 system DBs. >> >> However I'm confused with the word general. >> How many system databases can be made on a PG server? > > template0 and template1 are the mandatory system databases which > cannot be dropped. Actually that is not strictly true: https://www.postgresql.org/docs/current/manage-ag-templatedbs.html " Note template1 and template0 do not have any special status beyond the fact that the name template1 is the default source database name for CREATE DATABASE. For example, one could drop template1 and recreate it from template0 without any ill effects. This course of action might be advisable if one has carelessly added a bunch of junk in template1. (To delete template1, it must have pg_database.datistemplate = false.) The postgres database is also created when a database cluster is initialized. This database is meant as a default database for users and applications to connect to. It is simply a copy of template1 and can be dropped and recreated if necessary. " > > "postgres" is created by default for operational convenience, but is > not essential and can > be removed if you really want to. > > Regards > > Ian Barwick > > -- Adrian Klaver adrian.klaver@aklaver.com