Category "postgresql"

Is there any way to speed up this Postgres bitmap heap scan?

Database newbie here. This is my query, I'm using Postgres 9.3.5: =# explain analyse SELECT SUM(actual_cost) as cost, SUM(total_items) as num_items, proces

sqlite IFNULL() in postgres

What is the equivalent of SQLite's IFNULL() in Postgres? I have to following query (sqlite in Ruby): SELECT ifnull(max(code_id) + 1, 1) FROM configentries W

Translating an Excel concept into SQL

Let's say I have the following range in Excel named MyRange: This isn't a table by any means, it's more a collection of Variant values entered into cells. Exce

Using List inside a postgres Query

i have a dynamic list. list=['a','b','c','d' ..... ] so length may change i want to compare these list values in a query select * from student where name i

Postgresql pglogical subscription is down

I want to setup logical replication between two postgresql 9.5 servers. I could make it work on two virtual pc-s but when I try to do it on our production machi

Is there a way to match patterns from one column to other one?

I want to use club position and check if preferred_position contain the string then return True/False value for each row. Club_position Preferred_position RM R

How can I create a TypeORM Postgres connection with Heroku using Typegraphql?

I want to create a TypeORM Postgres connection with Heroku using Typegraphql, but I receiving the following error message: 'createConnection' is deprecated.ts(6

postgresql: FATAL: password authentication failed for user "douglas"

I am trying to migrate a DB from sqlite to postgresql...so I typed: sudo -u postgres psql postgres=# ALTER USER postgres WITH PASSWORD 'newpassword'; and the

How to get definition/source code of an aggregate in PostgreSQL?

I found this related answer useful: Export "Create Aggregate" functions from PostgreSQL But how do I get the CREATE AGGREGATE statement without a GUI client (

How to group multiple columns into a single array or similar?

I would like my query to return a result structured like this, where tags is an array of arrays or similar: id | name | tags 1 a [[1, "name1", "color1"

Combining Python variables into SQL queries

I am pulling data from an online database using SQL/postgresql queries and converting it into a Python dataframe using Pandas. I want to be able to change the d

Delete duplicates from a huge table in Postgresql

I have an unusual problem: I need to delete duplicate records from a table in Postgresql. As i have duplicate records so i dont have primary key and unique inde

How can I fetch a NULL boolean from Postgres in Go?

Go's zero value for a bool type is false. Postgres supports an undefined BOOL type, represented as NULL. This leads to problems when trying to fetch a BOOL val

How to Go/Gorm a megamenu?

I'm writing an e-commerce app in Go, and I've been stuck on the megamenu for a while now, trying to implement it with PostgreSQL tables. The end result, JSON re

I am looking for a replacement for pgsync. Looks like the library is not supported anymore. How to sync between postgresql and elasticsearch?

Someone from the backend development side, please help with the below. we have a site driven by Postgres. We also have a elastic search implementation to make f

How to select tables under replication in Postgres or List databases under replication in Postgres

I am having 3 Node Postgres cluster and want to know tables/databases which are under logical replication. The issue I am facing is when the leader/master node

JBPM Business central - Data set not working with aggregate function

I have an issue with the Data set - Execution server. I am using PostgreSQL as DB. I want to calculate the difference between the two dates column for my report

PostgreSQL timezone takes Windows OS timezone automatically

While installing Postgresql DB 13.0-1 x64 on Windows, if I comment the "timezone" key on postgresql.conf file then "show timezone" sql query gives me "GMT". How

How to export table data from PostgreSQL (pgAdmin) to CSV file?

I am using pgAdmin version 4.3 and i want to export one table data to CSV file. I used this query COPY (select * from product_template) TO 'D:\Product_template

How to export table data from PostgreSQL (pgAdmin) to CSV file?

I am using pgAdmin version 4.3 and i want to export one table data to CSV file. I used this query COPY (select * from product_template) TO 'D:\Product_template