Category "postgresql"

How can I check postgres database in docker volume?

I followed the tutorial from prisma.io to get started building a local server. Follow the docker-compose.yml: version: '3' services: prisma: image: pris

Using LIMIT / ORDER BY with pg Postgres NodeJS as a Parameter

I have a model with calls the products with SORT/PAGE/PER PAGE It works fine with numerical values as parameters but not strings. This works fine... params.lim

Column is of type timestamp without time zone but expression is of type character

I'm trying to insert records on my trying to implement an SCD2 on Redshift but get an error. The target table's DDL is CREATE TABLE ditemp.ts_scd2_test (

postgres C:: Permission denied using windows

I am using Windows 10 I have a PostgreSQL file when I run inside the PSQL CMD \i FILENAMEPATH postgres=# \i C:\Users\Asus\Desktop\Projects\Movies\solution.sql C

SQLAlchemy (psycopg2.ProgrammingError) can't adapt type 'dict'

Couldn't find a solution on the web for my problem. I am trying to insert this pandas df to a Postgresql table using SQLAlchemy Pandas 0.24.2 sqlalchemy 1.3.

Postgres Subquery - How to create ALIAS in object format from subqueries

I am trying to wrap several queries into 1 complex query. Here is the scenario. Given a user_id of 'xxxxx-xx-xxxxx' I have to query for several data points with

Postgres Join tables and create new field if join exists

I'm new to Postgres and I have a confusing one. Basically, I want to find if my post is bookmarked by the user or not in a new field bookmarked = true / false H

Deterministic sort order for window functions

I've a status table and I want to fetch the latest details. Slno | ID | Status | date 1 | 1 | Pass | 15-06-2015 11:11:00 - this is inserted first 2

Transpose rows to columns in PostgreSQL?

Does any one know how to transpose rows to columns in PostgreSQL? For example I have the following table:- Period T1 T2 D

Trying to persist not discovered entity of type object

The problem I'm new to Nest.js and Mikro-ORM, which I have to learn as a job requirement. This stack requires TypeScript, which I despise from the bottom of my

What's the difference between BIGINT and INT8? (postgres)

I'm using a service called Supabase and I created a table: CREATE TABLE my_table ( "id" BIGSERIAL PRIMARY KEY NOT NULL, "title" Text COLLATE "pg_catalo

Updating Multiple Records with varying conditions in a single query

With Typeorm + NestJS + Postgres is there a way to update multiple records with varying conditions and varying values in a single query. Normally I could do awa

What difference does it make to put an annotation @Lob or not?

There is a request table in my database. Here is its structure Usually I created the entity with my hands, but this time I decided to generate it from the data

Is it OK to specify a schema in `table_name_prefix`?

TL;DR: Is it OK to specify a schema in table_name_prefix? We have a large Rails application that is not quite a traditional multi-tenant app. We have a hundred

How to SET ROLE for liquibase to use for DATABASECHANGELOGTABLE-creation

My current setup requires that the whole liquibase-migration is executed with a specific DB-role. I currently have the following changeSet on top of my script:

Inserting aggregates into big table is too slow

I need to run a query as cronjob and it is too slow to perform. It sums a value from a view table (data_time_series) for each pair of aks and ii and inserts a r

How to get the first field from an anonymous row type in PostgreSQL 9.4?

=# select row(0, 1) ; row ------- (0,1) (1 row) How to get 0 within the same query? I figured the below sort of working but is there any simple way? =# se

AssertionError: database connection isn't set to UTC

I have done server setup multiple times with the same settings but this time, I am seeing the error message. It is not even allowing to migrate the database. Sy

Quarkus docker container failed to run / connect to the DB

In my project, using Quarkus, Angular and PostgreSQL DB, when I run the backend & and the frontend in dev Mode, I can connect to the DB (which is postgreSQL

How to handle conditional prepared statements using prisma and postgresql?

I have a search query that its parameters changes depending on the client input. await prisma.$queryRaw(`SELECT column FROM table ${condition ? `WHERE column =