add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
ERROR:  type "geometry" does not exist
LINE 5:     my_point geometry(Point,4326),
                     ^
CREATE FUNCTION
CREATE TABLE
INSERT 0 1
lat lng info
45.50884 -73.58781 x1
41.56355 -81.57327 x2
41.52335 -81.57423 x3
SELECT 3
ERROR:  relation "points" does not exist
LINE 1: INSERT INTO POINTS(my_point, info)
                    ^
QUERY:  INSERT INTO POINTS(my_point, info)
      SELECT ST_SetSRID(ST_Point((points->>'lat')::text::float8, 
                                 (points->>'lng')::text::float8), 
                                  4326), 
                        (points->>'info')::character varying
      FROM (SELECT json_array_elements(multiple_geom->'points') AS points) p
CONTEXT:  PL/pgSQL function add_multiple_geom(json) line 7 at SQL statement
SQL statement "SELECT add_multiple_geom(data)"
PL/pgSQL function inline_code_block line 9 at PERFORM
ERROR:  relation "points" does not exist
LINE 1: SELECT * FROM Points;
                      ^