#PostGIS

1 messages · Page 1 of 1 (latest)

vagrant geyser
#

operator is not unique: geometry = bytea

but the type is correct:

SELECT
    a.attname AS column_name,
    t.typname AS type_name,
    pg_catalog.format_type(a.atttypid, a.atttypmod) AS full_type
FROM
    pg_attribute a
JOIN
    pg_class c ON a.attrelid = c.oid
JOIN
    pg_namespace n ON c.relnamespace = n.oid
JOIN
    pg_type t ON a.atttypid = t.oid
WHERE
    c.relname = 'reservation'
    AND a.attname = 'order_center'
    AND a.attnum > 0
    AND NOT a.attisdropped;

the result is in the image.
aswell as the output of the member.

i am using the package:
.package(url: "https://github.com/brokenhandsio/fluent-postgis.git", from: "0.5.0")

#

the full error message:

2025-05-16 07:30:35.841 UTC [489] ERROR:  current transaction is aborted, commands ignored until end of transaction block
2025-05-16 07:30:35.841 UTC [489] STATEMENT:  INSERT INTO ... REDACTED ...
2025-05-16 07:33:15.888 UTC [487] ERROR:  operator is not unique: geometry = bytea at character 3189
2025-05-16 07:33:15.888 UTC [487] HINT:  Could not choose a best candidate operator. You might need to add explicit type casts.
vagrant geyser
#

i used

    let reservationorderCenter = GeometricPoint2D(x: 0.0, y: 0.0)

and

    let reservationorderCenter = GeometricPoint2D(x: faker.address.longitude(), y: faker.address.latitude())

to create the member in the object but both resort to the same error.

vagrant geyser
#

i also did a downgrade to 0.4 but it didnt make a difference

vagrant geyser
#

i tried geography aswell. but no luck

2025-05-16 09:06:09.478 UTC [103] ERROR:  operator is not unique: geography = bytea at character 22025
2025-05-16 09:06:09.478 UTC [103] HINT:  Could not choose a best candidate operator. You might need to add explicit type casts.
obsidian saffron
#

Is this when saving a model with that type?

vagrant geyser
#

yea, afaik the same configuration worked for another project well but it seems to fail.
i tried increasing the debugging output, but there is not much to it. (see above the full excerpt snippet)

#

claude and chatgpt aswell have no idea, what to suggest besides doing a raw query and skipping the library all together -- i dont have to mention that is out of question

obsidian saffron
#

Have you installed PostGIS on the database server?

vagrant geyser
#

yes i did run the enable postgis middleware on configuration too

#

there is not much to it.

this is an excerpt pseudo code. its not 100% correct yada yada etc. but to get the point across.
its a model it has a member the package is in the product and imported at the top. the field does mention the type and the type is reflected in the query.

  .field("center", .geometricPoint2D, .required)

  import FluentPostGIS
...
  let listingCenter = GeometricPoint2D(x: listingLatitude, y: listingLongitude)
...
  let listingPublic = Listing.listingPublic(
      title: listingTitle,
      description: listingDescription,
      imageList: listingimageList,
      
      personID: personID,
      
      center: listingCenter,
      
      street: listingStreet,
      city: listingCity,
      state: listingState,
      zip: listingZip,
      
      price: listingPrice,
      type: listingType).create()