Category "postgresql"

How to use postgres database when generate jooq by LiquibaseDatabase

There is pretty good guide how to use code generation from liquibase However by default it uses h2 database to create schema from migrations and then generate r

How to install PgBouncer on Windows 7 (x64)

I am attempting to install PgBouncer on my computer with no success. In the installation page, im told that PgBouncer has two dependencies GNU Make 3.81+ and

Update a PostgreSQL field from the content of a file

I have a file containing a value which should go into a field of a PostgreSQL table. By searching a little, I found many answers, e.g. How can I update column v

How to install PgBouncer on Windows 7 (x64)

I am attempting to install PgBouncer on my computer with no success. In the installation page, im told that PgBouncer has two dependencies GNU Make 3.81+ and

pg_dump fails with error: `FATAL: role "username" does not exist`

I have a db named backupdb, I want to import this to my local rails app so I want to take a dump of it. When I am running pg_dump backupdb, I am getting below

Postgresql ERROR: cannot drop columns from view

I'm new to postgresql. Can anyone suggest the reason and solution to this error? However it works if I select an extra sum(s.length) but i don't won't this in m

PostgreSQL: encoding problems on Windows when using psql command line utility

I'm working in a centralized monitoring system on Windows 2008 R2, I have installed a PostgreSQL 9.3 to use psql from the command line. When I try to access to

How to configurate the home client in dbeaver for Postgresql

I'm am tryng to import a database, however i'm getting this message : Client home is not specified for connection I guess that i have to configurate the clien

How to get the latest message in each conversation of a certain user in SQL?

I need to write a query that returns the latest message in a conversation between two users. I've included the schema and my (failed) attempts in this fiddle: h

Django model doesn't get saved to database inside Celery Task

I've hit a really nasty situation. I have the following setup. I have a django model representing an FSM with a django FSM field I have a celery task that sen

Gorm and Gin error 500 only when Updating

I've a pretty simple CRUD for a Task list, and so far I'm able to Create, List all, List by ID and Delete records, bu when I try to update, it gives me the foll

Declare variable set = select

How do I declare a variable for used in a PostgreSQL 9.3 query? CREATE or replace FUNCTION public.test() returns int4 AS $BODY$ DECLARE cod_process bi

Power BI - Data Load Error- OLE DB or ODBC error: [DataSource.Error] PostgreSQL: Exception while reading from stream

My question might look similar to some earlier posts but none of the solution has answered what is the rootcause of this behavior. I would try to explain what I

The right way to DI NpgsqlConnection postgreSQL with multiple connectionString in ASP.NET Core 3.1

I'm struggling to register DI NpgsqlConnection() with multiple connection strings in ASP.NET Core 3.1, Dapper v2.0.78 & Postgres v11. I will provide the cur

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