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 1t83H9-001iFG-4T for pgsql-general@arkaria.postgresql.org; Mon, 04 Nov 2024 20:02:10 +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 1t83H6-004iSL-7K for pgsql-general@arkaria.postgresql.org; Mon, 04 Nov 2024 20:02:08 +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 1t83H5-004iS8-SG for pgsql-general@lists.postgresql.org; Mon, 04 Nov 2024 20:02:08 +0000 Received: from vpn.realprodata.com ([66.207.131.16] helo=cglove.amanue.com) by makus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t83H3-000BP4-Dm for pgsql-general@postgresql.org; Mon, 04 Nov 2024 20:02:06 +0000 Received: by cglove.amanue.com (Postfix, from userid 1002) id 5A082CC07E; Mon, 4 Nov 2024 15:02:04 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on cglove.amanue.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_RECEIVED, NO_RELAYS autolearn=ham autolearn_force=no version=4.0.0 Date: Mon, 4 Nov 2024 15:02:03 -0500 From: Jim Rosenberg To: pgsql-general@postgresql.org Subject: Column name beginning with underscore ("_")? Message-Id: <20241104150203.f808f1e63e67dddcd3204d29@amanue.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Is it considered bad Postgresql practice to have a column name that begins with the underscore character ("_")? I'm not sure where this is documented, but I'm seeing that Postgresql accepts prepending an underscore to a data type name as a kind of alias for appending [] to define an array data type. So even though Postgresql doesn't seem to have this problem, a human reader might confuse a column name beginning with _ as an array data type reference. Here is why I want to have some column names beginning with "_". I'm designing a database to shadow a public agency's data. I need some columns that reflect *my* shadow copy of the data, (like say download date) that don't have any semantic import with respect to the original data. Beginning such columns with "_" is a simple way to keep the column names uncluttered but indicate to the reader that the column applies to *my copy* but are not columns in the original data. Comments?