Skip to content
Advertisement

Tag: postgresql

Using placeholders with copy and pg-query-stream

I’m trying to extract a query as a csv file. I tried to use copy with pg-query-stream to execute the query but I’m facing this error: error: bind message supplies 1 parameters, but prepared statement “” requires 0 when removing copy from the query it works fine with the placeholders also if I provided a query with copy and no

TypeORM fails to connect without any error message

I am trying to get started with TypeORM, but cannot get createConnection to work. I run the default tpyeorm init server file, but there is not error or logging shown, nor is the postgres DB updated. index.ts ormconfig.json (note: I changed the postgres password to ‘root’) running start gives the following output: Note that none of the other logging statements

How to update a constraint in a migration

I need to add onDelete and onUpdate cascade to a constraint in a migration file. So i did an alter table, selecting the foreign keys and chaining with the alter method in the end of each command. But i’m getting a error saying that the constraint of this relationship already exists. error: constraint “deliveries_courier_id_foreign” for relation “deliveries” already exists How

What is this JavaScript “require”?

I’m trying to get JavaScript to read/write to a PostgreSQL database. I found this project on GitHub. I was able to get the following sample code to run in Node. Next I tried to make it run on a webpage, but nothing seemed to happen. I checked on the JavaScript console and it just says “require not defined”. So what

Advertisement