Category "postgresql"

Postgres query is getting lock while executing through shell script

The below query is getting locked by executing through perl ALTER TABLE base_table DETACH PARTITION part_table; By using this query select pid,state,

Python list overwritten each time the previous items

The objective of my application is to create a copy of documents and insert them into the database for each annotator, for example, let's say the master user ha

Error changing owner in Azure Postgres with superadmin

I hope anyone can tell me what I am doing wrong here. I have upgraded an Azure Postgres PaaS database from version 10 to 11. I've just followed the Microsoft gu

Node.js Postgresql problem querying database using 'pg' module

I'm trying to insert data into a 'users' table inside a postgresql database using the 'pg' NPM module. But when I make a POST request, the transaction executes

Error: P1001: Can't reach database server at `localhost`:`5200`

Technologies I use: nestjs -> for backend prisma -> for orm postgresql -> database I'm trying to run these technologies using Docker but I'm running in

PostgreSQL - How to get month/year even if there are no records within that date?

What I'm trying to do in this case is to get the ''most future'' record of a Bills table and get all the record prior 13 months from that last record, so what I

Closing a PostgreSQL Client Connection in Rust

I am new to Rust and I am using the Postgres crate. I am trying to create a wrapper around the PostgreSQL client, and I have defined this Struct: pub struct Pos

Aurora postgres slect is slow

I'm trying to figure out what is causing the Aurora RDS Postgres database to deteriorate in terms of performance over time. I have a quite big table in a multi

How do I cap number of rows in based on category using postgres policies?

I have a database of orders and each order has a time_slot (of type TIME). select id, time_slot from orders limit 5; 10 | 13:00:00 11 | 12:00:00 13 | 11:00:

How to handle data in development, staging and production databases?

If you have a local database, Staging/UAT database, Production database 1)Say 10 developers have the database script to generate the database (I'm using liquiba

How to list column elements separated by comma

I have a table which contains the locations, the actors and activities complete by actors. Please see the example on the below image. enter image description he

Can't upgrade heroku postgres from hobby tier to standard

I followed this guide in order to upgrade the plan for postgres: https://devcenter.heroku.com/articles/updating-heroku-postgres-databases#updating-with-addons-u

How to create Liquibase changeset for below Postgres index creation statement - "using btree"

create index if not exists department_index on department using btree (department_id); How can I create a Liquibase changeset for the above Postgresql? I h

How to Add Multiple JSON_BUILD_OBJECT entries to a JSON_AGG

I am using PostgreSQL 9.4 and I have a requirement to have an 'addresses' array which contains closed JSON objects for different types of address (residential a

Pandas DataFrame to PostgresSql (pandas.io.sql.DatabaseError)

Am new to Postgres. Anyone can tell how to have it work? What I want to do is to write Pandas datataframe to PostgreSQL database. I have already created a datab

How to speed up large copy into a Postgres table

I'm trying to load a large dataset (25 GB) into a Postgres table. The command below works, but it takes 2.5 hours and fully utilizes 3-4 cores on the machine th

DateTime without time / only data? It is possible in Prisma?

I can in Prisma create columns without data, without time? my model at the moment: model modelName { id Int @id @default(autoincrement()) creat

PostgreSQL restoration throwing error : replication slot does not exist

Environment: Postgresql 13.x (dockerized) I was trying to test the DR setup for PostgreSQL nodes. pg_basebackup and wal_files archive was taken from the standby

PostgreSQL year, quarter calculator

Given a year and a quarter, a procedure should INSERT values into table tb_quarter, which is empty and have this structure: CREATE TABLE erp.tb_quarter (

Postgresql - Renaming the key of all objects in an array of a JSON column

PostgreSQL 13 The goal is to rename all src keys in the photos array to image. I have a table plans which has a column json with a simplified structure similar