带有postgis的dblink postgresql中的linestring不起作用

我正在尝试使用postgis函数进行dblink,但是线串给了我很多问题.

SELECT 
    DV3."XXX",
        s."QQQID",s."X",s."Y",a."PPP"
FROM 
    "QQQ" s INNER JOIN "AAA" a ON a."QQQID" = s."QQQID",
    dblink('dbname=ZZZ',
        'SELECT XXX,the_geom 
        FROM "geometry", "QQQ" s 
        WHERE box2d(geomfromtext(''LINESTRING('|| s."X" ||' '||s."Y" ||','|| s."X" || ' '||s."Y" || ')'',2309))
        && the_geom'
                           ) 
        DV3("XXX" INTEGER,"the_geom"  geometry)


WHERE 
    contains(DV3.the_geom,geomfromtext('POINT('|| s."X" ||' '|| s."Y" ||')',2309))--21
    AND "GGG" IS NOT NULL

错误

LINE 9: … WHERE box2d(geomfromtext(”LINESTRING(‘|| s.”X” + 0….

最佳答案 根据Tanzeeb的说法,有两个单引号紧挨着两个实例,看起来它们应该是双引号而不是两个单引号.

    'SELECT XXX,the_geom 
    FROM "geometry", "QQQ" s 
    WHERE box2d(geomfromtext(''LINESTRING('|| s."X" ||' '||s."Y" ||','|| s."X" || ' '||s."Y" || ')'',2309))
    && the_geom'

在LINESTRING之前和之前,2309.

点赞