I am new to PostgreSQL and odo. I've created the following: (I am working on Ubuntu).
I've created superuser testuser and with this user (role) I've created postgresql database testuser (by running psql and then CREATE DATABASE testuser;). In this database is a table called testtable. I have no troubles inserting into this database with psycopg2. But I've come across the odo module for python. Since my goal is to load some_file.csv into the postgresql database I thought I would use it. The usage seemed rather straightforward
import odo
odo.odo('some_file.csv', 'postgresql://testuser:<password>@127.0.0.1:5432/testuser::testtable')
But it does not work, and I get
NotImplementedError: Unable to parse uri to data resource: postgresql://testuser:<password>@localhost:5432/testuser
Note: instead <password> I have the testuser's password.
Maybe it is obvious and I have to implement it.. (as in the last paragraph here), but I thought postgresql is supported (because postgresql is mentioned few times there, with examples). I've tried to look here under Connection URIs, but could not find a mistake. And here is odo documentation.
odouses COPY command for that. I've created the table, e.g like this "CREATE TABLE testtable(id serial PRIMARY KEY, age integer, name varchar);" and the testing csv looks like this "25, John\n34, Petr",\nrepresents new line.