SQL to query running transactions with subtransactions that exceeds 64

2021-01-05 Thread Li EF Zhang
I am new to postgresql and sql. I want to check running transactions whose subtransactions exceeds 64. Is there any SQL statement or other method can do this? Thanks!

duplicate key value violates unique constraint pg_default_acl_role_nsp_obj_index

2021-01-05 Thread Andrus
Hi! I have used script below to remove all rights from user and add some. Today it starts to throw error ERROR:  duplicate key value violates unique constraint "pg_default_acl_role_nsp_obj_index" DETAIL:  Key (defaclrole, defaclnamespace, defaclobjtype)=(30152, 186783649, r) already exists

CROSSTAB( .. only one column has values... )

2021-01-05 Thread Adam Tauno Williams
I'm using the crosstab feature and do not understand why I am only getting values in the first column. The query: SELECT date_trunc('month', t2.value_date) AS invoice_date, t1.value_string AS invoice_type COUNT(*) FROM document d LEFT OUTER JOIN obj_property t1 ON (t1.obj_id = d.docu

Re: CROSSTAB( .. only one column has values... )

2021-01-05 Thread David G. Johnston
On Tue, Jan 5, 2021 at 8:46 AM Adam Tauno Williams wrote: > Only the first column has values, all the rest are NULL. > I assume I am missing something stupid. > I think you are assigning the function more intelligence/effort than it puts out. >From the documentation: """ The crosstab function p

Re: CROSSTAB( .. only one column has values... )

2021-01-05 Thread Tim Clarke
On 05/01/2021 16:12, David G. Johnston wrote: On Tue, Jan 5, 2021 at 8:46 AM Adam Tauno Williams mailto:awill...@whitemice.org>> wrote: Only the first column has values, all the rest are NULL. I assume I am missing something stupid. I think you are assigning the function more intelligence/effort

Re: CROSSTAB( .. only one column has values... )

2021-01-05 Thread Thomas Kellerer
Adam Tauno Williams schrieb am 05.01.2021 um 16:46: I'm using the crosstab feature and do not understand why I am only getting values in the first column. The query: SELECT date_trunc('month', t2.value_date) AS invoice_date, t1.value_string AS invoice_type COUNT(*) FROM document d LE

Re: CROSSTAB( .. only one column has values... )

2021-01-05 Thread Joe Conway
On 1/5/21 12:11 PM, Tim Clarke wrote: > imho the crosstab() function isn't a good implementation. The biggest failure > it > has is that you must know exactly how many output columns you will have in the > result /_prior to running it *That* is a function of how Postgres set returning functions

Re: CROSSTAB( .. only one column has values... )

2021-01-05 Thread Joe Conway
On 1/5/21 10:46 AM, Adam Tauno Williams wrote: > I'm using the crosstab feature and do not understand why I am only > getting values in the first column. > So I put this in as a crosstab: > > SELECT * FROM crosstab( > $$ > $$) AS final_result (invoice_date VARCHAR, "parts" BIGINT, "rent

Re: CROSSTAB( .. only one column has values... )

2021-01-05 Thread Pavel Stehule
Hi út 5. 1. 2021 v 19:45 odesílatel Joe Conway napsal: > On 1/5/21 12:11 PM, Tim Clarke wrote: > > imho the crosstab() function isn't a good implementation. The biggest > failure it > > has is that you must know exactly how many output columns you will have > in the > > result /_prior to running

Re: Max# of tablespaces

2021-01-05 Thread Bruce Momjian
On Sun, Jan 3, 2021 at 05:37:52PM +, Thomas Flatley wrote: > Excellent - thanks for the fast response - it was an oracle dba that set it > up initially so that may explain it - Agreed. It was probably done that way for an invalid reason and should be cleaned up. -- Bruce Momjian

FTS and tri-grams

2021-01-05 Thread Mark Phillips
Some years ago we implemented FTS. At the time, we also added a column with the tsvector data type. We assumed we needed that for FTS to work. Later, we added tri-gram support. At the time, we assumed tri-gram complimented FTS. More recently, we have run into a problem with replicating the tsve

Re: Max# of tablespaces

2021-01-05 Thread Andreas Kretschmer
On 3 January 2021 13:59:31 CET, Thomas Flatley wrote: >Hello, I've checked the docs but cant seem to find if there is a max # >of tablespaces allowed - I've come across a 9.5 env with 1600 >tablespaces - they want to double that why on earth do you think you will need so many tablespaces? They h

RE: Max# of tablespaces

2021-01-05 Thread Thomas Flatley
I don’t, but I didn’t set up the env As far as I can tell, each tablespace is a partition, and I assume they felt this was the best way to perform partition maintenance - again, I don’t know , -Original Message- From: Andreas Kretschmer Sent: Sunday, January 3, 2021 11:52 AM To: pgsql

Re: Max# of tablespaces

2021-01-05 Thread Christophe Pettus
> On Jan 5, 2021, at 13:55, Thomas Flatley wrote: > > As far as I can tell, each tablespace is a partition, and I assume they felt > this was the best way to perform partition maintenance - again, I don’t know > , It's a very common Oracle-ism to have a lot of tablespaces, in part because

Re: Max# of tablespaces

2021-01-05 Thread Ron
It's certainly the "I only know bash" method of determining which partition growing the fastest. On 1/5/21 3:55 PM, Thomas Flatley wrote: I don’t, but I didn’t set up the env As far as I can tell, each tablespace is a partition, and I assume they felt this was the best way to perform partitio

Re: FTS and tri-grams

2021-01-05 Thread Christophe Pettus
> On Jan 5, 2021, at 13:26, Mark Phillips wrote: > 1. Is FTS required for tri-gram to work? > 2. Are these independent of each other? > 3. Is tri-gram alone sufficient for a “full text search” feature? The answers are, kind of in order: 2. Yes. 1. No. 3. It depends on what you mean by "full t

RE: Max# of tablespaces

2021-01-05 Thread Thomas Flatley
I agree - it requires a re-think/re-build As for oracle, quite easy to add tablepaces in flight, assuming you don’t hit max db_files I was more curious if there was an actual defined limit - oracle stops at 64K , and their old application release would have 2tbsp per module, and at 400 or so t

PostgreSQL 13 on CentOS 7

2021-01-05 Thread H
I am compiling an application that uses postgreSQL 13 and Qt 5.12. I have built the latter from scratch and successfully linked with libraries for postgreSQL 9.6 (the current version on CentOS 7) but have run into problems with postgreSQL 13. The server, client and libs are available in the post

Re: PostgreSQL 13 on CentOS 7

2021-01-05 Thread H
On 01/05/2021 08:58 PM, H wrote: > I am compiling an application that uses postgreSQL 13 and Qt 5.12. I have > built the latter from scratch and successfully linked with libraries for > postgreSQL 9.6 (the current version on CentOS 7) but have run into problems > with postgreSQL 13. The server,

Re: SQL to query running transactions with subtransactions that exceeds 64

2021-01-05 Thread Laurenz Albe
On Tue, 2021-01-05 at 10:42 +, Li EF Zhang wrote: > I am new to postgresql and sql. I want to check running transactions whose > subtransactions exceeds 64. Is there any SQL statement or other method can > do this? Thanks! You may want to read https://www.cybertec-postgresql.com/en/subtransa

Re: Declarative partitioning and automatically generated row-IDs using BIGSERIAL

2021-01-05 Thread Laurenz Albe
On Thu, 2020-12-31 at 17:38 +0100, Thorsten Schöning wrote: > I have the following table containing 100+ millions rows currently and > which needs to be queried by "captured_at" a lot. That table stores > rows for the last 6 years, but most of the queries focus on the last > 15 months, 15 days or r

LDAP(s) doc misleading

2021-01-05 Thread Paul Förster
Hi, I found what I believe to be misleading in the LDAP documentation: https://www.postgresql.org/docs/current/auth-ldap.html It says: "ldapscheme Set to ldaps to use LDAPS."... IMHO, it should say: "ldapscheme Set to ldapscheme to use LDAPS (ldapscheme=ldaps)."... I found this because I'm in

How to convert escaped text column - force E prefix

2021-01-05 Thread Durumdara
Dear Members! A web developer stores JSON like strings in a text column. With E prefix we can get the real text: Select E'Az ad\u00f3kulcsonk\u00e9nti' Hungarian: "Az adókulcsonkénti" (ISO-8859-2) How to get the same result from a table column? select WhatAFunction( ATable.JSONLikeTextColumn)