Re: Inherited an 18TB DB & need to backup

2020-05-16 Thread Ron
On 5/16/20 3:30 PM, Gavin Flower wrote: On 17/05/2020 08:12, Ron wrote: On 5/16/20 7:18 AM, Rob Sargent wrote: O Another problem is storage devices fail.  S3 storage lakes _should_ be checking your data integrity on a regular basis and possibly maintaining copies of it iin multiple locations

Re: Using b-tree index for >= condition when joining

2020-05-16 Thread Tom Lane
=?UTF-8?B?xYF1a2FzeiBExIViZWs=?= writes: > I am having a problem with nudging postgres to choose a good plan for > a query involving a left join and an inequality constraint on a column > with b-tree index. > ... > It looks like the inequality on date isn't pushed down below the left > join? Nope

Re: Ubuntu 20.04: apt.postgresql.org/pub/repos/apt focal-pgdg InRelease' doesn't support architecture 'i386'

2020-05-16 Thread Tim Cross
Hugh writes: > Hi, > > While this doesn't appear to be a bug that causes problems of any kind, I do > have a question about its cause. > > The "error" listed in the Subject: line is basically what I'm seeing. The > entire message is below, particularly the 'N:' at the end. Is there a repo >

Re: Ubuntu 20.04: apt.postgresql.org/pub/repos/apt focal-pgdg InRelease' doesn't support architecture 'i386'

2020-05-16 Thread Thomas Munro
On Sun, May 17, 2020 at 10:45 AM Hugh wrote: > While this doesn't appear to be a bug that causes problems of any kind, I do > have a question about its cause. > > The "error" listed in the Subject: line is basically what I'm seeing. The > entire message is below, particularly the 'N:' at the end

Re: Ubuntu 20.04: apt.postgresql.org/pub/repos/apt focal-pgdg InRelease' doesn't support architecture 'i386'

2020-05-16 Thread Adrian Klaver
On 5/16/20 3:45 PM, Hugh wrote: Hi, While this doesn't appear to be a bug that causes problems of any kind, I do have a question about its cause. The "error" listed in the Subject: line is basically what I'm seeing. The entire message is below, particularly the 'N:' at the end. Is there a rep

Ubuntu 20.04: apt.postgresql.org/pub/repos/apt focal-pgdg InRelease' doesn't support architecture 'i386'

2020-05-16 Thread Hugh
Hi, While this doesn't appear to be a bug that causes problems of any kind, I do have a question about its cause. The "error" listed in the Subject: line is basically what I'm seeing. The entire message is below, particularly the 'N:' at the end. Is there a repo setting I should change to prev

Re: Inherited an 18TB DB & need to backup

2020-05-16 Thread Gavin Flower
On 17/05/2020 08:12, Ron wrote: On 5/16/20 7:18 AM, Rob Sargent wrote: O Another problem is storage devices fail.  S3 storage lakes _should_ be checking your data integrity on a regular basis and possibly maintaining copies of it iin multiple locations so you're not vulnerable to a site disas

Re: Inherited an 18TB DB & need to backup

2020-05-16 Thread Ron
On 5/16/20 7:18 AM, Rob Sargent wrote: O Another problem is storage devices fail. S3 storage lakes _should_ be checking your data integrity on a regular basis and possibly maintaining copies of it iin multiple locations so you're not vulnerable to a site disaster. Tape FTW!! Or WTF Tape??

Re: Removing Last field from CSV string

2020-05-16 Thread Christian Ramseyer
On 16.05.20 17:18, Alex Magnum wrote: > Now I try to remove the last  field and comma  ",Class" > > To get  Class V,Class VI,Class VII,Competitive Exam,Class VIII > > Is there a function or easy way to do this? > Any help would be appreciated. > Hi Alex Many options to do this with regexp_

Using b-tree index for >= condition when joining

2020-05-16 Thread Łukasz Dąbek
Hello All! I am having a problem with nudging postgres to choose a good plan for a query involving a left join and an inequality constraint on a column with b-tree index. Let's say both tbl1 and tbl2 tables have date column with an index on it. Queries like "SELECT * FROM tbl1 WHERE date >= CONST

Re: template0 needing vacuum freeze?

2020-05-16 Thread Don Seiler
On Sat, May 16, 2020 at 12:44 PM Tom Lane wrote: > > So it's unsurprising that the freeze age increases until autovacuum > decides to do something about it. I'm suspicious that your alert settings are too aggressive and are notifying you before autovacuum kicks in. > You should *not* have had t

Re: template0 needing vacuum freeze?

2020-05-16 Thread Tom Lane
Don Seiler writes: > PG 9.6 (9.6.8). Got an alert today when template0 and template1 were both > over 50% towards TXID wraparound. I could vacuum template1 but couldn't > vacuum template0 without first allowing connections. This is what it looked > like before: template0 shouldn't really need fre

Re: Removing Last field from CSV string

2020-05-16 Thread Michael Nolan
On Sat, May 16, 2020 at 10:19 AM Alex Magnum wrote: > Hi, > > I have a string that I want to cut to 60 char and then remove the last > field and comma. > > substring('Class V,Class VI,Class VII,Competitive Exam,Class VIII,Class > X,Class XI,Class IX,Class XII',1,60); > > substring | Class V,Class

template0 needing vacuum freeze?

2020-05-16 Thread Don Seiler
PG 9.6 (9.6.8). Got an alert today when template0 and template1 were both over 50% towards TXID wraparound. I could vacuum template1 but couldn't vacuum template0 without first allowing connections. This is what it looked like before: # SELECT datname , age(datfrozenxid) , current_setting(

Re: Removing Last field from CSV string

2020-05-16 Thread Adrian Klaver
On 5/16/20 9:31 AM, PALAYRET Jacques wrote: Hello, Perhaps, a statement like :    substring(theString, 1, length(theString)-position(',' IN reverse(theString))) with theString   'Class V,Class VI,Class VII,Competitive Exam,Class VIII*,Class' for example. That's cool. I did a little fiddli

Re: Removing Last field from CSV string

2020-05-16 Thread PALAYRET Jacques
Hello, Perhaps, a statement like : substring(theString, 1, length(theString)-position(',' IN reverse(theString))) with theString 'Class V,Class VI,Class VII,Competitive Exam,Class VIII*,Class' for example. Regards - Météo-France - PALAYRET JACQUES DCSC/MBD jacques.palay...@meteo.

Re: schema agnostic functions in language sql

2020-05-16 Thread Rob Sargent
> On May 16, 2020, at 9:13 AM, David G. Johnston > wrote: > >  >> On Sat, May 16, 2020 at 5:15 AM Rob Sargent wrote: >> check_function_body=off may be what I want during the site install as the >> definitions should be correct in all aspects. > > You should probably just have one "test" s

Removing Last field from CSV string

2020-05-16 Thread Alex Magnum
Hi, I have a string that I want to cut to 60 char and then remove the last field and comma. substring('Class V,Class VI,Class VII,Competitive Exam,Class VIII,Class X,Class XI,Class IX,Class XII',1,60); substring | Class V,Class VI,Class VII,Competitive Exam,Class VIII*,Class* Now I try to remov

Re: schema agnostic functions in language sql

2020-05-16 Thread David G. Johnston
On Sat, May 16, 2020 at 5:15 AM Rob Sargent wrote: > check_function_body=off may be what I want during the site install as the > definitions should be correct in all aspects. > You should probably just have one "test" schema and compile your functions with the non-client test schema in the searc

Re: Inherited an 18TB DB & need to backup

2020-05-16 Thread Suhail Bamzena
Hi Peter Thanks for the info & the entire forum for their inputs i did fireup a pg_dump last night pairing it with gzip & split it to 1TB size.. will let you all know how it goes. On Sat, 16 May 2020, 18:12 Peter J. Holzer, wrote: > On 2020-05-15 14:02:46 +0100, Rory Campbell-Lange wrote:

Re: Inherited an 18TB DB & need to backup

2020-05-16 Thread Peter J. Holzer
On 2020-05-15 14:02:46 +0100, Rory Campbell-Lange wrote: > On 15/05/20, Suhail Bamzena (suhailsa...@gmail.com) wrote: > > I have very recently inherited an 18 TB DB that is running version 9.2. > > Apparently this database has never been backed up [...] > A very simple solution could be just to dum

Re: Circles with circle() vs ST_Buffer() Equality equalities

2020-05-16 Thread PALAYRET Jacques
Hello, Sorry, forget my questions. I checked the differences between the 2 polygons too quickly. Actually, I checked only some points and some attributes : SELECT ST_Area(geometry), ST_Perimeter(geometry), ST_NPoints(ST_ExteriorRing(geometry)) FROM ( SELECT polygon(32, circle('POINT(1 2)':

Re: Inherited an 18TB DB & need to backup

2020-05-16 Thread Rob Sargent
> O >> Another problem is storage devices fail. S3 storage lakes _should_ be >> checking your data integrity on a regular basis and possibly maintaining >> copies of it iin multiple locations so you're not vulnerable to a site >> disaster. > > Tape FTW!! > > -- Or WTF Tape?? :) > Angula

Re: schema agnostic functions in language sql

2020-05-16 Thread Rob Sargent
> On May 15, 2020, at 6:03 PM, Tom Lane wrote: > > Rob Sargent writes: >> I cannot create a plain sql function unless the search_path covers any >> table mentioned. Not the case when using plpgsql - no path needed. > > Oh, one of the things that's quite a lot different is the checking > ap

Re: Pgpool is crashing when terminating user session

2020-05-16 Thread Tatsuo Ishii
> Hello all, > > We are having master-slave setup with pgpool pointing, only to master > server. Whenever i tried to terminate the long running session on db end > using SELECT pg_terminate_backend(pid), pgpool is getting crashed. Many > blogs are saying this is the expected behaviour of pgpool,

Re: schema agnostic functions in language sql

2020-05-16 Thread Rob Sargent
> On >>> regards, tom lane >> Did my message with a sql and plgpsql versions not come through? >> I cannot create a plain sql function unless the search_path covers any table >> mentioned. Not the case when using plpgsql - no path needed. > > But does the plpgsql segment_calls() ru

Pgpool is crashing when terminating user session

2020-05-16 Thread RAJAMOHAN
Hello all, We are having master-slave setup with pgpool pointing, only to master server. Whenever i tried to terminate the long running session on db end using SELECT pg_terminate_backend(pid), pgpool is getting crashed. Many blogs are saying this is the expected behaviour of pgpool, but my quest

Re: Column reset all values

2020-05-16 Thread Peter J. Holzer
On 2020-05-14 16:32:41 +0400, otar shavadze wrote: > also nor index drop is an option, because I need re-create index as I use this > table in procedure, so index is necessary for  further queries. So total > runtime will not decreased. A full index on a column where all the values are the same (N

Re: Enforcing uniqueness on [real estate/postal] addresses

2020-05-16 Thread Peter J. Holzer
On 2020-05-12 21:55:56 +0100, Peter Devoy wrote: > >Is is possible to have two entries which have the same > >address_identifier_general, street and postcode, but different > >descriptions? > > Unfortunately, yes. The data comes from gov't systems to > regulate the development/alteration of arbit