How to keep the first 4 words of a text? – Postgresql
I want to shorten the field of the 4th words: unaccent('unaccent', lower(regexp_replace(titre, '[^w]+','_','g')))
I want to shorten the field of the 4th words: unaccent('unaccent', lower(regexp_replace(titre, '[^w]+','_','g')))
I have two tables: Task: Select last_name of users who: placed at least one order in January 2013; and also made at least one order in any other month of the same year. I can only use subqueries, joins and…
I have 'stock_price_15m' table which stores 15 minute OHLC candlestick data. niftydb=# d stock_price_15m; Table "public.stock_price_15m" Column | Type | Collation | Nullable | Default ----------+--------------------------+-----------+----------+--------- stock_id | integer | | not null | dt | timestamp with time zone…
I am trying to run flask, postgres and nginx services with following docker-compose: version: '3.6' services: postgres: image: postgres:10.5 container_name: postgres hostname: postgres user: postgres ports: - "5432:5432" networks: - db-tier environment: CUSTOM_CONFIG: /etc/postgres/postgresql.conf volumes: - ./postgres/sql/create_tables.sql:/docker-entrypoint-initdb.d/create_tables.sql - ./postgres/postgresql.conf:/etc/postgres/postgresql.conf command:…
I have big Postgres database(around 75 GB) and queries are very slow. Is there any way to make them faster? About database: List of relations Schema | Name | Type | Owner | Persistence | Access method | Size |…
I have a table like this I need to get the validity order by the number of true values in the last 4 columns. For e.g. the output of the below query should be 1110 // 4 true values 1001…
I want to copy a Postgres table in CSV format from a network database to my computer. For example, here is its address psql postgresql://login:[email protected]:5432/test_table The problem is that I don't have superuser rights and I can't copy the table…
I have created a project using Golang. I have used PostgreSQL as the database. Now I want to make an admin panel for this project using Django. I want directly reflect the database tables in the Django admin panel. As…
I have a query like this that works well : "SELECT * FROM elements we WHERE jsonb_exists_all(CAST(we.elements AS jsonb), ARRAY['TEST'])" I need to use the .setParameter method from EntityManager to insert a whole array instead of ["CHEST"] e.g. ["TEST", "TEST1",…
Is there a proper way of triggering an event from my PostgreSQL database upon insert/update on a certain table that sends a notification to a separate HTTP server? For a standard REST API application, we mostly interact with the DB…