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

2021-01-06 Thread Laurenz Albe
On Wed, 2021-01-06 at 11:14 +, Li EF Zhang wrote: > When I restart secondary node, it reported > "DEBUG: recovery snapshot waiting for non-overflowed snapshot or until > oldest active xid on standby is at least 4739126 (now 1422751) > CONTEXT: WAL redo at 4/741941F8 for

Re: Keep needing to run manual analyze

2021-01-06 Thread Laurenz Albe
On Wed, 2021-01-06 at 17:28 +, Rob Northcott wrote: > We have an application that uses a Postgres database (currently 9.6). All > the autovacuum/analyze settings are just left at the defaults. > We’ve had a few instances recently where users have complained of slow > performance and running

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

2021-01-06 Thread Pavel Stehule
Hi st 6. 1. 2021 v 21:47 odesílatel Daniel Verite napsal: > Pavel Stehule wrote: > > > > *That* is a function of how Postgres set returning functions work, and > not > > > specific to crosstab(). It is not easily fixed. Patches to fix that > would > > > be > > > welcomed! > > > > > > >

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

2021-01-06 Thread Daniel Verite
(resent to the list, previous post was rejected) Pavel Stehule wrote: > > *That* is a function of how Postgres set returning functions work, and not > > specific to crosstab(). It is not easily fixed. Patches to fix that would > > be > > welcomed! > > > >

Re: Keep needing to run manual analyze

2021-01-06 Thread Michael Lewis
On Wed, Jan 6, 2021 at 10:29 AM Rob Northcott wrote: > We have an application that uses a Postgres database (currently 9.6). All > the autovacuum/analyze settings are just left at the defaults. > > We’ve had a few instances recently where users have complained of slow > performance and running

Keep needing to run manual analyze

2021-01-06 Thread Rob Northcott
We have an application that uses a Postgres database (currently 9.6). All the autovacuum/analyze settings are just left at the defaults. We've had a few instances recently where users have complained of slow performance and running a manual Analyze (not vacuum) on their database has resolved

Error messages on duplicate schema names

2021-01-06 Thread Andrus
Hi! ALTER DEFAULT PRIVILEGES IN SCHEMA public,public   GRANT all ON TABLES TO testoig; Throws strange error Tuple already updated by self In other case which I posted duplicate schema causes another strange error duplicate key value violates unique constraint

Re: LDAP(s) doc misleading

2021-01-06 Thread Stephen Frost
Greetings, * Paul Förster (paul.foers...@gmail.com) wrote: > I found this because I'm in the process of making our Linux LDAP servers > obsolete by reconfiguring PostgreSQL to use our company Windows Active > Directory LDAPS service. When in an Active Directory environment, it's far more

Re: Using more than one LDAP?

2021-01-06 Thread Magnus Hagander
On Wed, Jan 6, 2021 at 4:39 PM Paul Förster wrote: > > Hi Magnus, > > > On 06. Jan, 2021, at 15:48, Magnus Hagander wrote: > > > > Only if you can create rules in your pg_hba.conf file that knows where > > the users are. You can specify multiple servers on one line, but that > > only balances

Re: Using more than one LDAP?

2021-01-06 Thread Paul Förster
Hi Magnus, > On 06. Jan, 2021, at 15:48, Magnus Hagander wrote: > > Only if you can create rules in your pg_hba.conf file that knows where > the users are. You can specify multiple servers on one line, but that > only balances across servers that don't work. If a server replies "no" > to a

Re: Using more than one LDAP?

2021-01-06 Thread Magnus Hagander
On Wed, Jan 6, 2021 at 3:38 PM Paul Förster wrote: > > Hi, > > can I use more than one LDAP server entry in pg_hba.conf? My tests show that > only the first one is used. > > Example: > > ldap1.domain contains user1, user2 > ldap2.another.domain contains user3, user4 > > All 4 users have an

Using more than one LDAP?

2021-01-06 Thread Paul Förster
Hi, can I use more than one LDAP server entry in pg_hba.conf? My tests show that only the first one is used. Example: ldap1.domain contains user1, user2 ldap2.another.domain contains user3, user4 All 4 users have an account in a PostgreSQL cluster. ldap1 is openLDAP and ldap2 is Windows AD.

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

2021-01-06 Thread Li EF Zhang
Thanks for your reply. I read it. When I restart secondary node, it reported "DEBUG:  recovery snapshot waiting for non-overflowed snapshot or until oldest active xid on standby is at least 4739126 (now 1422751)#0122020-12-21 00:00:24.415 UTC [146-15455940] CONTEXT:  WAL redo at 4/741941F8 for

Re: How to convert escaped text column - force E prefix

2021-01-06 Thread Pavel Stehule
st 6. 1. 2021 v 10:54 odesílatel Gavan Schneider napsal: > On 6 Jan 2021, at 19:43, Pavel Stehule wrote: > > Currently there are not any functions that you need. You need to write > your > own. > > CREATE OR REPLACE FUNCTION public.unistr(text) > RETURNS text > LANGUAGE plpgsql > IMMUTABLE

Re: How to convert escaped text column - force E prefix

2021-01-06 Thread Gavan Schneider
On 6 Jan 2021, at 19:43, Pavel Stehule wrote: Currently there are not any functions that you need. You need to write your own. CREATE OR REPLACE FUNCTION public.unistr(text) RETURNS text LANGUAGE plpgsql IMMUTABLE STRICT AS $function$

Re: How to convert escaped text column - force E prefix

2021-01-06 Thread Pavel Stehule
Hi st 6. 1. 2021 v 8:55 odesílatel Durumdara napsal: > 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

Re: FTS and tri-grams

2021-01-06 Thread Artur Zakirov
On Tue, Jan 5, 2021 at 10:26 PM Mark Phillips wrote: > We now wonder if tri-gram alone can achieve a fast full text search result. > If so, then we could the tsvector column be dropped? > > 1. Is FTS required for tri-gram to work? > 2. Are these independent of each other? FTS and tri-gram are