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
1
vote
1 answer

How do I make the read-only slave Postgresql12 database writable?

I created a standard PostgreSQL 12 replication configuration. I have changed hot_standby by off in postgresql.conf and entered the set transaction read only = off in psql. But still, I can not create a table or database and there are no I found…
1
vote
1 answer

PostgreSQL Base Types (Scalar Type)

I have a use case where a custom base type in a PostgreSQL database would be very beneficial for dealing with non-linear data. The examples of this include defining using a input and output function to a C function. In my case I would rather just…
warchitect
  • 397
  • 1
  • 4
  • 15
1
vote
1 answer

Postgres: Want to SELECT data when user exists, else INSERT user

Still getting the hang of PostgreSQL (Using PostgreSQL-12, so any advice is very much appreciated. I have an application that allows the user to save and create playlists of songs. My tables are: users, playlists, songs Then I have two junction…
Haley
  • 11
  • 3
1
vote
1 answer

Different execution plan in windows and Linux for PostgreSQL

I have recently deployed PostgreSQL database on Linux server. One of the stored procedure is taking around 3 to 4 seconds to fetch the result. Previously i was deployed PostgreSQL database to windows server and the same stored procedure fetching…
1
vote
1 answer

Insert of randomly generated data into PostgreSQL extremely slow;

I need to insert a very large data set into a table for testing purposes. I have created a script for exactly that purpose that generates purely random data. It works, but it performs so slowly that I'll be here for a month of Sundays awaiting…
SteveJ
  • 3,034
  • 2
  • 27
  • 47
1
vote
1 answer

postgres st_dwithin doesn't exist

Here is my OS & db version cat /etc/centos-release CentOS Linux release 7.6.1810 (Core) ################################################ psql --version PostgreSQL 12.1 I already installed postgres and postgis. but still, I cannot use…
horoyoi o
  • 584
  • 1
  • 8
  • 29
1
vote
2 answers

How to change existing COLUMN type to SERIAL in postgres?

The following statement doesn't work: ALTER TABLE my_table ALTER COLUMN column_id set default nextval('my_table_column_id_seq'); So how to change id column to auto increment? Error: null value in column \"column_id"\ violates non null…
Sampo Kaarenmaa
  • 127
  • 2
  • 13
1
vote
2 answers

how to insert python logs in postgresql table?

I need to insert the logs from my test case into a table in postgresql data base. I was able to connect to the db but I can't figure out how to insert this line result in the tabble, I have tried the below but it doesnt work import logging import…
Ryan
  • 129
  • 1
  • 12
1
vote
1 answer

Statement logging in PostgreSQL 12.1. Has something changed from earlier versions?

I'm debugging some code that uses SQLAlchemy to interact with a PostgreSQL database. The errors I'm seeing suggest that PostgreSQL is receiving my SQL statements, but perhaps not in the order I intended. So, I thought I'd enable statement logging to…
Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
1
vote
1 answer

PG Upgrade Errors

I have upgraded Postgres to 12.1, PostGIS to 3.0 and PGAdmin to 4.15. Running queries and using PGAdmin GUI results in some error messages: ERROR: column rel.relhasoids does not exist LINE 1: SELECT rel.relhasoids AS has_oids Error retrieving data…
D_C
  • 370
  • 4
  • 22
1
vote
1 answer

Replace with single quote to double single quote not working in PostgreSQL 12

Replace with single quote to double single quote not working properly in PostgreSQL 12, it was working fine in PostgreSQL 11. PostgreSQL 12 Query: SELECT REPLACE(patient.note,'''',''''''), * FROM patient Output Text: Medicare Secondary Veteran�s…
Nayan Rudani
  • 1,029
  • 3
  • 12
  • 21
1
vote
1 answer

SQL Format the date of the whole field (column) if at least one record meets the condition

I receive data from a client in a text format and then I have to convert it into date for MS SQL Server 2016 and Postgresql 12. The dates can be in these formats: 30.12.2019 or 12.30.2019 or 30/12/2019 or 12/30/2019 Luckily, the same formatting…
Kokokoko
  • 452
  • 1
  • 8
  • 19
1
vote
0 answers

Replication not working on generated columns in PostgreSQL 12.1

I am using below architecture for replication. Master(Publication) Database Schema: CREATE TABLE public.patient ( pk int4 NOT NULL GENERATED ALWAYS AS IDENTITY, patientid int8 NOT NULL GENERATED ALWAYS AS (public.fnGetPrimaryKey(pk, clientid))…
Nayan Rudani
  • 1,029
  • 3
  • 12
  • 21
1
vote
0 answers

How to create FK to table partitioned by date in PG12

Is it possible to create FK to table partitioned by daterange in PG12? Imagine I have big table user_session and event table with FK to it: create table user_session( -- BIG TABLE to be partitioned id bigserial…
1
vote
1 answer

cannot connect to postgres :psql: error: could not connect to server: FATAL: password authentication failed for user on windows

I installed PostgreSQL on my windows 10 and while running the server in sql shell (psql) (psql: error: could not connect to server: FATAL: password authentication failed for user "samantha") This error is showing up