<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<p style="margin: 0px 0px 1em; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; clear: both; color: rgb(36, 39, 41); text-align: left; background-color: rgb(255, 255, 255)">
Environment: PostgreSQL 11.4 with PostGIS 2.5.2</p>
<pre style="margin: 0px 0px 1em; padding: 12px 8px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; width: auto; max-height: 600px; overflow: auto; background-color: rgb(239, 240, 241); border-radius: 3px; color: rgb(36, 39, 41); text-align: left"><code style="margin: 0px; background-color: rgb(239, 240, 241)">CREATE TABLE m_polygon (id SERIAL PRIMARY KEY, bounds POLYGON);
INSERT INTO m_polygon(bounds) VALUES( 
  '(0.0, 0.0),  (0.0, 10.0), (10.0, 0.0), (10.0, 10.0), (0,0)' 
);

SELECT ST_WITHIN(m_polygon.bounds , m_polygon.bounds ) FROM m_polygon;
</code></pre>
<p style="margin: 0px 0px 1em; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; clear: both; color: rgb(36, 39, 41); text-align: left; background-color: rgb(255, 255, 255)">
I am getting the error message for SELECT statement above:</p>
<pre style="margin: 0px 0px 1em; padding: 12px 8px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; width: auto; max-height: 600px; overflow: auto; background-color: rgb(239, 240, 241); border-radius: 3px; color: rgb(36, 39, 41); text-align: left"><code style="margin: 0px; background-color: rgb(239, 240, 241)">ERROR:  function st_within(polygon, polygon) does not exist 
HINT:  No function matches the given name and argument types. You might 
need to add explicit type casts
</code></pre>
<p style="margin: 0px 0px 1em; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; clear: both; color: rgb(36, 39, 41); text-align: left; background-color: rgb(255, 255, 255)">
I was thinking what the reason for the error is: the ST_WITHIN arguments types should be GEOMETRY, but I am passing the POLYGONs.</p>
<p style="margin: 0px 0px 1em; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; clear: both; color: rgb(36, 39, 41); text-align: left; background-color: rgb(255, 255, 255)">
However the following works:</p>
<pre style="margin: 0px 0px 1em; padding: 12px 8px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; width: auto; max-height: 600px; overflow: auto; background-color: rgb(239, 240, 241); border-radius: 3px; color: rgb(36, 39, 41); text-align: left"><code style="margin: 0px; background-color: rgb(239, 240, 241)">SELECT ST_WITHIN(ST_MakePoint(1,1), ST_MakePoint(1,1) ) ;</code></pre>
Thanks! </div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Michael</div>
</body>
</html>