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

Select 1 into variable postgresql?

I have this select statement inside a trigger procedure: SELECT 1 FROM some_table WHERE "user_id" = new."user_id" AND created >= now()::date; How can i store result in a variable and reuse it in IF statement like this: IF NOT EXISTS (var_name)…
user12694034
0
votes
1 answer

Querying data in postgresql by applying filter on JSONB When java class has sub class(jsonb)

I have a table Employee with fileds id, name, age , Address(as Jsonb string stored in Postgres DB) @Entity @Table(name = "Employee") @TypeDef(name = "jsonb", typeClass = JsonBinaryType.class) public class Employee implements Serializable…
0
votes
1 answer

Postgres Union not union'ing everything

This is using Postgres 12 I have a table that stages an import from a spreadsheet. It has a structure like code | yes | no XX1000 | yes | null ZX1001 | null | no I am trying to get all the results in a query so I can do other stuff with…
scottr
  • 65
  • 1
  • 6
0
votes
3 answers

ImportError: dlopen(...): Symbol not found: _PQencryptPasswordConn

I have been stuck on this issue for some time. After struggling to install psycpg2 on my Mac I got a friend to help me install it using this: env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip3 install psycopg2 I then…
0
votes
1 answer

postgres: Build select query using the cross tab or any json functions

create table foo (i int, j text); select table_schema, table_name, column_name , ordinal_position from information_schema.columns where table_name = 'foo'; Output table_schema table_name column_name ordinal_position public foo …
user1720827
  • 137
  • 1
  • 3
  • 15
0
votes
1 answer

PostgreSQL - Why 1 search paramater works, but not the other? (multiple joined tables)

So I have a query that I run that basically looks like the one below (simplified it though for easier viewing). When I search on user_orders.orderID it works flawlessly, but if I try to search by user_orders.reference instead it just timeouts. Now I…
Zoay
  • 55
  • 5
0
votes
1 answer

How to select only *columns* with more than one distinct value?

SELECT DISTINCT … removes duplicate rows. Is there any way to remove duplicate columns, that is, columns where every value is the same? I'm looking through a legacy schema for the "distinguishing features" of some rows, so this would be super…
l0b0
  • 55,365
  • 30
  • 138
  • 223
0
votes
0 answers

connection problem after downloading PostgresSQL12 version

I have been running into this error ever since i downloaded the PostgresSQL 12 version 4. This site can’t be reached. The webpage at http://127.0.0.1:1/?key=05f10f64-fd3d-4747-bd68-47ef0e53e7a8 might be temporarily down or it may have moved…
Tony
  • 1
0
votes
0 answers

trying to connect to heroku database and even configured pg_hba.conf file with all credentials but getting this error

psql -h [hostname] -U [user] [database] psql: FATAL: no pg_hba.conf entry for host "..*.", user "[user]", database "[database]", SSL off psql -h ... -U [user] [database] psql: could not connect to server: Connection timed out (0x0000274C/10060) …
0
votes
1 answer

Select rows from database using varying multiple WHERE conditions

I have a map with lots drawn on it, when a person select one or more lots I want to grab the information of those lots from the database and return it. The lots are identified by IDs like the ones in "lots_list". At the moment I'm using a for loop…
Calil
  • 57
  • 2
  • 7
0
votes
0 answers

FATAL: password authentication failed for user “postgres” (postgresql 12 with pgAdmin 4)

I recently installed Postgresql 12, during the installation, there's no step to put password and username for Postgres. Now in pgAdmin 4, I wanted to connect the database to server and it's asking me to input password, and I haven't put any in the…
0
votes
0 answers

Merge in Postgresql version 12.2

We are migrating out Oracle to Postgresql 12.2. we are aware that Merge is not in use in postgresql. Instead we have to use upsert, INSERT ON CONFLICT. but we are getting syntax error. Here is the code. MERGE INTO itmmasprc m USING(SELECT…
0
votes
1 answer

How can i add values to count in sql?

I have following SQL Query related at the ER-Diagram shown in the image. Select count(distinct(tkey)) as fromAustria from theses where ikey in (select ikey from institutions right join countries on…
user6652930
0
votes
1 answer

Casting column when using COPY FROM to import data from CSV

Using PostgreSQL 12, I am attempting to import data from a CSV with the following format: country,state,county,lat,lng,type,measure,beds,population,year,source,source_url US,AK,ketchikan…
Matt
  • 13
  • 4
0
votes
1 answer

reltuples set to 0 after Postgres 12 upgrade

I did an upgrade from Postgres 11.6 to 12.2 on AWS-RDS. Post upgrade seeing a couple of issues: Seems like all reltuples were set to 0 post upgrade Describe of an object results in error: ERROR: column c.relhasoids does not exist LINE 1:…