Re: connecting multiple INSERT CTEs to same record?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: connecting multiple INSERT CTEs to same record?
Дата
Msg-id CAKFQuwatrODxE48RrZkvxia3Jb9YyDsobpVME7FzPfhB1SL4HQ@mail.gmail.com
обсуждение исходный текст
Ответ на connecting multiple INSERT CTEs to same record?  (Assaf Gordon <assafgordon@gmail.com>)
Ответы Re: connecting multiple INSERT CTEs to same record?  (Assaf Gordon <assafgordon@gmail.com>)
Список pgsql-general
On Tuesday, October 19, 2021, Assaf Gordon <assafgordon@gmail.com> wrote:

Sadly, I can't assume the student name is unique, so I can't "join" on it.


Instead of assigning a unique identifier to student after inserting it into the table, assign the identifier first.  Generally this is done by using “nextval()” explicitly in a manner similar to how it is used when computing the default for the serial column.  Then you can return/join on the identifier reliably and not worry about duplicate student names.

David J.

В списке pgsql-general по дате отправления:

Предыдущее
От: Bryn Llewellyn
Дата:
Сообщение: Re: Where is the tsrange() function documented?
Следующее
От: Kristjan Mustkivi
Дата:
Сообщение: How to rename in-use logical replication publication?