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!
I have a generated column with type
spointin my table which seems to be preventing me from using the\copycommand to load data.I get the error:
I have investigated the problem for a few hours, and it seems that the cause is
pgspherenot 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
\copyworking with my tables which use these generated columns having a definition like: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!