Search Postgresql Archives

Re: Update two tables returning id from insert CTE Query

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

 



On Tue, Sep 27, 2016 at 1:10 PM, Igor Neyman <ineyman@xxxxxxxxxxxxxx> wrote:

 

Patrick,

 

You need to explain your problems in more “coherent” way, David suggested one.

If you aren’t willing,  people will stop responding to your request, they are not obligated to read your mind.

 


​I'll put it this way - the only conclusion I can draw in reading the provided code is that the data model is screwed up and may not be capable of accommodating this goal.  Albeit this is based upon a incompletely specified model...

​If you want table1 and table2 to have a 1-to-1 relationship then the assignment of the unique key should not occur via next_val() calls in the default _expression_​ of either table.  When you query "not_monthly" you need to figure out what the new ID should be and explicitly add it to both INSERT statements.

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 Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux