Category "postgresql"

node and express - how to use fake data

It's been a while since I used node and express and I was sure that this was possible, but i'm having an issue of figuring it out now. I have a simple postgres

How to generate CREATE TABLE from Kotlin data class

In Kotlin, I'd like to generate a Postgres CREATE TABLE from my data class. For instance, if we have the following: data class Thing(name: String, quantity: Int

How to generate CREATE TABLE from Kotlin data class

In Kotlin, I'd like to generate a Postgres CREATE TABLE from my data class. For instance, if we have the following: data class Thing(name: String, quantity: Int

Parameter substitution when calculating the distance between each row and a common point results in psycopg2 parse error

I have two models with no relation Port and a WareHouse each with a lat and long fields. I want to be able to get the distance for each warehouse from the Port

AWS SCT error while connecting to PostgreSQL 13.4

I get the following error when trying to connect to postgres as a target using AWS SCT: LOADER ERROR: Error executing 'load-contexts' query: org.postgresql.util

SQL referrals view

I have a table with users: id referred_by_user_id ----------------------------------- 1 null 2 1 3 1 4

Debezium with RDS postgres and master-replica failover

I have an RDS multi-AZ postgres database (primary-standby) and I'm investigating Debezium to stream changes to Kafka. I was reading the documentation of what co

How can I do a loop "do/while" to insert some data to Postgres Database?

I did this class to do the inserts but every time I need insert again, I need initialize the method main of this class again. Because it is in just one cycle. p

Migration from dataSource get the error: Cannot execute operation on "default" connection because connection is not yet established

My typeorm version is 0.3.6. Whenever i tried to use dataSource.runMigration() i get this error, MIGRATION ERROR:CannotExecuteNotConnectedError: Cannot execute

PGSQL query to get all records of a column containing line breaks

What is the shortest Pgsql query to get all records that contain a line-break in a given column ?

can't have email on existing user golang

I'm trying to check if an user already have a email. I wrote a function like this : func IsUniqueEmail(body io.ReadCloser) (database.User, error) { connection :

ValidationFailedException after Liquibase update to 4.9.1

We were using older Liquibase that we now wanted to update to 4.9.1 due to vulnerabilities in older versions. However, now at least one of our old migrations fa

How to create a new postgresql database via ubuntu shell

I’m doing; createdb -O dan -h 127.0.1.1 -p 5432 -U dan -w testdb but it throws me: fe_sendauth: no password supplied Then I tried to remove -w and it a

Postgres TypeORM - FK to PK that is also FK to another table - constraint error

In my NestJS application with postgres db I have these 3 entities: User, Writer, Book and a class named UserBaseEntity. export class UserBaseEntity { @Prim

DELETE CASCADE in PostgreSQL extremely slow

I have a table "studies" with 14 subtables that are connected to "studies" via a foreign key that refers to the primary key in "studies". I need to delete all r

How to import database from odoo 14 to postgresql?

I am trying to take a backup from Odoo enterprise 14 through query. When I try to export the dump file I get this message Can anyone guide me, how to export all

postgresql function with list of arrays as input

I want a postgresql function that will take a list of arrays, and loop through them. I have written a "hello world" type function that takes a single array and

PostgreSQL first query slow

I implemented cursor pagination. And for first rows it works realy well but the more I scroll down, the first query I send is slower. I run this query: SELECT *

How to convert UTF8 data from PostgreSQL to AL32UTF8 Oracle DB?

I have a task to import some data from Postgres database to Oracle via dblink The connection between Postgres and Oracle works good, but unfortunately, when I t

Referencing JOIN columns within a subquery from an aggregate function

I'm trying to reference columns in JOIN tables of a subquery from an aggregate function, as follows: WITH my_activities AS (SELECT activities.*, owner.*