All Questions
Tagged with postgresql json
4,178
questions
0
votes
1
answer
22
views
How to return JSON objects without explicit aliasing in postgresql
If I have two tables and I join them, can I return one of the values a JSON object, without having to specify all the fields?
For example, the following works:
SELECT u.*,
json_build_object(
'name', ...
1
vote
2
answers
37
views
PostgreSQL: return json as a list
I have mixed types of values in the columns but all of them are json object:
one field stored as text in column_a:
{'field0': 'value0'}
another field as json (list of) in column_b:
[{'field1': '...
0
votes
0
answers
24
views
How can I use Debezium Server to monitor a PosgresSQL db and save the changes to a json file?
I have a docker compose with a postgres, debezium server, and wanted to find a way to locally store the changes in a json file. Have been searching, but didn't find any promising directions.
I ...
0
votes
0
answers
32
views
I get a Cannot POST /login error when i'm not sending a POST request to the /login endpoint
I'm building a web application where users can register and login using Node.js, Express, and a PostgreSQL database. However, I'm encountering an issue with my frontend and backend communication. When ...
0
votes
1
answer
32
views
Decoding ByteA data in postgresql
Using decode function for decoding a ByteA data.
This runs successfully but some non-english character such as 'ä' comes as '\334'
Anything need to be changed on the below code
Select replace(replace(...
0
votes
0
answers
32
views
Use inheritance in definitions for json column
I have a column definition that works ok for persisting and querying typed json data
Entities
public class TimeLineDefinition()
{
public DateTime StartDateUtc { get; init; }
}
public class ...
0
votes
1
answer
26
views
How do I add a prefetch (or similar) to a django queryset, using contents of a JSONField?
Background
I have a complex analytics application using conventional relational setup where different entities are updated using a CRUD model.
However, our system is quite event driven, and it's ...
0
votes
1
answer
39
views
PostgreSQL - Json data - Inserting into Target Table through Trigger
This is continuation to similar post.
I have a students_source table with a json column like this.
CREATE TABLE students_source (doc_id INT, doc_data JSON);
A row is inserted with doc_id = 201. The ...
0
votes
0
answers
15
views
Zip File Upload in PowerApps to PostgreSQL Database
iam trying to upload a Zip File into a PostgreSQL Database using the PowerApps Connector and PowerAutomate.
I kindof reach a brickwall here, I do not find alot about this in the web and have no Idea ...
0
votes
1
answer
31
views
How to insert enum with JSON user_meta_data in Supabase?
I created enum in Supabase with name "role" and contains "owner" and "employee" value like this:
But, when I create a function for a trigger like this:
insert into ...
2
votes
2
answers
92
views
postgres - How to parse json array elements?
PostgreSQL 15.4
Below is the postgres table table1:
CREATE TABLE table1 (
id INT PRIMARY KEY,
name TEXT,
skills JSON
);
with below rows inserted:
INSERT INTO table1 (id, name, skills) VALUES
(1, '...
0
votes
1
answer
39
views
Fastest way to load "maximally adversarial" text data into postgres
I have ~1TB of text data stored across a couple thousand compressed JSON files that I'd like to load into postgres. The problem with any of the obvious approaches like pg_bulkload or COPY is that the ...
0
votes
1
answer
18
views
How to search query in Django JSONField Model?
I have been trying to resolve this issue for the past 2 days, but I have not found a solution yet. I have scoured the internet, Django Forum, and ChatGPT, and attempted over 50 methods, but nothing ...
0
votes
1
answer
35
views
Valid json string resulting in error when trying to import into postgresql table
Currently using postgresql in pgAdmin 4 to import some csvs into my tables - I've never done this before but none of the jsonb columns are - for reference, this is just data I've been sent to practice ...
0
votes
1
answer
41
views
postgresql union and jsonb_build_object
I have been looking around and facing an issue that I don't see how to solve
Many thanks, and after completly rewritten my query
WITH cte1 as (
SELECT distinct jsonb_build_object(
select ...