Questions tagged [postgresql-12]

For PostgreSQL questions specific to version 12.

PostgreSQL 12 is a major release of the PostgreSQL RDBMS.

Improvements include, but are not limited to:

  • performance improvements for partitioning and indexes
  • CTEs (WITH queries) are by default inlined for better query performance
  • JSON path queries per SQL/JSON specification
  • support for case- and accent-insensitive ICU collations
  • (stored) generated columns
  • extended statistics for “most common values”
  • page checksums can be enabled and disabled without initdb
  • authentication: support for encrypted GSSAPI authentication and LDAP server discovery
  • “pluggable storage” to add different table storage methods

More information regarding the release is available here.

554 questions
0
votes
0 answers

Postgresql - Slow running Query for a simple select statement attached to timescaledb

I have a append only table with more than ~80M records attached to timescaledb, the frequency of insertion of records to table is one minute. Also, there is an index created on non unique column and start time (ds_id, start_time). When I try to run…
chintuyadavsara
  • 1,509
  • 1
  • 12
  • 23
0
votes
1 answer

How to create index on JSON field in Postgres

I need to optimize below query on jsonb field : example : create table sample (id char(10) pk, doc1 jsonb); sample data: ('abcd',{"_id": "__default:5cd3e-f49f", "status": "updated"} select * from sample where…
naveen_sfx
  • 727
  • 2
  • 9
  • 18
0
votes
1 answer

ERROR: current transaction is aborted, commands ignored until end of transaction block when trying to import a raster image to postgis

I am getting the following error when trying to import a raster image to a PostGIS DB using raster2pgsql. ERROR: current transaction is aborted, commands ignored until end of transaction block I have tried a number of different solutions without…
0
votes
1 answer

Connection issues with fuse esb when connecting to postgresql database

I am trying to connect fuse esb with postgresql database. Postgresql database is the latest version (12.6) and the driver provided by fuse is "postgresql-9.1-901.jdbc4.jar" (osgi) under jdk 1.7. Bellow issues are seen. when checking the connection…
0
votes
2 answers

Query Postgres Timestamp with Timezone wrong result

I have a table with a time column defined as time TIMESTAMP DEFAULT CURRENT_TIMESTAMP my database and the server have the timezone UTC Tue Apr 20 18:22:50 UTC 2021 When I ran the following query SELECT id, time AT TIME ZONE 'utc' AS "TZ: UTC",…
0
votes
1 answer

42883 ERROR: operator does not exist: record -> unknown

How I call the function: SELECT opportunity_price_total(($$ [{"value_price": 10, "value_period": {"value_period_id": 1}},{"value_price": 1, "value_period": {"value_period_id": 2}},{"value_price": 10, "value_period": {"value_period_id": 4}}] …
saimcan
  • 1,706
  • 7
  • 32
  • 64
0
votes
1 answer

How select random items by given categories in postgres

I have a table with items with category id-s and I want to create a function that gets category ids array and returns an array of random items with corresponding categories. Here is what I've tried CREATE OR REPLACE FUNCTION…
Yasha Gasparyan
  • 360
  • 2
  • 6
  • 11
0
votes
0 answers

Discrepancy with structure.sql in Rails 4 app?

We have a Rails 4 app right now that is using Postgresql. All the devs today got upgraded/downgraded to the same version: PostgreSQL 12.6. However, for a couple of us, when we run rake db:migrate the alterations to structure.sql seem to be slightly…
0
votes
1 answer

Delete model and DB table in Django with migrations

I have two models: Clause and Template, they have been migrated locally, but I want to delete one of them. The question is: If I just delete it from models.py and admin.py, and run makemigration and migrate, how can I delete and the related DB…
Yordan
  • 113
  • 2
  • 7
0
votes
1 answer

Connecting Existing PostgreSQL 28p01: password autentication faild for user "postgres"

Database-First for existing Postgresql to run this do dotnet ef dbcontext scaffold "Host=localhost;Database=mydb;Username=postgres;Password=Hi$22222" Npgsql.EntityFrameworkCore.PostgreSQL have an error 28p01: password autentication faild for user…
Ghionlab
  • 1
  • 1
0
votes
0 answers

Struggling to connect to postgres-12 database server in ubuntu/linux

I am trying to install postgres and facing issue, unable to connect to server, i have installed postrges when try to connect with postgres it doesn't connect-> use below commands and get errors. when i try sudo systemctl status…
Muhammad Nabeel
  • 111
  • 1
  • 14
0
votes
0 answers

What is the best way to avoid deadlock in postgresql db for multiple spark jobs to update same rows in the same table?

I have the use case which needs to update the same rows in a postgresql table from four spark jobs at the same time. The spark jobs are using 'executeUpdate()' from JDBC to update the same table. The spark jobs are streaming jobs, which needs to…
yyuankm
  • 295
  • 4
  • 22
0
votes
1 answer

Call Database View in Generic repository pattern in C#

I'm using Generic repository pattern in Web API C# (.Net Framework 4.7.2) with database as postgresql. I want to call database View and stored procedure using generic repository. Note: I don't use the EDMX file. PostgreSQL View:CREATE VIEW…
0
votes
1 answer

what is p6spy? I am getting this in the db url

What is difference between jdbc:p6spy:postgresql://localhost:5432/{some DB} and jdbc:postgresql://localhost:5432/{some DB}. I set a PostgreSQL DB and DB URL was like jdbc:postgresql://localhost:5432/{some DB} while in my properties file i got the…
Ravish Raj
  • 31
  • 4
0
votes
0 answers

postgresql 12 generated columns overhead

PostgreSQL 12 enables generated columns. Is there an overhead of using a generated column? If yes what is it? Is table locked for read/write when such column is added?
gshilin
  • 647
  • 14
  • 23