1

我有一个 Master_Vendors 表,其中包含供应商类型的外键。

e.g Master_vendor (Vendor_type e.g. Car, Hotel)
      |
      |_____CAR
      |      |
      |      |_____Car_model_Id(F.K.)
      |      |
      |      |_____Car_make_Id(F.K.)
      |      |
      |      |_____Car_owner(F.K.)
      |                 |
      |                 |___Employee_Id(F.K.)
      |                         |
      |                         |____Department_Id(F.K.)
      |______Hotel
             |
             |...so on (hotel type of vendor will have it's own details)

我有这么多外键要处理。如何以我可以从外键获取数据的方式制作 jsonb 结构。我不想针对每个外键创建外部表的整个结构。只想创建引用,它将从外部主表中获取数据。

4

0 回答 0