Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"schema was not found" in functions but in tables it does #1652

Open
AimbotNooby opened this issue Jan 12, 2025 · 3 comments
Open

"schema was not found" in functions but in tables it does #1652

AimbotNooby opened this issue Jan 12, 2025 · 3 comments

Comments

@AimbotNooby
Copy link

Somehow martin says it can't find the schema "points" for the function function_linestring. But it exists and works for the tables. And also the function definitely exists inside of the schema.
Can you please help we with this error?

Errors:

Configured source points_table from table points.points_table with point column (POINT, SRID=4326)
Unable to configure source function_linestring because schema 'points' was not found.  Possible values are:

config.yaml

keep_alive: 75
listen_addresses: '0.0.0.0:3000'
base_path: /
worker_processes: 8
cache_size_mb: 1024
preferred_encoding: gzip
web_ui: enable-for-all

postgres:
  connection_string: 'postgresql://postgres:password@postgis:5432/gps_test'
  default_srid: 4326
  pool_size: 20
  max_feature_count: 1000
  auto_bounds: skip

  tables:
    points_table:
      layer_id: points_layer
      schema: points
      table: points_table
      srid: 4326
      geometry_column: point
      id_column: id
      minzoom: 0
      maxzoom: 30
      bounds: [ -180.0, -90.0, 180.0, 90.0 ]
      extent: 4096
      buffer: 64
      clip_geom: true
      geometry_type: POINT
      properties:
        user_id: int4
        altitude: float8
        time: int8

  functions:
    function_linestring:
      schema: points
      function: convert_points_to_linestring
      minzoom: 0
      maxzoom: 30
      bounds: [ -180.0, -90.0, 180.0, 90.0 ]
@AimbotNooby
Copy link
Author

I also tried auto_publish

  auto_publish:
    from_schemas:
      - points

Errors:

Auto-publishing tables in schemas [points] as '{table}' sources
Discovered source points_table from table points.points_table with point column (POINT, SRID=4326)
Auto-publishing functions in schemas [points] as '{function}' sources
Unable to configure source  because schema 'points' was not found.  Possible values are:

@CommanderStorm
Copy link
Collaborator

CommanderStorm commented Jan 15, 2025

Can you share the function points.convert_points_to_linestring (or better a simplified version which still produces the same result)?
Maybe this is reproducible and our test suite is missig a case ^^

@AimbotNooby
Copy link
Author

Hey, that's my function:

CREATE OR REPLACE FUNCTION points.convert_points_to_linestring(z integer, x integer, y integer)
RETURNS TABLE (id integer, user_id integer, "time" bigint, altitude double precision, geom geometry(LineString, 4326)) AS $$
BEGIN
  RETURN QUERY
  SELECT id, user_id, "time", altitude, ST_MakeLine(point ORDER BY "time") AS geom
  FROM points.points_table;
END;
$$ LANGUAGE plpgsql;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants