I'm trying to query a CSV into a DB, but always returns the error (No such file or directory).
The file should be hosted on the /tmp folder on the container?
Database: postgres:13.2-alpine (Docker container)
Backend: node + slonik (on top of pg)
docker-compose.yml
version: '3.8'
services:
db:
image: postgres:13.2-alpine
ports:
- 5432:5432
environment:
POSTGRES_USER: <>
POSTGRES_PASSWORD: <>
POSTGRES_DB: <>
db_admin:
image: adminer
ports:
- 8080:8080
depends_on:
- db
Desired query:
\COPY rams(ram) FROM '/Users/…/rams.csv' WITH (FORMAT CSV) HEADER;
Error:
node:59682) UnhandledPromiseRejectionWarning: error: could not open file "/Users/…/rams.csv" for reading: No such file or directory
Best,
\copyalso isn't looking for it there, unless that is through some unintuitive symlink.