Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
48 views

I have a password for a remote PostgreSQL server that I cannot change. This password contains hashtags (#). From searching, I know that this can be a problem. I can connect to the server from the ...
mikibok's user avatar
  • 147
2 votes
1 answer
59 views

I'm having a hard time with an app that has some spikes in connections. I think if acquireTimeoutMillis was working these would be queued pre-database. Trying to set it in testing doesn't seem to be ...
okhobb's user avatar
  • 920
0 votes
1 answer
39 views

I have a problem about inserting datas to my table with "MERGE INTO" method. I am using a procedure to insert datas, and my datas come from array fields. My Table: CREATE TABLE IF NOT ...
Kamuran Sönecek's user avatar
1 vote
1 answer
61 views

I'm building backend with Express and TypeScript. DB is Postgres, client is node-postgres. In DB I have table user_collection. This table has column collection of type JSONB. Collection column ...
Stas Motorny's user avatar
0 votes
1 answer
168 views

I have a question which may sound dumb but I have never done this before and have some questions that I cant seem to find the answer of. My project is in Next.js 14 with Kysely and node-postgres. I am ...
Martin Avramov's user avatar
0 votes
1 answer
544 views

I'm using node-postgres (pg) and its pg-cursor extension. I noticed when reusing the same connection between multiple cursors, it locks due to what I would assume that a single connection is only able ...
Daniel A. White's user avatar
0 votes
0 answers
146 views

I might be close, but not quite there yet as the below throws Error: Invalid response from route /api: handler should return a Response object, probably I do return just an object and not a Response? ...
fm84's user avatar
  • 15
0 votes
1 answer
35 views

I'm trying to make connection with PostgreSQL and export it. When I import the pool into other file and run a query it throws the error: syntax error at end of input postgre.js const config = require(&...
Javed Saifi's user avatar
15 votes
3 answers
10k views

In a Typescript project, declaring a table using Drizzle on postgres-node as follows: const contractsTable = pgTable("contracts", { id: serial("id").primaryKey(), ...
eon37's user avatar
  • 173
0 votes
0 answers
144 views

I have a multi tenant node application. I'm encountering an issue when trying to connect to local PostgreSQL database using node-postgres. Whenever the program attempt to execute a function (...
H Athukorala's user avatar
0 votes
1 answer
49 views

I have two identical JSON objects. First Object Second Object [{"id": 123,"firstname": "Mike","lastname": "Smith","ani": 123456,"email&...
Ethan's user avatar
  • 2,097
1 vote
0 answers
62 views

the problem may reside either in the /login route or in the local strategy but a post request to /login makes postman send infinitely and no results come back. i've searched a lot but there doesn't ...
yasin's user avatar
  • 21
0 votes
0 answers
176 views

I am trying to do some complex queries in my bird database to get all the birds back but I want to be able to use queries in the url to get back by diet and to sort accordingly and order appropriately....
RendezYT's user avatar
0 votes
0 answers
421 views

In summary I have a bird database and I am trying to do a PATCH request on seeded data I have added using the node-postgres Pool object to create a database connection with a pool of clients. I am ...
RendezYT's user avatar
0 votes
0 answers
378 views

I am trying to an insert query of bird family data below ( using function insertIntoB_familiestbl) related to bird families into bird families table. But I am getting an error relating to the ...
RendezYT's user avatar
0 votes
1 answer
149 views

I have the following code to read the first 10 rows from a query with a PG Cursor in a CloudFlare worker: const client = new Client(`<DATABASE URL>`) await client.connect() const cursor = client....
Neil Middleton's user avatar
0 votes
0 answers
83 views

I have a procedure in postgres which completes some validations and inserts some data. If the validations are not passed then it raises an exception. CREATE OR REPLACE PROCEDURE EnrolStudentToProgram(...
Simon1979's user avatar
  • 2,108
0 votes
0 answers
382 views

For a TypeScript project we use pg-promise library and it depends on node-postgres. For a daily scan we use Blackduck and it detects "High Vulnerability Security Issue" as follows: 2024-01-...
Umut TEKİN's user avatar
0 votes
1 answer
331 views

I am struggling with the correct syntax for a dollar-parameter. It sometimes works, sometimes not. I am using the 'pg' package for NodeJS, but since AFAIK parsing the query happens on the server side, ...
Martin Geisse's user avatar
0 votes
0 answers
139 views

I'm on Window 11 with Node.JS 20 and PostgreSQL 15.1: import { native } from 'pg'; // npm install pg pg-native const pool = new native.Pool({ .. }); pool.connect(); pool.query raise error SCRAM ...
ar099968's user avatar
  • 7,649
1 vote
1 answer
190 views

I'm using node-pg and I've decided to refactor some code that would first make a select query to see if a record exists and then make a second query to either insert or update a record. Suppose the ...
Mike K's user avatar
  • 6,625
0 votes
0 answers
481 views

We recently switched from mysql to postgresql, and we are using node-posgres to send queries. Everything runs fine for a few minutes, and then queries start slowing down until our service is no longer ...
busybee's user avatar
  • 204
1 vote
1 answer
650 views

I have a table that looks like this: CREATE TABLE IF NOT EXISTS list ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), tok TEXT, sid TEXT NOT NULL, aid TEXT, hash TEXT, qtt SMALLINT, p ...
bouncytorch's user avatar
0 votes
1 answer
366 views

I'm new to Next.js and I am currently following the official tutorial. To spice it up, I decided to run PostgreSQL locally instead of using the @vercel/postgres SDK used in the tutorial. In the ...
Theo's user avatar
  • 13
0 votes
1 answer
97 views

I need to perform something like this: pg.query(`insert into tbl (field1, field2) values($1, $2)`, ["a", "(select id from another_table limit 1)"]) this causes the following error ...
Sherif eldeeb's user avatar
0 votes
1 answer
1k views

I am trying to mock node-postgres in vitest with esm. But I am running into different problems. When I am using the Pool class in my function: import {Pool} from 'pg'; ... const pool = new Pool({...
Florat's user avatar
  • 340
4 votes
2 answers
1k views

I'm working on a typical client-server webapp. It is using a system somewhat like GraphQL where the client has some flexibility in specifying what data it needs, without custom API endpoints for every ...
Evert Heylen's user avatar
  • 1,061
1 vote
0 answers
674 views

I am using node-postgres PG client on a node.js app to query data from the database and pass the results to an express.js response. This works perfectly fine. However, it takes a bit of time to get ...
giddy's user avatar
  • 13
0 votes
1 answer
200 views

I am using node-postgres library. const sql = ` SELECT * FROM "Employees" where employee_id = '${employee_id}' ; `; console.log(`Query formatted: ${sql}`); const result = ...
Ace McCloud's user avatar
1 vote
4 answers
531 views

(I had originally asked this question on the DBA StackExchange, but didn't get much activity in it). In my DB, I have tables for items and connections between them, creating a likely sparse graph, ...
psygo's user avatar
  • 7,863
2 votes
0 answers
2k views

I have created a database instance using the Amazon RDS Console, assigning it the following VPC security group, authorizing any IPV4 address to connect to the database (I know this is bad practice, ...
sorin182004's user avatar
0 votes
0 answers
176 views

I'm trying to use the PGP_SYM_ENCRYPT function to save encrypted data in a PostgreSQL database using Fastify. The pgcrypto extension has been added using this command CREATE EXTENSION IF NOT EXISTS ...
Geeogee's user avatar
  • 71
0 votes
1 answer
312 views

I'm starting with postgreSQL and NodeJS and I have a table of office objects with the fields object_id(PK), inventory(varchar), area(FK) and description(text). This table must be updated weekly. How ...
Frank Botelle Valdes's user avatar
0 votes
0 answers
195 views

I was using node-posgres parameterized queries. However, it was inserting data very slowly: 100 rows was taking 5 seconds! Switching to pg-format and producing plain old SQL strings - even when ...
Robert's user avatar
  • 358
2 votes
0 answers
435 views

I am trying to use ssl in knex for postgres. I downloaded RDS CA's certificate from here https://truststore.pki.rds.amazonaws.com/ap-south-1/ap-south-1-bundle.pem I set up the knex config as follows ...
Yusuf's user avatar
  • 459
0 votes
1 answer
83 views

I have a precreated table in a database which I want to insert values into from the frontend (i.e by the user) but for some reason the code I wrote fails to achieve what I am seeking :/ I'm still a ...
بغية السالِك's user avatar
0 votes
2 answers
528 views

I'm trying to execute sql queries against a vertica db. that works so far. but to prevent sql injection, I want to use parameterized queries. looks like vertica supports parameters as ? (compared to ...
roberkules's user avatar
  • 6,605
6 votes
1 answer
3k views

There are several SO answers explaining the difference between the node-postgres (pg) Client and Pool classes. All these answers essentially say to use Pool for efficient use of multiple connections. ...
Joe Lapp's user avatar
  • 3,055
0 votes
2 answers
108 views

Apart from checking that the attributeId is in a list of predefined strings – possible, but in this particular case costly – is there any way to re-write this in a less 'injectable' fashion (since the ...
Dycey's user avatar
  • 4,745
1 vote
1 answer
292 views

I can connect to my database with psql ❮❮❮ psql postgres://postgres:<password>@<host>:5432/postgres psql (12.14 (Ubuntu 12.14-0ubuntu0.20.04.1), server 13.10) WARNING: psql major version ...
Paymahn Moghadasian's user avatar
1 vote
1 answer
246 views

Was checking out the new google node sql connector for Cloud SQL. It tells the authentication mechanism for libraries like pg as follows. import pg from 'pg'; import {Connector} from '@google-cloud/...
AnandShiva's user avatar
  • 1,429
0 votes
0 answers
177 views

Attempts to connect using pgAdmin 4 are successful. Attempts to connect using NPM package PG are refused. ConnectErr connect EHOSTUNREACH fe80::xx:xxxx:xxxx:xxxx:5432 - Local (fe80::xxxx:xxx:xxxx:xxx%...
WhatsYourFunction's user avatar
0 votes
2 answers
861 views

I'm working on a script to seed my database but am having issues with my node-pg connection being terminated before my rebuild function is finished. const rebuildDB = async () => { try { ...
James Kehs's user avatar
1 vote
1 answer
946 views

I'm migrating from AWS Aurora PG to Heroku PG and I'm currently refactoring my queries. Using the Node-Postgres library in my Serverless Framework API, I now have to manage opening and closing the ...
user2465134's user avatar
  • 9,931
0 votes
1 answer
2k views

I have an api built on Nodejs that uses node_postgres. The website says: ...if you initialize or use transactions with the pool.query method you will have problems. Im using pool.query where I don't ...
JohnnyJohnny's user avatar
0 votes
0 answers
327 views

I am learning postgres/SQL and am wondering what the best approach is here. I have an invoice db design that has recipients, drafts, items. Drafts are the invoices, items are the lines on the invoices,...
Cole Ogrodnick's user avatar
0 votes
1 answer
100 views

I am re-designing a project I built a year ago when I was just starting to learn how to code. I used MEAN stack, back then and want to convert it to a PERN stack now. My AWS knowledge has also grown a ...
RJA's user avatar
  • 498
0 votes
1 answer
181 views

I am using Node.js express for building REST api with postgres database using node-postgres package. My question is whether I should use Client or Pool? I found this answer: How can I choose between ...
Ahmet Yazıcı's user avatar
0 votes
0 answers
246 views

I have inherited a legacy system made in nodeJS and postgres. Whenever I encounter a database call error e.g let's say an insert violates a duplicate constraint the db client throws an error which I ...
martin kimani's user avatar
0 votes
1 answer
693 views

I have Node.js express app with Postgres as a database. I'm using pg for database communication from the app. This is how my db.service looks like import { Pool } from 'pg'; const dbConfig = {/*my ...
Kgn-web's user avatar
  • 7,645

1
2 3 4 5
13