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
3 answers

PostgreSQL: Is it possible to determine if any elements in an array overlap a range?

Let's say I have a table with an int[] column and values: '[1,4,1300]'::int4[] I want to be able to query the column and get a true if ANY of the elements match a BETWEEN statement. So, in this case, something like: SELECT id FROM table WHERE col &&…
IamIC
  • 17,747
  • 20
  • 91
  • 154
0
votes
0 answers

upgrade to PostgreSQL 12 in cluster

I have two node PostgreSQL 11 HA setup as follows. node1 - hamaster.myorg.net node2 - haslave.myorg.net recovery.conf on node2 is as follows: standby_mode = 'on' primary_conninfo = 'host=hamaster.myorg.net port=5432 user=
Niraj Nandane
  • 1,318
  • 1
  • 13
  • 24
-1
votes
1 answer

How to execute into column with PostgreSQL?

I have a table with 2 columns: sql_command and result like that: sql_command result select count(*) from t1; null select count(*) from t2; null select count(*) from t3; null select count(*) from t4; null Is it…
yuoggy
  • 97
  • 1
  • 10
-1
votes
1 answer

KeyError 'hour' in annotate function tortoise ORM query

Need to run the below query using tortoise ORM. SELECT date_trunc('hour',"created") "group_name",COUNT("id") "count" FROM "abc" WHERE "user_id"='xyz@gmail.com' AND "active"=true GROUP BY "group_name" ORDER BY group_name DESC; Trying to use in-built…
Bhawan
  • 2,441
  • 3
  • 22
  • 47
-1
votes
1 answer

PostGIS: function ST_AsRaster does not exist. Even using examples from the docs

I'm trying to convert geometries to images, and the functions to do so don't seem to exist. The following example is from the ST_AsRaster Docs WHich specify the requirements are Availability: 2.0.0 - requires GDAL >= 1.6.0. SELECT…
Douglas Gaskell
  • 9,017
  • 9
  • 71
  • 128
-1
votes
1 answer

Comparing time in text format in psql 12

SELECT * FROM lighting WHERE cast("time" as timestamp) BETWEEN '23:55:00'::timestamp AND now(); But I get the error as follows: ERROR: column "23:55:00::timestamp" does not exist LINE 3: WHERE cast("time" as timestamp) BETWEEN…
Echchama Nayak
  • 971
  • 3
  • 23
  • 44
-1
votes
1 answer

Error using pg_upgrade going from PostgreSQL 10 to 12

I have an installation of PostgreSQL 10, and just installed PostgreSQL 12 (on Windows). I'm trying to migrate over the databases using pg_upgrade. However, I'm getting an annoying error: The command I ran was as follows: $ pg_upgrade.exe -b…
robbieperry22
  • 1,753
  • 1
  • 18
  • 49
-1
votes
2 answers

while creating user for my postgreSQL database. I get error su : The term 'su' is not recognized

I run the following command in my windows powerShell su postgres su : The term 'su' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the…
user10184547
-1
votes
1 answer

Getting an error for the parentheses after row_number for postgresql-12

I am attempting to use window ranking to get the three orders with the highest profit per each product_id using order_id as the tiebreaker from sales table. The code I've written is: with C as ( select product_id, order_id, profit row_number()…
sf56
  • 1
  • 1
-1
votes
1 answer

syntax error at or near "JOIN" for postgresql

I am trying to join two tables, and for some reason I keeping getting: ERROR: syntax error at or near "JOIN" My code is: SELECT c.visit, d.cake FROM customer c, INNER JOIN desert d ON c.visit = d.visit LIMIT 10;
tkxgoogle
  • 407
  • 4
  • 11
-1
votes
1 answer

Is there any major changes from Postgres version 11 to postgres version 12?

We wanted to upgrade postgres with version 12, wanted to know if we have any changes syntactical which will affect the queries written on postgres version 11. I am currently checking using - but didn't find any difference which will change the…
Madhu
  • 367
  • 2
  • 7
  • 20
-1
votes
1 answer

Orange (data mining) psycopg2 connect fail "Unsupported frontend protocol" with postgresql 12.2

https://orange.biolab.si/ Connect to postgresql 12.2 fails with: Unsupported frontend protocol 123[wraps] I believe this is: https://github.com/petere/homebrew-postgresql/issues/51 I'm on Windows 18363.778 using Orange 3.25.0 and psycopg2-2.8.5. Is…
Joseph H
  • 33
  • 3
-1
votes
2 answers

Convert a VARCHAR value to a formatted date, ignoring errors

I have a column containing dates in the format yyyy-mm-dd. Now I'm running a SELECT query that converts that date to dd/mm/yyyy using TO_CHAR(dob :: DATE, 'dd/mm/yyyy') AS dob which works just fine. Now the problem I've encountered is that there are…
Clint_A
  • 518
  • 2
  • 11
  • 35
-2
votes
1 answer

Joining 2 tables with a timestamp of YEAR for the first item purchased by customer

I have 2 tables "items" and "customers". In both tables, "customer_id" is present and a single customer can have more than 1 item. In the "items" table there is also a timestamp field called "date_created" when an item was purchased. I want to…
iblwkqn
  • 3
  • 1
1 2 3
36
37