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

feature request: add supoprt for hstore #1165

Open
redbaron opened this issue Nov 2, 2023 · 3 comments
Open

feature request: add supoprt for hstore #1165

redbaron opened this issue Nov 2, 2023 · 3 comments

Comments

@redbaron
Copy link

redbaron commented Nov 2, 2023

It would be nice if hstore type was supported on PG protocol side. Possibly it could be translated into jsonb on spanner.

@olavloite
Copy link
Collaborator

@redbaron Thanks for your request. Is there a specific reason that you would like this to be supported? Is there a specific tool or driver that requires this, or is there some other reason?

@redbaron
Copy link
Author

redbaron commented Nov 2, 2023

If hstore was supported, it would be almost a drop in replacement for the PostgreSQL app we have

@olavloite
Copy link
Collaborator

If hstore was supported, it would be almost a drop in replacement for the PostgreSQL app we have

Could you elaborate a bit more on what support you would need? The reason that I'm asking is that:

  1. hstore is defined in an extension, which means that it does not have a fixed oid. We could add it to the pg_type table that PGAdapter uses with a randomly chosen (but fixed) oid. That would enable tools/applications that read pg_type to check whether hstore exists to work, and also allow them to send data to PGAdapter that it claims is of type hstore.
  2. We could map those values of type hstore to text in PGAdapter. jsonb is not an option, as hstore uses a different format than jsonb, and I would expect an application that thinks that it is using hstore to use the hstore format.
  3. There's no way for PGAdapter to detect that text data that is returned by Cloud Spanner should be returned as if it was hstore. So I'm not sure that the client/application in this case would be able to handle that.

There would be no support for any of the hstore functions or operators. So something like SELECT h['a'] FROM mytable; would not work.

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