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

Converting int64_t to string in C

I am working with C programming language and using Postgres database to insert records. One of the columns of the table in the database is of type timestamp. The data I am getting in the C program is of type int64_t and I need to pass this value as…
A Beginner
  • 393
  • 2
  • 12
0
votes
1 answer

Postgresql trigger function that checks if data that's been updated in a single column is equal to something

I have a single table A with 3 columns id, name, price. I'm trying to create a trigger in postgres that fires when the value under price is updated/set to 0. If the value is 0, then the entire row is deleted. I'm a complete beginner in postgresql…
Torrino
  • 163
  • 13
0
votes
1 answer

Get last logout for every user for every day (MAX(), GROUP BY) [postgresql]

I have multiple logouts for many users. I want to get the last logout for every user for every day. SELECT t_logouts.log_id, t_users.last_name || ' ' || t_users.first_name, t_logouts.log_date, MAX(t_logouts.log_time), (DATE_PART('hour',…
0
votes
0 answers

Postgres store procedure BEGIN and END in IF condition

Hi I am new in postgres i have mysql store procedure that which i converting into postgres store procedure. CREATE PROCEDURE saveData( IN name character varying(200), IN mobile character varying(15), IN City character varying(100), INOUT _message…
Dexter
  • 1,804
  • 4
  • 24
  • 53
0
votes
1 answer

Get list of columns in materialize view

I have the following table: --Table: create table tbl_columns ( id int, col varchar(50) ); I have few columns from tables, views and materialize views in the above table. Query: Want to find the tables,views and materialize views name's which are…
MAK
  • 6,824
  • 25
  • 74
  • 131
0
votes
3 answers

How to cast a varchar into an int[] using 'in' operator in PostgreSQL

I am having a hard time about this. I am trying to cast a varchar containing a list of numbers into an int array, in order to serve an in operator on a where clause. This is the last version of my code. create or replace function…
coterobarros
  • 941
  • 1
  • 16
  • 25
0
votes
1 answer

Postgres's pg_dump --section=pre-data includes CHECK constraints, despite documentation saying otherwise?

I'm trying to use pg_dump --section=pre-data to suppress CHECK constraints in pg_dump's output, but I'm finding that it includes CHECK constraints anyway. Here are the steps I followed, first in psql: CREATE DATABASE test_pre_data_check_db; \connect…
Andrew
  • 529
  • 1
  • 3
  • 12
0
votes
1 answer

Is it possible to nest an EXECUTE statement as a source recordset in PostgreSQL?

This is the case of a dynamic _sql select passed to a function that tries to execute the query and return a JSON array with the result. create or replace function jlist_objects_bysql ( _sql varchar ) returns json as $$ select json_agg (t) …
coterobarros
  • 941
  • 1
  • 16
  • 25
0
votes
1 answer

SERIAL works with NULL, GENERATED ALWAYS AS IDENTITY not

Postgres 12: CREATE TABLE l_table ( id INT generated always as identity, w_id int NOT null references w_table(id), primary key (w_id, id) )PARTITION BY LIST (w_id); CREATE table l1 PARTITION OF l_table FOR VALUES IN (1); insert into l1…
Gabriel
  • 5,453
  • 14
  • 63
  • 92
0
votes
1 answer

In Postgres 12, how to change PK columns into IDENTITY using dynamic SQL?

So I migrated my database from SQLite to Postgres 12 using pgloader 3.4.1, and for some reason the PK columns across all tables aren't sequential/auto-increment. They're indexed as NOT NULL (correct) and bigint or int (correct), but they don't…
Hmong Bong
  • 33
  • 6
0
votes
1 answer

Can I pause a replica on the receiver (subscriber) in postgres12?

Can I pause a replica on the receiver (subscriber) in postgres12? just to alter some table structure and then Restart the replica
Gabriele D'Onufrio
  • 405
  • 1
  • 5
  • 17
0
votes
0 answers

How to search the part of a text using tsv c#?

I am using the tsv column in the table. In C#, in the LINQ query, I am searching the text like below var result = (from student in context.Students where student.Tsv.Matches(EF.Functions.PlainToTsQuery(searchText)) select…
0
votes
1 answer

Windows Docker container Networking to Postges on host (windows 10)

OK.. Sorry to clog up this site with endless questions. I have a .NET REST API that works in DOCKER. (Windows container) But, the moment I try to connect to Postgres on my host I am unable to connect. I get unable to connect, request timed out,…
Chris Dunlop
  • 135
  • 1
  • 13
0
votes
1 answer

Unterminated dollar-quoted string creating PostgreSQL function

Using PostgreSQL 12.3, I am having some trouble trying to validate this simple chunk of plpgsql code create or replace function test() returns void as $$ begin prepare plan as select 1; execute plan; end; $$ language plpgsql; Error…
coterobarros
  • 941
  • 1
  • 16
  • 25
0
votes
1 answer

Postgre 12.2 - pg_ctl: could not start server but no other info is shown

good evening to you all! Im working with PostgreSQL 12.2 over FreeBSD 12.0-RELEASE and currently having this issue: Error Background: Im trying to set Streaming Replication according with the docs…
Ivanovich
  • 63
  • 1
  • 1
  • 6