如何将几何数据从一个 table 中取出到另一个?

How to get the geometry data out of one table into another?

我对我想在两个 table 之间进行的联接有疑问。我有一个 table,其中没有我需要的另一个 table 的几何数据。有没有一种简单的方法可以在我的另一个 table?

中获取该数据

Thnx

UPDATE syntax是:

[ WITH [ RECURSIVE ] with_query [, ...] ]
UPDATE [ ONLY ] table [ [ AS ] alias ]
    SET { column = { expression | DEFAULT } |
          ( column [, ...] ) = ( { expression | DEFAULT } [, ...] ) } [, ...]
    [ FROM from_list ]
    [ WHERE condition | WHERE CURRENT OF cursor_name ]
    [ RETURNING * | output_expression [ [ AS ] output_name ] [, ...] ]
UPDATE TableB AS B
SET geom = A.geom
FROM TableA AS A
WHERE B.join_id = A.id 

注意

我在 TableB 上没有看到第 geom 列,因此您可能需要先创建该列

ALTER TABLE TableB ADD COLUMN geom geometry;