Skip to content

Conventions

Following a set of database conventions improves the readability and understanding of the database and related SQL. Every DBA has their own thoughts about which convention to follow. This is ours, tailored for PostgreSQL.

Note: While we typically recommend PascalCase naming for Linx development (e.g., UpdateCustomer), this convention does not translate cleanly to PostgreSQL due to how it handles case sensitivity.
PostgreSQL folds unquoted identifiers to lowercase, which means using mixed or PascalCase requires quoting object names—leading to potentially cumbersome SQL and inconsistent tooling support.
Therefore, we encourage snake_case naming in PostgreSQL for practical and technical consistency.

  • Names must clearly describe the object.
  • Use snake_case for all object names in PostgreSQL.
  • Avoid Hungarian notation (e.g., int_number).
  • Avoid abbreviations unless they are widely recognized.
Applies ToConventionExample
Tablesnoun, singularcustomer
Stored Proceduresverb_nounupdate_customer
Viewsnouncustomer_orders
Fieldsnounsurname

You can use PascalCase object names in PostgreSQL if you quote them consistently in every SQL statement (e.g., "Customer").
However, this is discouraged as it leads to more verbose and error-prone SQL.

  • Use consistent indentation.
  • Use UPPERCASE for SQL keywords: SELECT, FROM, WHERE, JOIN, etc.
  • Use meaningful aliases—avoid single-letter or cryptic abbreviations.
  • Use single quotes ('string') for string literals.
  • Use double quotes ("identifier") only when necessary to refer to case-sensitive or reserved identifiers.