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

Can't process CITEXT #488

Open
tobq opened this issue Feb 2, 2022 · 2 comments
Open

Can't process CITEXT #488

tobq opened this issue Feb 2, 2022 · 2 comments
Labels
type: enhancement A general enhancement

Comments

@tobq
Copy link

tobq commented Feb 2, 2022

In the passed, I had to register a custom codec to process the citext.
Is there a reason the library doesn't handle citext itself?

One issue I found with my custom codec is that the OID isn't always the same - it was different on my local machine than to my server

Caused by: java.lang.IllegalArgumentException: Cannot decode value of type java.lang.Object with OID 16395
	at io.r2dbc.postgresql.codec.DefaultCodecs.decode(DefaultCodecs.java:180) ~[r2dbc-postgresql-0.8.10.RELEASE.jar:0.8.10.RELEASE]
@tobq tobq added the status: waiting-for-triage An issue we've not yet triaged label Feb 2, 2022
@tobq
Copy link
Author

tobq commented Feb 2, 2022

I guess it could be argued that there's no appropriate (native) java type that can represent CITEXT, so the citext should be converted to a normal string before reaching the driver?

@mp911de
Copy link
Collaborator

mp911de commented Feb 2, 2022

citext seems an optional module. It would make sense to register a StringCodec for a given OID to be able to read such values as String. Take a look at https://github.com/pgjdbc/r2dbc-postgresql/blob/main/src/main/java/io/r2dbc/postgresql/codec/BuiltinDynamicCodecs.java.

@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 2, 2022
mp911de added a commit that referenced this issue Mar 16, 2022
Introduce constructor accepting the default and array type for character codecs.

[#488]

Signed-off-by: Mark Paluch <mpaluch@vmware.com>
mp911de added a commit that referenced this issue Mar 16, 2022
Introduce constructor accepting the default and array type for character codecs.

[#488]

Signed-off-by: Mark Paluch <mpaluch@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants