Skip to content

Bulk copy command fails with generated spoint column #136

Open
@JeremyMcCormick

Description

@JeremyMcCormick

I have a generated column with type spoint in my table which seems to be preventing me from using the \copy command to load data.

I get the error:

ERROR: no binary input function available for type point

I have investigated the problem for a few hours, and it seems that the cause is pgsphere not implementing binary input for this type. An equivalent insert statement using test data works fine, so I don't think there is any fundamental problem with my data or how the generated column is working.

I would really like to get \copy working with my tables which use these generated columns having a definition like:

ALTER TABLE "MyTable" ADD COLUMN radec spoint GENERATED ALWAYS AS (spoint(radians(ra), radians(dec))) STORED;

To work around this, I would have to use less desirable methods like copying from staging tables, using insert commands instead, etc. and I would lose the efficiency of the bulk copy operation.

Any insight or advice would be appreciated, thanks!

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