Skip to content

Functions in Prepared Statements #3

Description

@ejc123

I've been trying to use geom.asGeoJson() in a query that gets turned into a prepared statement. The problem is that I get

ERROR: function st_asgeojson(bytea, integer) is not unique at character 31
HINT: Could not choose a best candidate function. You might need to add explicit type casts.

in my Postgres logs.

Here's what Postgres is trying to do:

STATEMENT: select x2."name", x2."state", ST_AsGeoJson(ST_AsEWKB(x2."geom"),1), x2."country", x3."email", x4."term", x5."career" from "term" x4, "career" x5, "cities" x2, "students" x3 where (((x4."term" = $1) and (x5."career" = $2)) and (x2."id" = $3)) and (((x3."city" = x2."id") and (x3."term" = x4."id")) and (x3."career" = x5."id"))

The query works wonderfully if it's not in a prepared statement.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions