Original post

Hi guys! Really need her help. We have a custom type in the PostgreSQL database (e.g. status). Underlying type is text. I am writing unit tests for out database interface implementation. If I run tests on local test database, everything is fine. Now I have switched to docker (package dockertest) and want to run my test against the database running in a container. After getting a row (we are using pgx driver) :

row := db.Pool.QueryRow("SELECT status FROM table_name WHERE id = $1;", id)

var resStatus statuses.Statuserr = row.Scan(&resStatus)if err != nil {log.Println(err)}

Scan returns the following error: unknown oid: 16393, name: status

If I retrieve not a custom type, just some other text field, everything is OK as well.

Could you please point to the direction where the problem can be?

submitted by /u/mariaefi29
[link] [comments]