881
questions
-1
votes
0
answers
47
views
Throwing an error when opening the project, because of pg import
This line const { Client } = require('pg'); causes my project to throw errors. The import just mentioned, is found in my file called Logic.jsx.
In another file called Members.jsx, I am importing the ...
0
votes
1
answer
17
views
whether aiopg supports orm frameworks such as sqlalchemy
The official handbook only has instructions for sqlalchemy core; I'm not sure if aiopg supports the ORM framework.
I checked it up, but there wasn't enough information. asyncpg is known to support orm,...
0
votes
0
answers
22
views
An error occurred while installing pg (1.1.4), and Bundler cannot continue. and An error occurred while installing pg (1.1.4)
I tried to intall bundle and this error occurred everytime.i need fix to this error, i have check all solution on stack overflow but nothing worked for me, i'm using ruby 3.0.1, rails 6.1.7 and pg 14
...
1
vote
0
answers
143
views
Nuxt 3 & Postgresql: Cannot access 'renderer$1' before initialization
I am working locally on an application built with Nuxt.js 3 and using Postgreql. I am finding that I am running into the following error message: Cannot access 'renderer$1' before initialization
1: No ...
0
votes
0
answers
15
views
Creating a GUI/PSQL based postgre SQL table editor
I am planning to create a GUI and PSQL based postgre SQL table editor for my project. The front end is React and Backend is Node JS. Now in order to create the table, I can simple provide user with a ...
0
votes
0
answers
23
views
Error with pg in Jest-ts testing : Jest has detected the following 1 open handle potentially keeping Jest from exiting: ● TCPWRAP
I have been facing the problem where my Jest test is not ending gracefully. (I prefer not to use --force-exit).
this is my jest code. FYI the tests passes. This is an integration testing.
import ...
0
votes
0
answers
93
views
Drizzle: there is no unique or exclusion constraint matching the ON CONFLICT specification
import { sql, type SQL } from "drizzle-orm";
import type { AnyPgColumn } from "drizzle-orm/pg-core";
export function lower(col: AnyPgColumn): SQL {
return sql`lower(${col})`;
}
...
0
votes
0
answers
137
views
Playwright Test Not Running with Postgres database connection using pg package
I'm facing an issue with Playwright tests. I have a separate module, db-connection.ts, for connecting and querying a PostgreSQL database using the pg package. Here's the relevant code in db-connection....
0
votes
0
answers
28
views
File transfer via Apache NiFi using transfer configuration from pgdb
I've the configuration for files in pg database, with information like file source, destination, file pattern and etc..
And I want to have a nifi process where I'll read configuration via db and then ...
0
votes
2
answers
34
views
How to configure javascript pg library to interpret timestamps without timezone as UTC timestamps when reading from postgres
My computer timezone offset is UTC/GMT +3 hours.
My table in database is defined as such.
CREATE TABLE public.order_invoices (
created_at timestamp NOT NULL,
updated_at timestamp NOT NULL,
...
-1
votes
1
answer
31
views
Import Content Type in STRAPI
Is there any way to transfer Content-Type Builer in Strapi to another Strapi source code ?
i want to move all my collection types in Content-Type Builder to another Strapi source code, but i don't see ...
0
votes
1
answer
73
views
Limit clause workings in postgres?
So i have a table with 1000 rows, i simply say select * from hugedata limit 1 the query plan simply says table scan then limit operator attached is query plan
[
{
"Plan": {
&...
1
vote
0
answers
53
views
Build failed. @parcel/core: node_modules/pg-cloudflare/dist/empty.js does not export 'CloudflareSocket'
I'm building a webapp using Parcel to bundle.
Everything was working right at the front, but then I started the back setting the data base and got this error from parcel.
🚨 Build failed.
@parcel/...
1
vote
0
answers
100
views
Getting randomly PG::Error: can't open large object with rails application
I have a rails application using postgresql 16, i am using latest version 1.5.6 of pg gem.
I have the below method:-
def file_length
transaction do
lo = active_connection.lo_open(self.oid, ...
0
votes
0
answers
344
views
Restore database problem when have two versions PostgreSQL version 13.14 and PostgreSQL 16
I have two PostgreSQL version installed 13.14 port 5432 and 16 port 5433
When I try to restore database on PostgreSQL 16 process failed
Restoring backup on the server 'PostgreSQL 16 (localhost:5433)'
...
1
vote
1
answer
26
views
How to wait my insert to be committed before continuing instructions?
I made a NextAuth authentication with credentials. It works fine when I use the LogIn page.
const handleSubmit = async (event:FormEvent) => {
event.preventDefault();
await signIn("...
0
votes
0
answers
18
views
Node PG Insertion failure missing two field with all provided data
Conext
I have a table storing notes in a table
This notes first run through Google KMS for encryption
Google KMS returns back to me the encrypted buffer
Then I try storing into the table
Issues
...
0
votes
0
answers
62
views
Node pg terminates if connection is lost
I'm trying to use node.js and pg to write data from a message buffer to a postgres table.
This works pretty good, until postgres is restarted. Then the script fails and terminates.
As I'm quite new to ...
0
votes
0
answers
140
views
murmur3 hashing function in postgres
I want to use murmur3 hashing function in postgres , is there any default in postgres .
In PostgreSQL do we have any mechanism for fetching this murmur3 hash function for any UUID
I haven't go ...
0
votes
1
answer
145
views
How to reuse postgres database connection client across multiple AWS Lambda invocations?
I have a lambda which connects to postgres database using 'pg' package. Every time i create a new database connection, execute the query and close the connection. Lambda can invoke multiple times. How ...
0
votes
0
answers
182
views
Pg + Supabase Connection issue on production
I am using typescript + supabase client besides using pg for writing plain sql, the thing is after deploying to production the pg pool connection isn't established correctly returning "Error: ...
0
votes
3
answers
55
views
Query data json in PG with rails
I have a ATable ( id, value ) with value type is json
id | value
--------------------------------------------------
1 | { 'start': '2023-10-02', 'end': '2023-10-05', user_ids: [283, 237, 238] }
2 | {...
0
votes
1
answer
1k
views
Recommended column type for id field [closed]
I am using Drizzle, Next.js 14 app router and Neon serverless. What is the best column type for id field in a table? I think a solution that is auto generating, random, yet not very large (like UUID) ...
1
vote
0
answers
91
views
PostgreSQL sequence not rolling back in Node.js application despite transaction rollback [duplicate]
I'm encountering an issue in my Node.js application where the PostgreSQL sequence (nextval) continues to increment even if there is an error during validation or insertion, and I have explicitly ...
0
votes
2
answers
84
views
How to update multiple rows with pg promise?
I want to update multiple rows with pg promise but I don’t understand it fully
Here is my code
I don’t know where I have access to my plan_id
const cs = new pgp.helpers.ColumnSet(
['user_id',...
0
votes
1
answer
57
views
postgresql does not return value on select * after using CTE
I try to create a new user and push the new user id to auth table with their google id.
Then i want to return the new user, but even though i use select * no value is returned. (but the user gets ...
0
votes
1
answer
43
views
Empty result consulting PostgreSQL using pg (node-postgres) library
I am testing the pg library (node-postgres) to connect Node.js with my PostgreSQL database. When I test it via pgAdmin, the query 'SELECT * FROM authors WHERE id='56a33651-f6c9-4abf-8375-b10c065724a4';...
0
votes
0
answers
13
views
how Connection Pool works when I have multiple ec2 Instances?
When I use the pg Library and I use Connection Pool and I set it to 20
But how should I configure it when I use multiple Instances ? Maybe I have Three instances how should I Change my Connection Pool ...
0
votes
1
answer
271
views
Will the pg_stat_statements view show old data if there is no transaction going on in the database?
I am trying to write a query using pg_stat_statements to find the elapsed time of queries running in the database. I want to know if there are no transactions in the database will the view show only ...
0
votes
0
answers
49
views
How to make PostgreSQL load "share" from a relative directory
The PostgreSQL Linux arm version always loads the share folder from the absolute directory /usr/share/postgresql/<version>/.
But the version provided on this web site for Windows & Linux x64 ...
0
votes
0
answers
37
views
How to make multiple db connections with pg for multi tenancy?
I developing a multi tenancy SaaS. I use subdomains for my clients and I know how I extract the subdomain and make a query etc. But I dont know what is the best way to make multiple db connections ...
1
vote
1
answer
344
views
Enum error in Rails 7.1.2 with Postgres Undefined column
An error occurred when inspecting the object:
#<ActiveRecord::StatementInvalid:"PG::UndefinedColumn: ERROR: column product_proposals.status_ids does not exist\nLINE 1: ...oduct_proposals\&...
0
votes
0
answers
47
views
Return promise when all records have got inserted into database node js postgress
I am parsing csv data and inserting into postgres using node js "pg" library. I have multiple await function to get executed. I have tried adding "Promise" to the insert , but it ...
0
votes
0
answers
20
views
Data not replicating using logical replication
Not able to see replicated data on device Although it is showing in sync state and the is showing the process is running but data is not replicated I have done logical replication I have trying since ...
0
votes
0
answers
185
views
Segmentation fault in production environment, Ruby 2.7.2 and Postgresql 14
versions i am using
Ruby 2.7.2
Rails 6.1.7.6
pg 1.5.4
postgresql 14
my database.yml file
production:
adapter: postgresql
host: host
database: dbname
username: postgres
password: "##abc&...
0
votes
0
answers
50
views
Missing export named "QueryFile"
I just tried starting to use pg-promise and ran into an error I cannot understand at all. I am kinda new to typescript in general, so it might be more of a typescript error and not a pg-promise one.
I ...
0
votes
1
answer
109
views
Why do I incorrectly get connected to another database when using Postgresql and PQconnectdb?
I installed postgresql by postgres database. Postgresql version 12.17.
Then, I created new database: myendb.
I'm using libpq.
I tried to connect myendb by following connection string and using ...
0
votes
1
answer
206
views
postgres COPY FROM STDIN WITH encoding error with UTF8 by using libpq
I created database by following command:
CREATE DATABASE myendb
ENCODING 'UTF-8'
LC_COLLATE 'en_US.UTF-8'
LC_CTYPE 'en_US.UTF-8'
TEMPLATE template0;
I tried to insert Cyrillic symbols encoding by ...
0
votes
1
answer
44
views
What's wrong with my ingredients array ? Got an empty array
I'm currently working on a cooking app and I have troubles with the API.
IngredientsController.get('/', async (req, res) => {
let ingredients:Ingredient[] = []
await pool.query({text:'...
2
votes
0
answers
653
views
Kysley with Postgres - why aren't timestamp fields deserialized as Date in JS?
I have Kysley setup with Postgresql.
When I write something like this:
const temp = await this.qb.selectFrom('app_user').select(['id', 'ts_modified']).execute();
console.log(temp[0]);
outputs:...
0
votes
0
answers
402
views
An error occurred while installing pg (1.3.5), and Bundler cannot continue
On doing bundle install for this rails project, i am facing with this issue.
My Mac details
Chip - Apple M1 Pro
macOS - 13.4.1
I have gone through most of the other articles based on the same issue, ...
1
vote
1
answer
59
views
how do I tell if a query failed in postgres with ruby?
here is some basic code for context
require 'pg'
conn = PG.connect(db_params)
# example query:
response = conn.exec("update employees set id = 0 where role = 'owner'")
puts response
...
0
votes
2
answers
790
views
ERROR: PG::NotNullViolation: ERROR: null value in column "service_name" violates not-null constraint after upgrade Rails to 7.0.6
Recently we had upgraded the Ruby on Rails app (Ruby 2.7.2 to 3.2 , Rails 5.2 to 7.0.6). After upgraded the versions, tested in local it was working as we expected, then we deployed the project into ...
1
vote
1
answer
307
views
PG11 : how can a user (not owner) create table in a schema without grant create on schema
I've been trying for an hour to understand why my odi role, which is neither the owner of the public schema nor the database, can create tables in this schema.
| | odi=U/eos ...
0
votes
0
answers
204
views
About transaction performance issue in node postgres
I am a newbie to node.js, and meet a problem about transaction in node-pg.
In MVC, we use transaction via sqlcommand with sql string directly, like following:
BEGIN TRANSACTION
DECLARE @M int,@D int ,@...
0
votes
1
answer
65
views
My Node.js application through 'pg' module cannot make request/connection to the container running postgres database
Good morning,
I want my application running locally at my machine to connect to my PostgreSQL database running also locally in a container, so that I can perform CRUD operations. However, the problem ...
-1
votes
1
answer
2k
views
How to connect postgres database running on docker with nodeJS server using `pg` library?
I have a question regarding using the pg library to connect nodeJS with the Postgres database.
I'm running PostgreSQL & PgAdmin using docker, following this tutorial.
I've entered pgAdmin through ...
1
vote
0
answers
76
views
Not able to grant USAGE, SELECT permission to all sequences using node pg package
I am writing a script which creates a new user and give SELECT permission to all the sequences. The query I am running is GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO username. After ...
5
votes
1
answer
3k
views
NodeJs postgresql connection failure
I try to connect to rds postgresql version 12 from nodeJs as mentioned below. It works completely fine without any issue.
const config = {
user: process.env.PG_DB_USERNAME,
password: process....
1
vote
0
answers
1k
views
NestJs cannot use pg library
I've tried to add the following webpack config but it doesn't seems to work at all:
import webpack from 'webpack';
module.exports = {
webpack: (config, options) => {
config.plugins.push(
...