Search Postgresql Archives

Re: connecting multiple INSERT CTEs to same record?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday, October 19, 2021, Assaf Gordon <assafgordon@xxxxxxxxx> 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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux