Fork me on GitHub
#sql
<
2022-11-02
>
ivana11:11:25

Hello! Installed Postgres 9.6 in Docker, it works. Installed 15.0 - it shows an error

The authentication type 10 is not supported. Check that you have configured the pg_hba.conf file to include the client's IP address or subnet, and that it is using an authentication scheme supported by the driver.
What should I do? Search & fight with pg_hba.conf or use some different library? For now I'm using the latest release of [org.clojure/java.jdbc "0.7.12"]

ivana12:11:05

I performed a binary search and found out, that 12.12 stil works but 14.5 already doesn't work. Waiting for your suggestions, I'd prefer to keep jdbc 0.7.12

kwladyka12:11:50

I use postgres:15.0-alpine3.16 and it works for me

kwladyka12:11:11

I use jdbc next

kwladyka12:11:30

with HikariDataSource as pool

kwladyka12:11:09

com.github.seancorfield/next.jdbc {:mvn/version "1.3.834"}

kwladyka12:11:13

com.zaxxer/HikariCP {:mvn/version "5.0.1"}

kwladyka12:11:19

org.postgresql/postgresql {:mvn/version "42.5.0"}

ivana12:11:21

Oh, thanks. Maybe I also can rewrite all the project to jdbc next, but unfortunatelly it uses different incompatible api and will not work as direct dependency substitute 😕

kwladyka12:11:35

I think next jdbc is really good choice

kwladyka12:11:59

But refactoring is a job to do. Worth or not worth it,

ivana12:11:11

Maybe, but I entered realy legacy project with Postgres 9.6 and previous jdbc/honeysql community (not Sean Cornfield) versions with different apis....

kwladyka12:11:16

yeah it is live 🙂

ivana16:11:54

(let [db "jdbc:"
      ds (jdbc/get-datasource db)
      _ (prn :ds ds)]
  (jdbc/get-connection ds))

ivana16:11:18

:ds #object[next.jdbc.connection$url_PLUS_etc$reify__21688 0x73f9c24 "jdbc:"]
Syntax error (PSQLException) compiling at (.repl-input:1:1).
The authentication type 10 is not supported. Check that you have configured the pg_hba.conf file to include the client's IP address or subnet, and that it is using an authentication scheme supported by the driver.

ivana16:11:43

What I do wrong?

kwladyka17:11:24

Do you keep you old DB config after upgrade postgresql?

ivana17:11:38

What is db config? )

kwladyka17:11:04

Does it work for you if you will run fresh new postgresql?

kwladyka17:11:13

without any volume in docker etc.

ivana17:11:13

I just installed different docker pg images

ivana17:11:59

It works if I start docker container with 9.6, up to 12.12

kwladyka17:11:25

My guess is in the new version they turned off by default some legacy way of auth

kwladyka17:11:35

and what you need to to do is what stackoverlow saying

kwladyka17:11:43

or upgrade clojure deps

kwladyka17:11:51

to for example jdbc next 🙂

ivana17:11:15

I use jdbc next - it shows above

ivana17:11:26

:ds #object[next.jdbc.connection$url_PLUS_etc$reify__21688 0x73f9c24 "jdbc:"]

ivana17:11:38

next.jdbc.connection

kwladyka17:11:02

Can you cat docker-compose.yaml ?

ivana17:11:34

I do not use compose, I use hub images

ivana17:11:23

docker run --name heron-pg-15.0 -p 5432:5432 -e POSTGRES_USER=user -e POSTGRES_PASSWORD=password -e POSTGRES_DB=heron -d postgres:15.0

kwladyka17:11:51

(jdbc-connection/->pool HikariDataSource {:jdbcUrl uri
                                                                                     :maximumPoolSize 2
                                                                                     :poolName "historical data"})
I make a pool like this

kwladyka17:11:05

(:import (com.zaxxer.hikari HikariDataSource))

kwladyka17:11:30

and later you can use what this fn return as a “connectable”

kwladyka17:11:42

as a first parameter in jdbc

ivana17:11:43

I tried without hikari pools, just create connection object for beginning

kwladyka17:11:35

and I use postgres:15.0-alpine3.16 you can try this one

ivana17:11:04

Give me 5 mins I'l try your version

ivana17:11:52

soory, wrong keyboard )))

ivana17:11:39

The same error

ivana17:11:06

Going to dig into your SO link

kwladyka17:11:21

that is very strange, it has to be something what you miss

kwladyka17:11:38

this image works with next jdbc

kwladyka17:11:41

at least on my computer 😉

ivana17:11:39

Yep, 42/5/0

kwladyka17:11:47

try new app maybe? Maybe some of you dependency blow up it. Like legacy jdbc dependency or something

1
👍 1
kwladyka17:11:59

I think creating new empty project will answer that

ivana17:11:49

Just tested that regular (not next) jdbc and pg 42.5.0 works fine together on 9.6

Andrey Ivanov, [02.11.2022 20:36]
(let [uri "jdbc:"
        conn (jdbc/add-connection uri (jdbc/get-connection uri))]
    (jdbc/query conn ["select version()"]))

Andrey Ivanov, [02.11.2022 20:36]
({:version "PostgreSQL 9.6.24 on x86_64-pc-linux-gnu (Debian 9.6.24-1.pgdg90+1), compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit"})

ivana17:11:20

Maybe will try new project after trying SO soggestions with configs magic...

ivana17:11:43

Oh my, created new empty project and looks like both jdbc libs works with postgres 15... At least connection creates and query version works. Thanks for the idea, will look what may break it in working project...

seancorfield18:11:04

Just catching up on this: use of c.j.j vs next.jdbc is irrelevant for this issue -- they're both thin wrappers around JDBC and what you are seeing is a JDBC level issue. Nothing to do with the Clojure libraries.

seancorfield18:11:28

So you can stick with c.j.j for now.

ivana18:11:58

Thanks! Yep, they both works on empty project without extra deps, but both fails if I added my working project deps to it 😁 But now I can use binary search and found the exact deps which are incompatible with it.

kwladyka12:11:53

Any plans to add COPY to jdbc next for postgresql?

seancorfield18:11:51

Without any context, what does that question even mean?

seancorfield18:11:31

If COPY is a SQL statement, you don't need "support" in next.jdbc: it will run whatever SQL you give it.

kwladyka18:11:41

yes, I can use it without jdbc, but I like to use jdbc 🙂

kwladyka18:11:05

just brining a suggestion for a new feature

seancorfield18:11:24

If that's a SQL command, you should be able to execute! it like any other SQL command.

👍 1