Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null needs to be cast to blob in ST_GeomFromWKB #471

Open
edigonzales opened this issue Dec 23, 2024 · 2 comments
Open

Null needs to be cast to blob in ST_GeomFromWKB #471

edigonzales opened this issue Dec 23, 2024 · 2 comments

Comments

@edigonzales
Copy link

edigonzales commented Dec 23, 2024

SELECT ST_GeomFromWKB(NULL);

throws:

SQL Error: java.sql.SQLException: Binder Error: Could not choose a best candidate function for the function call "ST_GeomFromWKB("NULL")". In order to select one, please add explicit type casts.
	Candidate functions:
	ST_GeomFromWKB(BLOB) -> GEOMETRY
	ST_GeomFromWKB(WKB_BLOB) -> GEOMETRY

Works when NULL is casted to blob:

SELECT ST_GeomFromWKB(NULL::blob);
@Maxxen
Copy link
Member

Maxxen commented Dec 23, 2024

This is expected, ST_GeomFromWKB is overloaded to work for both BLOB and WKB_BLOB, and a NULL literal has no type.

@edigonzales
Copy link
Author

Seems to work differently in e.g. PostGIS where NULL w/o casting works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants