Category "postgresql"

Rails, is find_by().present? more performant than where().exists?

This question arose from me doing 2 types of performance tweaks: changing a lot of my where().present? statements to where().exists? changing a lot of my where(

Is connceting Node JS to database sufficient while developing an app on react native?

I am doing a project and am very new to coding, while developing an app i want to connect my app to Postgresql database. So, is connecting to Node JS sufficient

pg_restore -h '[CREDURL]' -d [CREDNAME]< out.sql returns error and nothing happens to my database

Password authentication fails for herokupush access to localdatabase since the PGUSER is wrong but SET PGUSER=postgres doesnt seem to affect it. pg_restore -h

PostgreSQL subqueries as values

I am trying to use a postgreSQL INSERT query with a subquery as parameter value. This is to find the corresponding user_id from an accompanying auth_token in us

Created Field(DateTimeField) auto_now_add=True is not working in Abstract Class in Django

class TimeStampMixin(models.Model): id = models.CharField(max_length=60,editable=False,primary_key=True,default=generate_unique_id) created = models.Dat

Unable fetch metrics from postgresql://pgbouncer:***@vsaxx:6432/pgbouncer", "exception": "invalid integer value \"xxx\" for connection option \"port\"

I am deploying the prometheus-pgbouncer-exporter to kubernetes by helm chart. Although pods in this namespace is running, the log of pods always show this error

Translating date range query from MySQL to Postgres

There is a mysql query, and I need to implement it in a postgresql query. create table objects( object_id int NOT NULL PRIMARY KEY , city_id int not null , p

PostgreSQL: Cannot use numbers as tags for dollar quoted strings

How do we use numbers as tags for dollar quoted strings? INSERT INTO table(user_id,user_data) values (22176,to_jsonb($123${"name": "Helo. $ what is this $"}$12

Can results of a dynamic query feed into a CTE?

Successfully generating a dynamic query based on input parameters. Now, I want the results of this dynamic query to be fed into a Common Table Expression (CTE).

EMR - Airflow to run scala jar file airflow.exceptions.AirflowException

I am trying to run a scala jar file from AIRFLOW using emr and the jar file is designed to read mssql-jdbc and postgresql. From airflow, I'm able to create clus

Cron access to PostgreSQL in Docker

I've created a PostgreSQL instance via Docker and I can create tables and insert data etc fine. The issue is when I use crontab to do this. I'm using a Python s

Node-Postgres Error: timeout exceeded when trying to connect

We have a production deployed Node js application which services a good amount of traffic throught the day. The application is in loopback and connects to postg

Cannot create Table in graph schema , Agensgraph

I am trying to import Northwind dateset as mentioned in this tutorial 'https://bitnine.net/tutorial/tutorial_eng.html?ckattempt=1', I did the same process but w

How to select distinct on "name" using Sequelize?

I need to translate the postgresql query below select distinct on (name) * from users To seqelize query / condition . Currently I am just selecting all users f

configuring Airflow ssh connection in google cloud composer

I'm trying to configure a SSH connection from Airflow UI on google cloud composer environment to an on premise posgresql server Where I should store my private

NodeJS Cannot Connect to Postgres at Dockerized Environment

I am trying to run a NodeJS application on Docker. However I get that error: could not connect to postgres: Error: connect ECONNREFUSED When I debug the proble

ST_MakeEmptyRaster makes in geovalue worth 10000 and such when I want normal geodata

I have here made a demo of my attempt turn points on a map with values then use St_interpolateraster and than send it back as geojson. It returns values and the

How to use sql NOT operator in sqlalchemy

I have a simple table with an int[] column and I would like to be able to select rows that do not contain a specified user. And I can't figure out how to do it

InvalidCursorName : Django Admin error referencing wrong column in ForeignKey

I've setup a relationship using django's ForeignKey against 2 unmanaged tables like so: class Product(BaseModel): publish_name = models.CharField(unique=Tru

Fill nulls with lag, but ignore nulls isn't supported

I have a table which looks like this: ID money_earned days_since_start 1 1000 1 1 2000 2 1 null 3 1 3000 4 1 2000 5 2 1000 1 2 null 2 2 100 3 I want that rows