Re: my server return OK with ALL, but QUERY.test from HOME http://postgis.net return ERROR

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: cPanel cPanel <ihatecpanel(at)gmail(dot)com>, pgsql-novice(at)lists(dot)postgresql(dot)org
Subject: Re: my server return OK with ALL, but QUERY.test from HOME http://postgis.net return ERROR
Date: 2021-09-12 18:14:36
Message-ID: 436206df17b541f0f42142cebb87fbbeabac8d36.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Sun, 2021-09-12 at 10:51 -0500, cPanel cPanel wrote:
> I connect as USER postgres
>
> QUERY 1:
> SELECT PostGIS_Version();
>  => 3.1 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
>
>
> QUERY 2:
> SELECT PostGIS_Full_Version();
> => POSTGIS="3.1.4 ded6c34" [EXTENSION] PGSQL="130"
> GEOS="3.9.1-CAPI-1.14.2" SFCGAL="1.3.1" PROJ="7.2.1" GDAL="GDAL 3.3.1,
> released 2021/06/28" LIBXML="2.9.1" LIBJSON="0.11" TOPOLOGY RASTER
>
> QUERY 3:
> SELECT num, street, city, state, zip FROM parse_address('1 Devonshire
> Place PH301, Boston, MA 02109');
>     [num] => 1
>     [street] => Devonshire Place PH301
>     [city] => Boston
>     [state] => MA
>     [zip] => 02109
>
> now my problem in QUERY 4:
> a// I open http://postgis.net/
> b// I copy exactly "the command test" from home page:
> QUERY = SELECT superhero.name FROM city, superhero WHERE
> ST_Contains(city.geom, superhero.geom) AND city.name = 'Gotham';
> c// I run QUERY in my server
> d// result is:
>
> ----------------------------------------------------------------------------------------------------------------------
>     [pg_last_error()] => ERROR:  relation "city" does not exist
> LINE 1: SELECT superhero.name FROM city, superhero WHERE ST_Contains...
> ----------------------------------------------------------------------------------------------------------------------
>
> why this error?
> how I can fix?

Initially, PostgreSQL databases are empty and contain no data (except metadata).

There is certainly no table like "city" or "superhero".

Before you can query these tables, you have to create them and fill them with data.

If you follow a tutorial, that tutorial should tell you how to get these data and
how to load them into your database.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Utku 2021-09-21 13:43:21 How to UPSERT with optional updates?
Previous Message cPanel cPanel 2021-09-12 15:51:45 my server return OK with ALL, but QUERY.test from HOME http://postgis.net return ERROR