© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•5mo ago•
5 replies
jins

Postgis Error: function st_makepoint(double precision, double precision) does not exist

I am using
postgis
postgis
in a project and I have a Postgres function that takes the Longitude/Latitude when data is inserted into a row and calculates the location
geometry
geometry
field.

I am trying to setup a new database and seed it but seeding the table with
geometry
geometry
postgis field is failing. This works on the original DB so I'm not sure what's happening.
postgis
postgis
extension is enabled.

the error says:
cause: PostgresError: function st_makepoint(double precision, double precision) does not exist

hint: 'No function matches the given name and argument types. You might need to add explicit type casts.',
where: 'PL/pgSQL function public.set_location_from_coords() line 4 at assignment',
internal_position: '28',
internal_query: 'NEW.location := ST_SetSRID(ST_MakePoint(NEW.longitude, NEW.latitude), 4326)',
cause: PostgresError: function st_makepoint(double precision, double precision) does not exist

hint: 'No function matches the given name and argument types. You might need to add explicit type casts.',
where: 'PL/pgSQL function public.set_location_from_coords() line 4 at assignment',
internal_position: '28',
internal_query: 'NEW.location := ST_SetSRID(ST_MakePoint(NEW.longitude, NEW.latitude), 4326)',


My function and trigger:
CREATE OR REPLACE FUNCTION public.set_location_from_coords()
RETURNS trigger
LANGUAGE plpgsql
SECURITY DEFINER
SET search_path = ''
AS $$
BEGIN
  IF NEW.longitude IS NOT NULL AND NEW.latitude IS NOT NULL THEN
    NEW.location := public.ST_SetSRID(public.ST_MakePoint(NEW.longitude, NEW.latitude), 4326);
  ELSE
    RAISE EXCEPTION 'Longitude and latitude must not be null';
  END IF;
  RETURN NEW;
END;
$$;

CREATE OR REPLACE TRIGGER trg_set_location
BEFORE INSERT OR UPDATE ON rinks
FOR EACH ROW
EXECUTE FUNCTION set_location_from_coords();
CREATE OR REPLACE FUNCTION public.set_location_from_coords()
RETURNS trigger
LANGUAGE plpgsql
SECURITY DEFINER
SET search_path = ''
AS $$
BEGIN
  IF NEW.longitude IS NOT NULL AND NEW.latitude IS NOT NULL THEN
    NEW.location := public.ST_SetSRID(public.ST_MakePoint(NEW.longitude, NEW.latitude), 4326);
  ELSE
    RAISE EXCEPTION 'Longitude and latitude must not be null';
  END IF;
  RETURN NEW;
END;
$$;

CREATE OR REPLACE TRIGGER trg_set_location
BEFORE INSERT OR UPDATE ON rinks
FOR EACH ROW
EXECUTE FUNCTION set_location_from_coords();
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Postgis query - function st_x(geography) does not exist
SupabaseSSupabase / help-and-questions
4y ago
function auth.uid() does not exist
SupabaseSSupabase / help-and-questions
3mo ago
ERROR function graphql.get_schema_version() does not exist
SupabaseSSupabase / help-and-questions
4y ago
function uuid_generate_v4() does not exist
SupabaseSSupabase / help-and-questions
4y ago