79730684

Date: 2025-08-09 14:51:08
Score: 1
Natty:
Report link

Store in three separate columns; it's much better for maintenance and data retrieval (note that they are three very distinct pieces of data, so putting them together will make your life harder).

If you want to have an easy way to always have the [Country ISO]-[State ISO]-[City Name] string in hand, you can create an additional generated column.
Example (Postgres):
beautified_code varchar GENERATED ALWAYS AS CONCAT_WS('-', country_iso, state_iso, city_name) STORED

In this column, the three values will always be concatenated together automatically during entry creation and update. So you don't need to worry about maintaining consistency in it.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Shimada_R.