DB: Postgres11 For the first time I am designing a database. Is it possible in insert-e to create a column that will concatenate the values ​​of other columns for a row, or is it better to write a script to form the request body?

  • one
    And why do we need a column that collects the values ​​of other columns? Any information in the database should be stored in a single copy and there should be no dependencies of some columns on others - Mike
  • You need to concatenate in the request or in the application logic. The second is preferable. - Alexey M.
  • For the formation of a unique identifier. In short, the essence is this: there is a client id, article id. I would like to link them in order to form a primary key from them. A couple of years ago I was a consultant for a single project, which included the same concept. I do not dare to say how correct this is, but then the idea seemed convenient. - fedorov.evgeny
  • one
    Then you should not bathe and make the primary key of two fields, here is the primary key(id_client, id_articul) - Mike
  • @mike, but in this case there will be two primary key columns, but I would like to get exactly one column in which the data is concatenated - fedorov.evgeny 8:50 pm

0