Skip to content

@WritingConverter does not properly convert string to ltree in Postgres #2002

@wodinga

Description

@wodinga

When creating a Writing converter to convert from string to to ltree, it runs, but it doesn't actually convert to ltree.

@WritingConverter
class LtreeWritingConverter : Converter < String, PGobject > {
    override fun confvert(source: String): PGobject {
        return PGObject().apply {
            type = "ltree"
            value = source
       }
    }
}

Workaround:

CREATE CAST (varchar AS ltree) WITH INOUT AS IMPLICIT;

This allows us to write strings as ltrees in the Postgres DB

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions