sum of two columns assigned to a condition – Postgresql
hi im trying to get the total of two columns stored to a name then get a condition but i having error on the 'Rebound' name on line 3 the offreb and defreb has a integer type and some values…
hi im trying to get the total of two columns stored to a name then get a condition but i having error on the 'Rebound' name on line 3 the offreb and defreb has a integer type and some values…
I have this table that has a 'unique together' index: CREATE TABLE IF NOT EXISTS entity_properties ( entity_id INTEGER NOT NULL REFERENCES entities, property_id UUID NOT NULL REFERENCES properties, value VARCHAR, value_label VARCHAR, UNIQUE (entity_id, property_id) ); I want to…
I am trying to update an existing postgres query in the Nodejs code base. Below is the existing query to select based on name constructor(schema){ this.table = schema.employee_tb; } row = await this.table.findOne({ name }); Below is the Postgres query…
I have column in jsonb named "lines" with many object like this : [ { "a" : "1", "b" : "2", "c" : "3" }, { "a" : "4", "b" : "5", "c" : "6" } ] This is my…
I wanted to create a materialized view from a label table and then create indexes on it. However, when I type the query to create this view, postgres pops an error. Here is the query that I type to return…
I made some changes in postgresql.conf file like modifying search_path and changing port. But these changes were not being reflected. They were written in the file but were not being implemented. I used vim for editing the file. I did…
In Postgres, we want to use the window function as an aggregate function. We have a table, where every line consists of two timestamps and a value. We first extend the table by adding a column with the difference between…
I have a table with two columns item_name, value where item_names looks like "abracadabra_prefix.tag_name". And I need to select rows with tag_names from a list that doesn't have a prefix. Should be somthing like: tag_names = ['f1', 'k500', '23_g'] SELECT…
I have the follow code of my docker-compose.yml: version: '3' services: db: image: postgres:14.6 restart: always environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres volumes: - ./data:/var/lib/postgresql/data But when I do docker compose up, the console give me the next error: servicios-basesdatos-db-1 exited…
I am building a api that is developed by multiple developers and we require to have the same db for testing purposes. We are using UUID and so it would be ideal if we all use the same UUIDs. I…