Column name beginning with underscore ("_")? - Mailing list pgsql-general

From Jim Rosenberg
Subject Column name beginning with underscore ("_")?
Date
Msg-id 20241104150203.f808f1e63e67dddcd3204d29@amanue.com
Whole thread Raw
Responses Re: Column name beginning with underscore ("_")?
Re: Column name beginning with underscore ("_")?
List pgsql-general
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?



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Why not do distinct before SetOp
Next
From: Tom Lane
Date:
Subject: Re: Column name beginning with underscore ("_")?