postgresql-http-client icon indicating copy to clipboard operation
postgresql-http-client copied to clipboard

Hello (postgres 9.4 compatibility)

Open jcleiva opened this issue 7 years ago • 4 comments

Having some sql stament errors

jcleiva avatar Aug 23 '18 13:08 jcleiva

This sql statement coalesce(nullif(current_setting('http_client.default_headers'), ''), '{}')::jsonb || coalesce(headers, '{}'::jsonb) gives this error operator does not exist: jsonb || jsonb I'm using psql (9.4.19)

Also this sql statement coalesce(nullif(current_setting('http_client.connect_timeout', true), ''), '2')::integer gives this error No function matches the given name and argument types. You might need to add explicit type casts I change it to coalesce(nullif(current_setting('http_client.connect_timeout'), ''), '2')::integer, and it worked

Thanks

jcleiva avatar Aug 23 '18 13:08 jcleiva

@jcleiva, thank you for your comments!

The operator || for jsonb and json types was added only in Postgres 9.5.

As for current_setting(..) function, its second parameter was added in 9.6, and it's very helpful because it allows defining "default" value.

I'm afraid, I won't be able to add backward compatibility for Postgres versions < 9.6 due to lack of time.

Can you upgrade?

NikolayS avatar Aug 26 '18 20:08 NikolayS

FYI: I've added a note to README, that postgres 9.6+ is required.

NikolayS avatar Aug 26 '18 20:08 NikolayS

Thanks for your reply, Ok, I will try it using postgresql 10.

I will let you know

Thanks again.

jcleiva avatar Aug 27 '18 21:08 jcleiva