Category "postgresql"

How to concatenate columns in a Postgres SELECT?

I have two string columns a and b in a table foo. select a, b from foo returns values a and b. However, concatenation of a and b does not work. I tried : sel

GROUP BY + CASE statement

I have a working query that is grouping data by hardware model and a result, but the problem is there are many "results". I have tried to reduce that down to "

Querying data in postgresql by applying filter on a JSONB column

I have a table with 2 columns; ID (int) and EntityData (JSON). I have created a filter object in form of a Dictionary in C#. I want to fetch all rows which sati

Convert a UTC timezone in postgresql to EST (local time)

I am new to PostgreSQL and I was wondering if there is a direct way to just convert the timestamp values in a table to a different timezone using a function. In

Postgres function to update old data and insert new data

I am trying to write a function that when my script pulls information from AD that it inserts new entries that don't exist and then update the ones that do exis

how can i specify the migrations directory for typeorm CLI

After the new typeorm release a have some troubles to work with migrations. Some time ago i was using that code and it work entities: ['./src/modules/**/infra/t

PostgreSQL: List of views/table rules that depend on a given table

How can I find all Views and Tables with rules which depend on a given Table? I need this in order to find which views and tables I have to check if I want to

Multiple postgres connections with debezium connector

When I create a kafka connect connector with the debezium connector, it results in four database connections. Three of them remain idle, while one works as the

Docker not starting, volume permission denied error

i am trying create postgresql container with this command in windows with WSL 2 integration enabled docker run -d --name pg-docker --restart=always --publish 54

What's the PostgreSQL equivalent of $mysqli->connect_error?

If mysqli error is thrown while connecting to database, it could be detected as below. if ($mysqli->connect_error) { $this->Session->setFlash(__('

Insert null values to postgresql timestamp data type using python

I am tying to insert null value to a postgres timestamp datatype variable using python psycopg2. The problem is the other data types such as char or int takes

Can't run the server on Django (connection refused)

I finally (think) installed successfully PostgreSQL and also de psycopg2 (I use Windows). Btw, is some way to check it's working properly? Well, the thing now

PostgreSQL out of memory: Linux OOM killer

I am having issues with a large query, that I expect to rely on wrong configs of my postgresql.config. My setup is PostgreSQL 9.6 on Ubuntu 17.10 with 32GB RAM

WHERE col IN Query with empty array as parameter

From example where-col-in example and this answer, WHERE IN clauses should have query with parameters with following syntax const response = await db.any('SELE

How to avoid multiple function evals with the (func()).* syntax in a query?

Context When a function returns a TABLE or a SETOF composite-type, like this one: CREATE FUNCTION func(n int) returns table(i int, j bigint) as $$ BEGIN RETUR

Adding LIMIT to ARRAY_TO_JSON or ARRAY_AGG

In a 2-player game using PostgreSQL 9.6.6 as backend I have defined the following custom stored function for retrieving chat messages for a user: CREATE OR REP

What does GRANT USAGE ON SCHEMA do exactly?

I'm trying to create a Postgres database for the first time. I assigned basic read-only permissions to the DB role that must access the database from my PHP scr

PostgreSQL Exception: "An I/O error occured while sending to the backend"

I am testing some code which processes registration to a website. The java code is as follows (excerpt): if (request.getParameter("method").equals("checkEmail"

How I can access postgres log_connections logs

I see that log_connections enabled by default on Heroku PostgreSQL instance, but how I can get this log?

Setup Django Postgres database

I created the django app, I have it connected to my local server with pgAdmin3. I want to have the django app push to bitbucket. But the problem is: How do I s