I have a longitude and latitude values and need to convert Oracle SDO function to PostGIS. My Oracle query is below:

SELECT geoid 
FROM   tract 
WHERE  SDO_Contains(
                    2001,4326,SDO_POINT_TYPE (
                            '38.841873', '-77.448135',NULL)
                    NULL,NULL)) = 'TRUE';

How can I convert it to PostGIS?

1 Answer 1


Your question is a bit unclear, but if you want to write the query that does exactly the same job then you can find it below:

SELECT geoid FROM  tract WHERE ST_Contains("GEOM",ST_SetSrid(ST_Point(38.841873, -77.448135), 4326));

Otherwise, please add more detailed explanation.

  • I think that needs to be "GEOM" not 'GEOM' in PostGIS otherwise it's a string not a column
    – Ian Turton
    Commented Jun 18, 2020 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.