Re: Date created for tables

2019-12-23 Thread Melvin Davidson
>You all are *grossly* over-complicating this. Agree +1 On Mon, Dec 23, 2019 at 9:14 PM Ron wrote: > On 12/23/19 7:01 PM, Bruce Momjian wrote: > > On Thu, Dec 5, 2019 at 05:10:20PM +, Chloe Dives wrote: > > Having moved to PostgreSQL from Oracle a few years ago I have been generally > very

Re: Date created for tables

2019-12-23 Thread Ron
On 12/23/19 7:01 PM, Bruce Momjian wrote: On Thu, Dec 5, 2019 at 05:10:20PM +, Chloe Dives wrote: Having moved to PostgreSQL from Oracle a few years ago I have been generally very impressed by Postgres, but there are a few things that I still miss. One of those is being able to see the crea

Re: Date created for tables

2019-12-23 Thread Bruce Momjian
On Thu, Dec 5, 2019 at 05:10:20PM +, Chloe Dives wrote: > Having moved to PostgreSQL from Oracle a few years ago I have been generally > very impressed by Postgres, but there are a few things that I still miss. One > of those is being able to see the created and last modified dates for databas

Re: pgpool High Availability Issue

2019-12-23 Thread Tatsuo Ishii
> I'm working on configuring high availability for pgpool using watchdog. > Initially, I tried with two pgpool nodes (along with a pgmaster and > pgslave). In this scenario, assuming pgpool node 1 was started first and > became the leader. After sometime , the node got disconnected with pgpool > n

Re: pgpool High Availability Issue

2019-12-23 Thread Bruce Momjian
The pgpool email lists are the right place to ask this question: https://www.pgpool.net/mediawiki/index.php/Mailing_lists --- On Fri, Nov 15, 2019 at 11:04:22AM -0800, a venkatesh wrote: > Hi,  > > I'm working on co

Re: unanalyze a foreign table

2019-12-23 Thread Justin
I do not know of way to undo an analyze once its committed. I do not know the danger in deleting an entry in pg_statistic What you can do in the future is make copy of the Statics for this table, analyze, if it negatively affect results put the copy back. Another option is to do begin ; ANALYZE

Re: SQL operator '*='

2019-12-23 Thread Alban Hertroys
> On 23 Dec 2019, at 15:33, Matthias Apitz wrote: > > #ifdef DBSPOS > EXEC SQL DECLARE land_cursor CURSOR FOR > SELECT stammprio, lkz, landbez, plkz, postbez, karenz1, > karenz2, > karenz3, land.wkz, webez, we, kurs, land.del > FROM l

Re: Commit to primary with unavailable sync standby

2019-12-23 Thread Maksim Milyutin
On 19.12.2019 18:08, Fabio Ugo Venchiarutti wrote: On 19/12/2019 13:58, Maksim Milyutin wrote: On 19.12.2019 14:04, Andrey Borodin wrote: Hi! Hi! FYI, this topic was up recently in -hackers https://www.postgresql.org/message-id/caeet0zhg5off7iecby6tzadh1moslmfz1hlm311p9vot7z+...@mail.

Re: Mixing greediness in regexp_matches

2019-12-23 Thread Tom Lane
"Daniel Verite" writes: > FWIW, in plperl, there's a simple solution: > $string =~ s/(foobar|foo|...)/$replace{$1}/g Well, our manual does suggest using plperl (or pltcl) when the built-in pattern match functions aren't adequate ;-) regards, tom lane

Re: Mixing greediness in regexp_matches

2019-12-23 Thread Daniel Verite
Tom Lane wrote: > regression=# select regexp_split_to_array('junkfoolbarfoolishfoobarmore', > 'foo|bar|foobar'); > regexp_split_to_array > --- > {junk,l,"",lish,more} > (1 row) > > The idea would be to iterate over the array elements, tracking the > corresponding posi

Re: Mixing greediness in regexp_matches

2019-12-23 Thread Daniel Verite
Tom Lane wrote: > I'd try forcing the match to be the whole string, ie > > ^(.*?)(foo|bar|foobar)(.*)$ > > which would also save some work for restarting the iteration, > since you'd have already captured the all-the-rest substring. In that case regexp_matches will return 0 or 1

Re: Mixing greediness in regexp_matches

2019-12-23 Thread Tom Lane
"Daniel Verite" writes: >> The basic idea is to iterate on the rows produced by >> regexp_matches(string, '(.*?)(foo|bar|foobar)', 'g') >> to break down the string into pairs of (non-matching segment, >> matching segment) so that a final result can be assembled >> from that (setting aside the last

Re: Mixing greediness in regexp_matches

2019-12-23 Thread Tom Lane
"Daniel Verite" writes: > The basic idea is to iterate on the rows produced by >regexp_matches(string, '(.*?)(foo|bar|foobar)', 'g') > to break down the string into pairs of (non-matching segment, > matching segment) so that a final result can be assembled > from that (setting aside the last n

Mixing greediness in regexp_matches

2019-12-23 Thread Daniel Verite
Hi, When looking into how to implement a global replace of multiple substrings (each with their own replacement) in sql or plpgsql, I'm wondering if/how an RE with an alternation can be used. The basic idea is to iterate on the rows produced by regexp_matches(string, '(.*?)(foo|bar|foobar)'

Re: SQL operator '*='

2019-12-23 Thread Thomas Kellerer
Matthias Apitz schrieb am 23.12.2019 um 15:33: I've here a smaller problem of our porting from Sybase/Oracle/Informix code to PostgreSQL; the code reads for the mentioned DBS: #ifdef DBSORA EXEC SQL DECLARE land_cursor CURSOR FOR SELECT stammprio, lkz, landbez, plkz, pos

SQL operator '*='

2019-12-23 Thread Matthias Apitz
Hello, I've here a smaller problem of our porting from Sybase/Oracle/Informix code to PostgreSQL; the code reads for the mentioned DBS: ... #ifdef DBSINF EXEC SQL DECLARE land_cursor CURSOR FOR SELECT stammprio, lkz, landbez, plkz, postbez, karenz1, karenz2,

Re: pg_basebackup

2019-12-23 Thread Kyotaro Horiguchi
Hello. At Mon, 23 Dec 2019 03:38:12 +, Daulat Ram wrote in > thanks Adrian, what about the > postmaster.opts file, this file was also skipped in backup. The file is overwritten at startup so there's no point in having it in a backup. Thus, it is deliberately excluded from a backup. regard