How do I force Postgres to use a particular index?

How do I force Postgres to use an index when it would otherwise insist on doing a sequential scan?

Copy a table from one database to another in Postgres

I am trying to copy an entire table from one database to another in Postgres. Any suggestions?

Rails: Error installing pg gem

Possible Duplicate: Postgres - the last version 0.14.0 of the “pg” gem gives error I'm new to rails. I want to use PostgreSQL since Heroku uses it too, but I'm having a bad time installing...

psql: FATAL: database "<user>" does not exist

I'm using the PostgreSql app for mac (http://postgresapp.com/). I've used it in the past on other machines but it's giving me some trouble when installing on my macbook. I've installed the...

How to detect query which holds the lock in Postgres?

I want to track mutual locks in postgres constantly. I came across Locks Monitoring article and tried to run the following query: SELECT bl.pid AS blocked_pid, a.usename AS...

What is the right way to work with slick's 3.0.0 streaming results and Postgresql?

I am trying to figure out how to work with slick streaming. I use slick 3.0.0 with postgres driver The situation is following: server have to give client sequences of data split into chunks...

Load Postgres dump after docker-compose up

I have a dump.sql file that I would like to load with docker-compose. docker-compose.yml: services: postgres: environment: POSTGRES_DB: my_db_name POSTGRES_USER: my_name ...

postgres full text search and spring-data hibernate

I have a table with the following columns: id, url, content So there are lots of records with url, content where to search, etc I need to write a query in postgres 9.5 which takes my custom search...

Django Postgres objects.create ValidationError

How do you sync Django's ids with Postgres without losing data? I somehow got Django into a weird state where I can no longer create objects. A call to: throws the error: Traceback (most recent...

How can I ask user to enter the input in PostgresSQL/plpgsql?

Hi I want to take input from user in my DO BEGIN and END block... I tried to use /prompt inside but it doesnt work. Do we have any other way that we can use it inside function or block in postgres?

Postgres container crashes with `database files are incompatible with server` after container's image has been updated to the latest one

Postgres container crash on launch with the following error message (project) ➜ project git:(feature/62-api-custom-image-categories) ✗ docker-compose up postgres Starting project_postgres_1...

Remove a named volume with docker-compose?

If I have a docker-compose file like: version: "3" services: postgres: image: postgres:9.4 volumes: - db-data:/var/lib/db volumes: db-data: ... then doing docker-compose up...

Estimate/Print csv COPY status to postgresql table

I want to get an idea of how long it will take to copy a csv to a postgresql table. Is there a way to print the rows copied in a reasonable fashion or is there another way to somehow display the...

postgresql logical replication - unable to drop subscription

While testing different scenarios, I run as advised: alter subscription mysub set (slot_name = NONE); drop subscription mysub; I get an error now: postgres=# select...

Create new local server in pgadmin?

I have PostgreSQL 11 and PGadmin 4 installed on windows. Currently I'm connected to a AWS server which hosts all of my data. I want to create a local server (localhost) as a testing environment...

Keycloak can't connect to Postgres: "SSL connection is required"

I'm setting up KeyCloak on my Azure-Kubernetes-Cluster. KeyCloak is supposed to connect to my Azure-Postgres Database. It Fails with: "FATAL: SSL connection is required. Please specify SSL options...

TypeError: 'datetime.datetime' object does not support indexing

I am having difficulty querying all data from a table during the last 24hrs and it is difficult to say if its a postgres error on my part of python since im a beginner I see the "publishedAt"...

Odoo 12 docker compose doesn't display mounted extra addons

I'm in search to create an extra addons on my odoo. I've created an addon, and I've set in my docker compose file to mount the folder containing my addon on a folder into my odoo docker image...

TypeORM: Dynamically set database schema for EntityManager (or repositories) at runtime?

Situation: For our SaaS API we use schema-based multitenancy, which means every customer (~tenant) has its own separate schema within the same (postgres) database, without interfering with other...

Postgres LEFT JOIN as json object property

We have two tables: book: id | title| author_id authors: id | name How to left join authors for one-to-one relation into property of object book with 'author' alias: { id title author_id ...

How to update multiple rows with values of two arrays in Postgres?

I need to update a set of records in the x table with values stored in arrays. Anyone know how I could do it? IDS_NEW_SPONSORS INTEGER[] := ARRAY[]::INTEGER[]; --possible values...

Alembic operations with multiple schemas

NOTE: This is a question I have already found the answer for, but wanted to share it so it could help other people facing the same problem. I was trying to perform some alembic operations in my...

Error creating a connection to Postgresql while preparing konga database

After installing Konga, we are trying to prepare Konga database on the already running Postgresql database. by using suggested command i.e. node ./bin/konga.js prepare --adapter postgres --uri...

psycopg2.errors.DuplicateTable: Relation "uac_c2_py" already exists

It's the first time i post in here, so i'm sorry if i'm not following the best practices yet. I've developed a code (let's say "cod1") to basically do the following actions: write data from a db...

connecting aws rds(postgres db) and sqs

i have a postgresql database in amazon rds,i want to send a message to aws sqs when there is a new record inserted in to the database tables, how can i do that??

Docker and Flutter Web hot reload

I'm trying to web development environment with Flutter in docker with docker compose. *I stuck with a hot reload for Flutter, is there any way to make it work? (except installing VSCode on...

Installing OpenVAS on Kali / Debian problem with PostgreSQL version

After installing OpenVAS on Kali linux, ran gvm-setup command to setup GVM as per instructions: https://linuxhint.com/install-openvas-kali-linux/ However, the following error ocurred: ERROR: The...

Issues testing a FastApi app using TortoiseOrm as a database layer

I am having issues with testing a FastApi app using TortoiseOrm as a database layer. Please find below a minimal reproducible example. The example is a small API with 2 endpoints that accept get...

SCRAM-SERVER-FIRST-MESSAGE: client password must be a string

Ive read documentation from several pages on SO of this issue, but i havent been able to fix my issue with this particular error. throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: client...

Python testing.postgresql error: The program "postgres" is needed by initdb

We have some python unit tests that use testing.posgresql, however I cannot get them to work for me on my machine (Windows 10). I get the above error about initdb needing postgresql but not being...