Open esabol opened 1 year ago
@esabol I would propose to share some information about xgeom_intext function and s_region type.
I'm getting a different error here:
create table s (s strans);
create index on s(s);
ERROR: 42704: data type strans has no default operator class for access method "btree"
HINT: You must specify an operator class for the index or define a default operator class for the data type.
Looking up strans by actual value in a btree doesn't seem to make much sense to me. Wouldn't you rather look up the transformation by some other means and then apply it?
I would propose to share some information about xgeom_intext function and s_region type.
s_region
isn't a type. It's a text column in the table that contains strings like "CIRCLE('ICRS',0,0,1)".
xgeom_intext
is a complicated PLpgsql function that basically takes strings like that and converts them into pgsphere objects.
What operation inside the xgeom_intext
function is triggering that error?
What operation inside the
xgeom_intext
function is triggering that error?
I don't know!
Does select xgeom_intext(s_region) from xgeom_s_region;
throw the same error, perhaps with more detail?
xgeom_s_region
is the name of the index.select xgeom_intext(s_region) from sometable
does not throw any errors. This error only occurs when you try to create an index on it.
esabol wrote in #101:
I wonder if the error in issue #93 would be helped if there was a hash opclass for strans?
Could be, but more likely a btree opclass since you are building a btree index.
What datatype does xgeom_intext return?
@df7cb asked:
Could be, but more likely a btree opclass since you are building a btree index.
Ah, yeah, that makes sense.
What datatype does xgeom_intext return?
A user-defined type we call "xgeom". strans is a component, but also spoint and scircle and possibly spoly (but not really in practice). It's kind of a generic spherical geometry polymorphic type.
The strans error message might go away when we implement a btree opclass, but what would strans < strans
even mean? If you only want equality lookups, a hash opclass would make more sense.
One of my colleagues is trying to create an index on a column operated on with a PL/pgsql function that we have that uses various pgsphere types and operators and received this error....
Should pgsphere provide a comparison function for strans objects? Does that even make sense?
In the meantime, if anyone has even a quick and dirty solution or advice to help my colleague get beyond this error, please reply.