pg-promise Questions

1

Solved

In the scenario where master/replica postgres connections are built using pg-promise, is there a way to rebuild these connections in case of replica outages? Instead of doing process.exitCode = 1...
Luigi asked 15/9, 2017 at 16:6

2

Solved

is it possible to perform a multi-value upsert in PostgreSQL? I know multi-value inserts exist, as do the "ON CONFLICT" key words to perform an update if the key is violated... but is it possible t...
Stumpage asked 17/11, 2016 at 5:52

1

I am new to node.js and pg-promise coming from a synchronis programming background it requires a new thinking. I would to start with a scenario of running database initialisation before the main p...
Fenestra asked 1/8, 2016 at 6:48

2

Solved

Please keep in mind that I am new to node.js and I am used with android development. My scenario is like this: Run a query against the database that returns either null or a value Call a web se...
Inconsonant asked 4/7, 2017 at 10:20

1

Solved

Looking at https://github.com/vitaly-t/pg-promise/wiki/Data-Imports there's a very detailed doc on how to use it for importing. However while that works for the demoed scenario I don't know how to...
Uziel asked 5/7, 2017 at 12:16

2

Solved

I have a weird error using NodeJS with a PostgreSQL and I hope you can maybe help me out. I have a huge amount of data sets, about 2 Million entries that I want to insert into my DB. One data con...
Bihari asked 27/6, 2017 at 15:7

1

Solved

I am using the pg-promise NodeJS module. At some point, I am updating one of my database's table. I would like to know how many rows have been updated by the query, is it possible? Below is part o...
Bentz asked 26/6, 2017 at 15:18

1

Solved

This is a follow-up question from this comment The use case is for such query below: INSERT INTO "GamingLogs" AS GL ("GameName", "TimeSpent") VALUES ('LOL', '2'), ('DOTA2', '1'), ('Mobius Final...
Halliard asked 13/6, 2017 at 14:45

1

Solved

I am using pg-promise package with Nodejs to execute PostgreSQL queries. I want to see the queries executed. Only specific queries, say, just one query that I want to debug. I can see that one rec...
Trocar asked 4/5, 2017 at 10:46

2

I'm using Node js and Postgresql and trying to be most efficient in the connections implementation. I saw that pg-promise is built on top of node-postgres and node-postgres uses pg-pool to manage ...
Jermayne asked 6/4, 2017 at 9:5

2

Solved

I just started to learn nodejs-postgres and found the pg-promise package. I read the docs and examples but I don't understand where should I put the initialization code? I using Express and I have ...
Deadradeadweight asked 20/12, 2015 at 15:53

2

Solved

Recently I started using pg-promise with bluebird library. I have always been nesting callback and handling err in each callback. I find that the catch statement in promise looks really neat. I am ...
Cadency asked 1/2, 2017 at 14:39

1

Solved

I am using pgp.helpers.insert to save data into PostgreSQL which is working well. However, I need to return values to present in a response. I am using: this.collection.one(this.collection.$config...
Inkling asked 31/1, 2017 at 10:55

1

Solved

Have array as below, needs to be saved in JSONB column: [{"FoodType":"veg","pref":"High"} ,{"FoodType":"sea food","pref":"Medium"} ,{"FoodType":"Chicken","pref":"Low"}] I simply pass the req.bod...
Streusel asked 14/11, 2016 at 12:51

2

Solved

I am trying to pass an array of parameters in pg-promise's array of parameters, as recommended in pg-promise docs. db.any("SELECT fieldname FROM table WHERE fieldname = $1 AND fieldname2 IN ($2)",...
Detour asked 25/4, 2016 at 11:51

1

Solved

I'm going to build a Nodejs application with Postgresql as back end. I'm not going to use ORMs like Sequelize due to poor documentation and performance problems or any other ORM - ORM is an anti-pa...
Ingleside asked 24/10, 2016 at 8:0

1

Solved

I am trying to simply read a value from a table and based on the return value call for additional queries and return the combined results. let's take a simple example: table Users has id, name and...
Weigand asked 29/6, 2016 at 3:25

1

Solved

I use the pg-promise library with bluebird for making dependent queries. I have two tables, a and b, looking like this: | a | | b | |-------| |-------| | a_id | | b_id | | prop1 | | prop2 | | b_...
Canonical asked 6/6, 2016 at 18:19

1

Solved

I'm running NodeJS and pg-promise with a PostgreSQL backend. I've created my own TRIGGER which throws an exception in some cases. Things work fine at this end. But with pg-promise I have trouble c...
Defeasance asked 16/5, 2016 at 9:10

1

Solved

For example I want to get the user info, emails and it's roles from db and create an object like : { "id": 1, "firstname": "John", "lastname": "Johnny", "emails": [ { "type": "work", "email...
Leggy asked 13/4, 2016 at 0:34

1

Solved

I have a scenario in which I need to insert multiple records. I have a table structure like id (it's fk from other table), key(char), value(char). The input which needs to be saved would be array o...
Marta asked 26/3, 2016 at 9:13

1

Solved

Currently I have the following code to get the results of two queries dbro.many("SELECT geoname_id, country_name FROM paises WHERE locale_code=$1 LIMIT 10",data.lang) .then(function(countriesData...
Heartstricken asked 2/3, 2016 at 2:55

© 2022 - 2024 — McMap. All rights reserved.