Re: Recursive CTEs and randomness - is there something I'm missing?

2020-02-28 Thread Adrian Klaver
On 2/28/20 9:45 AM, Tom Lane wrote: =?UTF-8?B?UMOzbCBVYSBMYW/DrW5lY2jDoWlu?= writes: The SQL: WITH RECURSIVE rand (num, md, a_2_s) AS ( SELECT 1, MD5(RANDOM()::TEXT), ARRAY_TO_STRING(ARRAY(SELECT chr((65 + round(random() * 25)) :: integer) FROM GE

Re: Recursive CTEs and randomness - is there something I'm missing?

2020-02-28 Thread Tom Lane
=?UTF-8?B?UMOzbCBVYSBMYW/DrW5lY2jDoWlu?= writes: > The SQL: > WITH RECURSIVE rand (num, md, a_2_s) AS > ( > SELECT > 1, > MD5(RANDOM()::TEXT), > ARRAY_TO_STRING(ARRAY(SELECT chr((65 + round(random() * 25)) :: integer) > FROM GENERATE_SERIES(1, 5)), '') >

Re: A question relative to creating an audit table

2020-02-28 Thread Andrei Zhidenkov
Please, read chapter 43.10.1 of the PostgreSQL documentation (https://www.postgresql.org/docs/11/plpgsql-trigger.html ). Just to be sure we are on the same page. > On 28. Feb 2020, at 14:59, stan wrote: > > On Thu, Feb 27, 2020 at 10:30

Re: A question relative to creating an audit table

2020-02-28 Thread stan
On Thu, Feb 27, 2020 at 10:30:15PM +0100, Andrei Zhidenkov wrote: > Why not to pass TG_TABLE_SCHEMA and TG_TABLE_NAME in its arguments? > > > On 27. Feb 2020, at 22:28, stan wrote: > > > > I ma considering setting up a function, and triggers to put a record in an > > audit table when certain tab

Re: Need to find the no. of connections for a database

2020-02-28 Thread sivapostg...@yahoo.com
Since the no. of entry screens to be locked might increase with enhancement(s), the approach could be  1.  On completion of all entries by all,  say for a day.2.  When opening the report, check whether only one user has logged in.  Close the report window, if there are more than one users.3.  F

Re: trouble making PG use my Perl

2020-02-28 Thread Steven Lembark
On Thu, 27 Feb 2020 15:07:29 -0500 Tom Lane wrote: > You might be able to override that with LD_LIBRARY_PATH, but it's > a pain, and it will certainly not work if your homebrew libperl > isn't 100% ABI-compatible with the system one. > > Personally I'd build plperl against the Perl you want to u

Re: trouble making PG use my Perl

2020-02-28 Thread Steven Lembark
On Thu, 27 Feb 2020 20:42:36 + Kevin Brannen wrote: > Thanks Tom, I can see your point. With the right change to > LD_LIBRARY_PATH, I can make `ldd plperl.so` point to my Perl, but as > you say, I'm probably playing with fire to expect it all to be 100% > compatible between Perl 5.10.1 (Cento

Re: trouble making PG use my Perl

2020-02-28 Thread Steven Lembark
> I can make Pg come up, initdb, that sort of stuff just fine. But we > also use the Perl extension and we have references to Perl modules > that are in *our* Perl and not the system one. Yes, we compile our > own Perl like we provide our own Pg because Centos uses much older > versions. > > The