pgloader icon indicating copy to clipboard operation
pgloader copied to clipboard

pgloader not working with local Sqlite3 to Google Cloud SQL Postgres

Open ejstembler opened this issue 3 years ago • 0 comments

  • [x] pgloader --version
pgloader version "3.6.2"
compiled with SBCL 2.0.11
  • [ ] did you test a fresh compile from the source tree?

No.

  • [x] did you search for other similar issues?

Yes. Issue #1394 may be related.

  • [x] how can I reproduce the bug?
  1. You will need a local Sqlite3 database file.
  2. You will need a Google Cloud SQL Postgres database.
  3. Run Google's cloud_sql_proxy command to redirect GCP database connection to localhost.
  4. Run the pgloader command.
./cloud_sql_proxy -instances=my-instance=tcp:5432 -credential_file=my_credentials_file.json

In another terminal tab or window:

 pgloader sqlite://data.db postgresql://user:[email protected]:5432/database
  • [x] pgloader output you obtain
KABOOM!
FATAL error: Failed to connect to pgsql at "127.0.0.1" (port 5432) as user "user": 10 fell through ECASE expression. Wanted one of (0 2 3 4 5 6 7 8).
An unhandled error condition has been signalled:
   Failed to connect to pgsql at "127.0.0.1" (port 5432) as user "user": 10 fell through ECASE expression. Wanted one of (0 2 3 4 5 6 7 8).




What I am doing here?

Failed to connect to pgsql at "127.0.0.1" (port 5432) as user "user": 10 fell through ECASE expression. Wanted one of (0 2 3 4 5 6 7 8).
  • [ ] data that is being loaded, if relevant

Not included.

  • [x] How the data is different from what you expected, if relevant

There may be something off when it comes to connecting to Google Cloud SQL Postgres instances. I've tested connectivity using Ruby's sequel CLI and it's able to connect:

sequel -C sqlite://data.db postgresql://user:[email protected]:5432/database 

ejstembler avatar Jun 10 '22 20:06 ejstembler