Category "postgresql"

Querying from BigQuery to Python

I'm trying to query data to bigquery with this code as mentioned in google docs: from google.cloud import bigquery client = bigquery.Client() tab = client.query

regexp_matches, array per row

In PostgreSQL, I have a table as follow. | id | mycolumn | | -------- | -------------- | | 1 | /1/2/8/ | | 2 | /1/40/22/11/ |

Difference in jsonb and jsonb[] in postgresql

I have been working over jsonb columns in postgresql. My problem statement is to store array of json objects, so i thought of jsonb[] datatype as it is a viable

TypeORM OneToMany and ManyToOne relations cases 500 error on GET request

After adding OneToMany and manyToOne relations in the entities and doing GET request it shows in postman 500 error. // Car entity @Entity({ name: 'car' }) expor

Using array_agg with multiple DISTINCT Columns

In this query, I'm listing all users in organization 123 but I also want a column showing which other teams they are on across all organizations. My query right

Match any letter in a string

Table flights: ID Path 1 NZ:EU 2 JP:CA SELECT path FROM flights WHERE path ILIKE '%' || 'jpca' || '%' Above query isn't working, it needs to retu

Is there a way to set initial value for auto incremented column in typeorm?

I am using typeorm with postgresql. I want my auto incremented primary key column to start from specific initial value instead of 1. Is there any solution in ty

PostgreSQL timescale - How to sort rows by time and id?

I have data in my timescale database. If we only look at the "time", everything is fine. But if we look at the "id" we can see that 152 and 153 numbers didn't s

How to get what percentage of total users joined what number of meetings in PostgreSQL?

There are two tables, one is called "user_preference" that contains all users: id | firstname | lastname | email | And "match" which combines users with meetu

Interpolating variables in json string

I am using the code below to create a function with variables that updates a jsonb column with a json object or create it if it doesn't exist - With help from

Join with adding new row

I have a query which returns next table with name first_table: Name ID First 1 Second 2 And I need to join another table named second_table: ID ParentID 22 1

Grouping hour intervaled data into averages per day

I have a table with a starting time, finishing time and delivery columns. The starting and finishing times are of the timestamp without time zone data type (YYY

¿Is it possible to load packed decimal with streamsets?

I'm using StreamSets and will soon need to load data from fixed length file and packed decimal (cobol comp-3) to insert into Postgres to regular number numeric(

"Illegal argument to function" in Postgres when doing select on a view with pgp_sym_decrypt() expression

I am using pg_sym_decrypt/encrypt to decrypt/encrypt some of the fields in my table. Decryption happens on select in a separate EntityComputed view that has a o

SQL (MySQL etc), what is the difference about length string (1-256) and (0-256)?

Thanks for reading my post. I wanna know, what is the difference between length (1-256) and (0-256) in sql and how to store them in database?. I was asked to de

Hibernate + spring multi tenancy wrong schema selected

I’m using Jhipster (Gradle + React) for one of my project, and recently, I want to add Multi-tenancy support to the whole application (tenant will be the

Postgres query is getting lock while executing through shell script

The below query is getting locked by executing through perl ALTER TABLE base_table DETACH PARTITION part_table; By using this query select pid,state,

Python list overwritten each time the previous items

The objective of my application is to create a copy of documents and insert them into the database for each annotator, for example, let's say the master user ha

Error changing owner in Azure Postgres with superadmin

I hope anyone can tell me what I am doing wrong here. I have upgraded an Azure Postgres PaaS database from version 10 to 11. I've just followed the Microsoft gu

Node.js Postgresql problem querying database using 'pg' module

I'm trying to insert data into a 'users' table inside a postgresql database using the 'pg' NPM module. But when I make a POST request, the transaction executes