Category "postgresql"

Create a postgresql function that returns a string 'fall', 'spring' depending on year

I need to create a function that returns the string 'fall' or 'spring' depending on the month of the year. If the function was named getterm and took no paramet

Malformed MIME header error in Symfony 5.3

I'm working on a project with Symfony 5.3 with PHP 8.0.12. I've been developing it on my own computer, it's working well. I now want to deploy it on a remote co

PostgreSQL 12.2 with Sequelize 6.3 - UPSERT a array of data and want ON CONFLIT DO UPDATE to merge current existing JSONB and EXCLUDED JSONB

I'm currently using this query to insert or update my array of data when retrieving my list : try { const query = `INSERT INTO "Tables" ("id","tomerge

Error: 'duplicate key value violates unique constraint' even when checking with 'where not in'

I get the error: 'duplicate key value violates unique constraint' even when checking if the primary key is already in the table in which I want to insert. I ha

Laravel database insert with combining array and string

I should insert an array such as $attendanceList = [18354012,18354013,18354014,18354015] and $present = "FALSE" and same for all item of $attendanceList. As you

Spatial database architecture with Apache Parquet, PostgresSQL and PostGIS on on-premises bare-metal S3/MinIo cluster

Designing storage architecture for Petabyte-scale geospatial data; starting from scratch. Creating a MinIo cluster to store the objects in S3 buckets. To store

Create a procedure to fill a new table

I am new to PostgreSQL and am struggling with the creation of a procedure to save the data in a new table. This is how the empty table is created CREATE TABLE e

How to decrease storage size for PostgreSQL on Google Cloud?

I moved some of my data from PostgreSQL to BigQuery. Before PostgreSQL database was using 130 GB of storage, now I only need 30GB. However, in the Google Cloud

Remove duplicate entries from string array column of postgres

I have a PostgreSQL table where there is column which has array of strings. The row have some unique array strings or some have duplicate strings also. I want t

Typeorm How Can I get Min field with Where clause?

I use Typeorm and nestjs in my project. I have Schema: export class GroupEntity implements IGroup { // Attributes @PrimaryGeneratedColumn({ type: 'string' }

Results of group by null values are lost

I have table which has productId and productVariantId columns. |id |userId|productId|productVariantId| ---------------------------------------- |1 |1

How to reset postgresql database on Mac

So, I'm currently working on Odoo and Postgresql. For some reasons, the database I tried to delete keeps appearing on pgAdmin. I have tried solving the problem

Prisma ORM Postgres SQL DB Schema Not Null Fields

Just so you have it here is my defined prisma schema. Now if I read correctly in the prisma docs it said, that every field in which I do not declare a ? after t

Add a column with a default value to an existing table in postgresql

Question: Is there a postgres query to add a new column to an existing table and to automatically populate that column for all rows of the table with a certain

Filtering relations with 'include' and 'where'

I'm building a simple todo app where a user can have multiple lists and share them. Here is my Prisma Schema: model users { id String @

what is the meaning of && in PostgreSQL?

In PostGIS, what is the result of the && operation between two geometries? In my mind, && returns a boolean, but does return geometry this time.

How To Sum Count Result?

I have a database that will count daily total amount of customer that does or doesn't have a transactions. Customer Column is a varchar data type Here is how

How to Run Postgresql procedures with Knex in Node js

I am trying to call a stored procedure saved in the public schema using: const schema = await knex.raw("call create_schema(?, 'col1', 'col2', 'col3', 'col4', 'c

postgresql not installed but homebrew reports it is

I've never had an issue like this before - normally brew install postgres works and everything is fine. I've had instances with this machine where I see "Mac OS

docker chainlink container not connecting to postgres database

I want to run chainlink node on my local ubuntu machine. I used the following commands to install postgresql: sudo apt install postgresql adjusting firewall se