Questions tagged [postgresql]

0 votes
1 replies
Knex, Postgres, and STRING_ARRAY: getting different results
I was testing out a query here using STRING_ARRAY: http://sqlfiddle.com/#!17/952405/1 Also here: SELECT to_char(workshop_date, 'YYYY-MM-DD')...
0 votes
1 replies
PG::SyntaxError at /bookmarks - I'm unable to work out why the SQL query is wrong
When running my application using sinatra, I get the error message PG::SyntaxError at /bookmarks ERROR: syntax error at or near "{" LINE 1: SELEC...
asked 4 months ago
1 votes
0 replies
Spring Boot Data JPA dropping commits with Postgres 9.5
Recently, my application has been seeing commits dropped and I am totally puzzled. No logs, no errors, everything continues as if things would be...
0 votes
1 replies
ActiveRecord speed up `where.not` query
I have a query that is taking getting significantly slowed down when an not clause is added to the query. # query is 13.6ms FbGroupApplication....
asked 4 months ago
0 votes
0 replies
PostgreSQL logical replication stacks with error 'could not receive data from WAL stream: server closed the connection unexpectedly'
I have logical replication established between 2 PostgreSQL servers (PostgreSQL 10.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.3 20140911...
asked 4 months ago
0 votes
0 replies
hibernate ddl validation smallint vs int2
I have a legacy application that I want to upgrade to JPA. For local development and testing I have configured an H2 in-memory database, on the t...
asked 4 months ago
1 votes
1 replies
How to export schema only for Postgres
I have a very big PostgresSQL database. I would like to dump the schema only. Running pg_dump -s myschema -f /dump.sql runs forever, so I supp...
asked 4 months ago
0 votes
2 replies
Cumulated sum based on condition in other column
I would like to create a view based on data in following structure: CREATE TABLE my_table ( date date, daily_cumulative_precip float4 ); IN...
0 votes
1 replies
Does migration in a DB automatically gets reflected in read replica?
I created a read replica from Postgres DB in AWS RDS. Now if I run a migration in main DB will the read replica automatically migrate? 0 1 A...
0 votes
1 replies
Checking on unique email in Psql database
I'm building a website with a login system and I want to check if the given email isn't already in my database. But I can't get this to work and...
asked 4 months ago
1 votes
1 replies
Understanding keepalive between client and cockroachdb with haproxy
We are facing a problem where our client lets name it A. Is attempting to connect DB server (Cockroach) name B load balanced via ha-proxy A <...
0 votes
1 replies
Querying data by empty json or with error data
I have a table in Postgresql that have a jsonb column. This column can have 3 types of data, in the following structure: [] if the result is e...
asked 4 months ago
0 votes
1 replies
Postgresql get keys from nested array of objects in JSONB field
Here' a dummy data for the jsonb column { "address": [ { "country": "US", "extension": [ { "extension": [ { "val...
asked 4 months ago
0 votes
1 replies
How to extract a number (price) from description
Item price is in format 999,99 999 - 1 ..4 digits , - comma sign marks decimal point 99 - 2 digits after price Postgres 9.1 table contains...
0 votes
1 replies
Sequelize.js postgres LATERAL usage
I have a postgres table with JSONB field. json contains array of objects | id | my_json_field | ---------------...
asked 4 months ago
0 votes
1 replies
ltree concatenation fail when using fields but succeed when using literals
with a very simple table like this create table matpath ( obj varchar primary key, path ltree ); I'm trying to get run the following q...
asked 4 months ago
0 votes
0 replies
Unable to connect server despite deleting all instances and doing a fresh install of both postgresql and pgadmin 4
I have been getting this error recurrently when my server refuses connections. I usually did a fresh installation of postgres to delete all confi...
asked 4 months ago
0 votes
1 replies
DATABASES is improperly configured rds postgres django
I had deployed my django app on elasticbeanstalk but when I am connecting with rds is shows this error: ImproperlyConfigured("settings.DATABA...
-2 votes
1 replies
How to save sessions in a Postgres database?
In one of our new projects, we want to store the session data in to a PostgreSQL database. I have found several code snippet on the internet to...
asked 4 months ago
0 votes
0 replies
postgres: alter user not updating the password
I am setting up postgres on a docker container. if [ "$POSTGRES_DB" != 'postgres' ]; then createSql="CREATE DATABASE $POSTGRES_DB;" echo $cr...
asked 4 months ago
1 votes
0 replies
Postgres: copy database from one server to another on AWS RDS using PGAdmin
I have 2 postgres database instances on my aws account, basically they both run different engines of postgres and there is no way to downgrade. s...
0 votes
0 replies
How to select different row from a table each time a function is called?
I could use some help with generating data into my database. I have two tables with same number of rows. One of them(T1) has a foreign key refer...
asked 4 months ago
-1 votes
0 replies
INSERT has more target columns than expressions db-migrate nodejs
db.runSql( 'insert into skill_set_related_position (skill_set_id, create_by, update_by, position_id)\n' + ' select (m2.id, 0, 0, p2.id)\...
asked 4 months ago
-1 votes
1 replies
How to get last Sunday including today in PostgreSQL?
Is it possible to get last Sunday in PostgreSQL including today's day? For example if today is Sunday expression returns today's date. If today...
asked 4 months ago
0 votes
2 replies
Unique set of relationships to a table in a many to many relationship
Say we have Parent1, Parent2, Child1 and Child2. If Parent1 is related to both Child1 and Child2, then how to forbid Parent2 relating to both Ch...
asked 4 months ago