Category "postgresql"

PL/pgSQL SELECT into an array

Here's my function declaration and part of the body: CREATE OR REPLACE FUNCTION access_update() RETURNS void AS $$ DECLARE team_ids bigint[]; BEGIN SELECT

PostgreSQL could not receive data from server: Software caused connection abort (0x00002745/10053)

I tried to establish a connection in pgAdmin to the PostgresSQL server. I always get the message: could not receive data from server: Software caused connectio

Combined SELECT from unnested composite type array and regular column

I have a table my_friends_cards: id | name | rare_cards_composite[] | ---+---------+------------------------ 1 | 'timmy' | { {1923, 'baberuth'}, {1999, 'j

Generic Ruby solution for SQLite3 "LIKE" or PostgreSQL "ILIKE"?

I am using SQLite3 for development and PostgreSQL for deployment. However, I am facing the following problem: My simple search using SQLite3: def self.search(

Set sslmode=allow with pg_dump

I need to specify sslmode=allow when using psql to connect to my PostgreSQL DB, like: psql sslmode=allow -h localhost -p 5432 otherwise I get server does not su

TypeORM migration results in PostgreSQL error

I am having an issue running migrations with TypeORM (with the intent of establishing my database for use in local development). In running a migration on the i

Postgres - testing database connection in bash

I wonder if there is an alternative to the psql command to test the connection to a postgresql database using bash. I'm setting up a Core OS cluster and have a

How can I change the "Database Name" in AWS RDS for Postgresql?

I wanted to create a replicate of my production database for staging and created the staging DB instance from a production snapshot. However, this new instance

Strapi v4 PostgreSQL connection from local project to azure db

Trying to connect to an Azure PostgreSQL server from my local Strapi project (eventually deployed in a docker container). I have the connection configured accor

PostgreSQL Connection Refused

I have installed PostgreSQL. However everytime I try to connect through PGAdmin or through psql it gives me the below error. could not connect to server: Conne

Similar UTF-8 strings for autocomplete field

Background Users can type in a name and the system should match the text, even if the either the user input or the database field contains accented (UTF-8) cha

How to fix error "Error: Database is uninitialized and superuser password is not specified."

Hello i get this error after i run docker-compose build up But i get this error postgres_1 | Error: Database is uninitialized and superuser password is not spec

Doctrine2 Criteria convert 1 to TRUE

I've got a problem with Criteria from Doctrine2. Iusing Criteria to check a SMALLINT type in PostreSQL like this : $criteria = Criteria::create()->where(Crit

Auto increment table column

Using Postgres, I'm trying to use AUTO_INCREMENT to number my primary key automatically in SQL. However, it gives me an error. CREATE TABLE Staff ( ID

PostgreSQL asking for 'group by' clause in where, when sending parameters

I have a simple query in PostgreSQL which is ok when I run it without any query parameters : select date_trunc('week', action_time),count(*) from event

What happens after I add an index to a large table in a production Rails app and then migrate?

Rails 3.2 app running on Heroku with Postgres. I added an index add_index :lines, :event_id Events have_many Lines. There are about about 2 million Lines and

Facing this issue with creating a superuser

While trying to execute this command: (venv) sreekarsiddula@Sreekars-MacBook-Air bidgala % /Users/sreekarsiddula/piapps/venv/bin/python3 manage.py createsuperus

Best way to select random rows PostgreSQL

I want a random selection of rows in PostgreSQL, I tried this: select * from table where random() < 0.01; But some other recommend this: select * from table

Is there way to use pg_cron from the google cloud sql?

Currently I need to move my database from postgreSql to google cloud sql. I use pg_cron to remove stale records like this: SELECT cron.schedule('30 3 * * 6',

Create PostgreSQL ROLE (user) if it doesn't exist

How do I write an SQL script to create a ROLE in PostgreSQL 9.1, but without raising an error if it already exists? The current script simply has: CREATE ROLE