Re: Streaming replication - 11.5

2020-03-12 Thread Nicola Contu
The replicator is ok and the replicated as well.
%Cpu(s):  0.2 us,  1.0 sy,  0.0 ni, 94.8 id,  4.0 wa,  0.0 hi,  0.0 si,
 0.0 st

CPU is really low on both.

I am running pg_basebackup again everytime.
Any other suggestions?



Il giorno mer 11 mar 2020 alle ore 23:13 Adrian Klaver <
adrian.kla...@aklaver.com> ha scritto:

> On 3/11/20 2:12 PM, Nicola Contu wrote:
> > CPU load on the server to be built? No.
>
> CPU load, I/O load on the servers in the replication chain.
>
> Basically you just recently, it seems, imposed extra overhead to the
> process by encrypting/decrypting. From what I gather from earlier post
> then your replication started failing. Trying to establish whether the
> former is causing the latter.
>
> Not sure what you are referring to in regards to server to be built?
>
> > System logs don't show anything relevant unfortunately
> >
> > Il mer 11 mar 2020, 21:34 Adrian Klaver  > > ha scritto:
> >
> > On 3/11/20 11:59 AM, Nicola Contu wrote:
> >  > I am actually cascading.
> >  > The master is in nyh, the first slave is in Dallas and the one
> > having
> >  > problems is in Dallas as well on the same switch of the one
> > replicating
> >  > from the master.
> >  >
> >  > It always worked not sure what is wrong now. We just encrypted
> > disks on
> >  > all servers
> >
> > Do you have before and after on CPU load, I/O throughput?
> >
> > Do system logs show anything relevant during replication drop out?
> >
> >  >
> >  >
> >  > Il mer 11 mar 2020, 18:57 Adrian Klaver
> > mailto:adrian.kla...@aklaver.com>
> >  >  > >> ha scritto:
> >  >
> >  > On 3/11/20 2:54 AM, Nicola Contu wrote:
> >  >  > These are the lines before
> >  >  >
> >  >  > 2020-03-11 09:05:08 GMT [127.0.0.1(40214)] [43853]: [1-1]
> >  >  > db=cmdv3,user=zabbix_check ERROR:  recovery is in progress
> >  >  > 2020-03-11 09:05:08 GMT [127.0.0.1(40214)] [43853]: [2-1]
> >  >  > db=cmdv3,user=zabbix_check HINT:  WAL control functions
> > cannot be
> >  >  > executed during recovery.
> >  >  > 2020-03-11 09:05:08 GMT [127.0.0.1(40214)] [43853]: [3-1]
> >  >  > db=cmdv3,user=zabbix_check STATEMENT:  select
> >  >  > greatest(0,pg_wal_lsn_diff(pg_current_wal_lsn(),
> > replay_lsn)) from
> >  >  > pg_stat_replication where client_addr ='10.150.20.22'
> >  >  >
> >  >  > That query is made by Zabbix. So I stopped the zabbix
> > agent and
> >  > tested
> >  >  > again. But still failing, because of this now :
> >  >  >
> >  >  > pg_basebackup: starting background WAL receiver
> >  >  > pg_basebackup: created temporary replication slot
> >  > "pg_basebackup_51199"
> >  >  > *pg_basebackup: could not receive data from WAL stream:
> > SSL SYSCALL
> >  >  > error: EOF detected
> >  >  > *^C4699810/504983062 kB (70%), 0/1 tablespace
> >  >  > (...ql11/data/base/16401/231363544.2)
> >  >
> >  > So you started over with a pg_basebackup?
> >  >
> >  > Also from below:
> >  >
> >  > 2020-03-11 09:43:53 GMT [10.150.20.22(54906)] [51199]: [1-1]
> >  > db=[unknown],user=replicator LOG:  terminating walsender
> > process due to
> >  > replication timeout
> >  >
> >  > Where are the master and standby in relation to each other
> > network wise?
> >  >
> >  > Intervening firewalls, network latency issues?
> >  >
> >  >
> >  >
> >  >  >
> >  >  >
> >  >  > here the full log starting right before the last try :
> >  >  >
> >  >  > 2020-03-11 09:22:44 GMT [] [12598]: [4508-1] db=,user= LOG:
> >  >  >   restartpoint complete: wrote 19565 buffers (0.2%); 0 WAL
> > file(s)
> >  >  > added, 0 removed, 7 recycled; write=270.014 s, sync=0.009
> s,
> >  >  > total=270.036 s; sync files=804, longest=0.001 s,
> > average=0.000 s;
> >  >  > distance=131239 kB, estimate=725998 kB
> >  >  > 2020-03-11 09:22:44 GMT [] [12598]: [4509-1] db=,user= LOG:
> >  >   recovery
> >  >  > restart point at 643A/D8C05F70
> >  >  > 2020-03-11 09:22:44 GMT [] [12598]: [4510-1] db=,user=
> > DETAIL:  Last
> >  >  > completed transaction was at log time 2020-03-11
> > 09:22:44.050084+00.
> >  >  > 2020-03-11 09:23:14 GMT [] [12598]: [4511-1] db=,user= LOG:
> >  >  >   restartpoint starting: time
> >  >  > 2020-03-11 09:27:44 GMT [] [12598]: [4512-1] db=,user= LOG:
> >  >  >   restartpoint complete: wrote 17069 buffers (0.2%); 0 WAL
> > file(s)
> >  >  > added, 0 removed, 17 recycled; write=269.879 s, sync=0.006
> s,
> >  >  > to

Re: Back Port Request for INVALID Startup Packet

2020-03-12 Thread Fabio Ugo Venchiarutti

On 12/03/2020 00:29, Tom Lane wrote:

Virendra Kumar  writes:

Can you please back port patch where if a 0 byte packet sent to PG instance 
(Health Checks), it starts complaining about invalid startup packet and flood 
the log which increases log size considerably if the health checks are every 3 
seconds or something like that.
Patch Requested - 
https://git.postgresql.org/gitweb/?p=postgresql.git;a=patch;h=342cb650e


We generally don't like to change behavior of back branches without
ironclad agreement that the existing behavior is a bug ... which this
surely isn't.  Also, the discussion leading up to that patch specifically
considered and rejected back-patching; so I'm disinclined to overrule
that decision now.

I would suggest that an every-three-second health check is not
appropriate, especially one that is so minimal that it only
detects whether the postmaster is alive.



Does the backend explicitly configure the kernel's TCP accept queue?

Unless Postgres sets it to impractically low numbers, the above test 
sounds weak from yet another angle; the postmaster might be "alive" as a 
process but completely seized for other reasons: at least in Linux the 
TCP accept queue progresses the 3-way handshake so long as the bound 
socket's file descriptor is still held, without even waiting for accept().



I'd recommend a better probe that at least sends a startup message and 
expects the backend to follow up with the authentication request (no 
need to craft messages manually, testing for more abstract 
messages/states out of psql or some libpq wrapper would do). Better 
still, if credentials/access are available, run a query.




--


Notice: 
This email is confidential and may contain copyright material of 
members of the Ocado Group. Opinions and views expressed in this message 
may not necessarily reflect the opinions and views of the members of the 
Ocado Group.


If you are not the intended recipient, please notify us 
immediately and delete all copies of this message. Please note that it is 
your responsibility to scan this message for viruses.


References to the 
"Ocado Group" are to Ocado Group plc (registered in England and Wales with 
number 7098618) and its subsidiary undertakings (as that expression is 
defined in the Companies Act 2006) from time to time. The registered office 
of Ocado Group plc is Buildings One & Two, Trident Place, Mosquito Way, 
Hatfield, Hertfordshire, AL10 9UL.





RE: pg_restore restores out of order

2020-03-12 Thread Kevin Brannen
>Adrian Klaver wrote:
>> Kevin Brannen wrote:
>> It goes on to say a trigger is the right way to do this. So yeah, a
>> "tightening of the code" seems to be hitting me because of bad code from the 
>> past.
>>
>> Problem identified and I'll solve it tomorrow.
>
>Glad it was solved.
>
>However, looking a gift horse in the mouth, did this not error when moving 
>from the 9.6.5 instance to the first 12.2 instance?
>
>Or
>
>Was the constraint added in the first 12.2 instance?

This is the first instance. :) I've now got our entire code base working
on the latest version of Perl and Postgresql (they have to go at the same
time because of DBI/DBD) and I'm going thru and making sure everything
works before committing to our integration branch for further testing. I've
solved a few other upgrade issues like some names changing in pg_catalog
and moving to the community RPMs instead of compiling our own. The problem
in this thread has been the only hard one and fortunately for me it's
the last (or I think it is).

Unless we have a significant reason, upgrading is hard enough we only
upgrade about every other year, or that's my plan going forward. Waiting
3 years like we did this time makes for a larger jump than I'd like.

Thanks again for the help!
Kevin

.
This e-mail transmission, and any documents, files or previous e-mail messages 
attached to it, may contain confidential information. If you are not the 
intended recipient, or a person responsible for delivering it to the intended 
recipient, you are hereby notified that any disclosure, distribution, review, 
copy or use of any of the information contained in or attached to this message 
is STRICTLY PROHIBITED. If you have received this transmission in error, please 
immediately notify us by reply e-mail, and destroy the original transmission 
and its attachments without reading them or saving them to disk. Thank you.


Re: Streaming replication - 11.5

2020-03-12 Thread Adrian Klaver

On 3/12/20 4:31 AM, Nicola Contu wrote:

The replicator is ok and the replicated as well.
%Cpu(s):  0.2 us,  1.0 sy,  0.0 ni, 94.8 id,  4.0 wa,  0.0 hi,  0.0 si, 
  0.0 st


CPU is really low on both.

I am running pg_basebackup again everytime.
Any other suggestions?



I have to believe their is a connection between changing to encrypting 
the disks and your issues. Not sure what, but to help how is the 
encryption being done and what program is being used?



--
Adrian Klaver
adrian.kla...@aklaver.com




Re: Streaming replication - 11.5

2020-03-12 Thread Nicola Contu
The encryption is at os level. So the drives are encrypted with a password
where the db saves data

Il gio 12 mar 2020, 15:51 Adrian Klaver  ha
scritto:

> On 3/12/20 4:31 AM, Nicola Contu wrote:
> > The replicator is ok and the replicated as well.
> > %Cpu(s):  0.2 us,  1.0 sy,  0.0 ni, 94.8 id,  4.0 wa,  0.0 hi,  0.0 si,
> >   0.0 st
> >
> > CPU is really low on both.
> >
> > I am running pg_basebackup again everytime.
> > Any other suggestions?
> >
>
> I have to believe their is a connection between changing to encrypting
> the disks and your issues. Not sure what, but to help how is the
> encryption being done and what program is being used?
>
>
> --
> Adrian Klaver
> adrian.kla...@aklaver.com
>


polygon && polygon and precision

2020-03-12 Thread Patrick Dowler
I am using polygon datatype with some very small values and discovered that
the overlaps operator appears to break down and give false positives for
values smaller than ~1e-6. I have tested this on 9.5 (.3 and .16) and 10.10.

To reproduce (these examples only differ in the x-axis exponents) and
should be false but the first one is t(rue)

select '((3.0e-07,-2),(9.0e-07,-2),(9.0e-07,1),(3.0e-07,1))'::polygon
&&
'((2.0e-07,-0.1),(2.0e-07,0.1),(2.01e-07,0.1),(2.01e-07,-0.1))'::polygon;

select '((3.0e-06,-2),(9.0e-06,-2),(9.0e-06,1),(3.0e-06,1))'::polygon
&&
'((2.0e-06,-0.1),(2.0e-06,0.1),(2.01e-06,0.1),(2.01e-06,-0.1))'::polygon;

Maybe suggests some single-precision floating point use in the
calculations...

--
Patrick Dowler
Canadian Astronomy Data Centre
Victoria, BC, Canada


Patroni permanent replication slots

2020-03-12 Thread Paul Förster
Hi,

I know, this is not 100% a question that belongs here but I hope to get help 
anyway.

I have Patroni 1.6.4 and found in the 1.6.3 the possibility to define permanent 
replication slots. This seems to work fine in Patroni 1.6.4.

But where I would REALLY need it with Patroni 1.3.x and Patroni 1.6.0 because I 
have NO chance to get newer versions there. :-(

Does anybody know if this feature already works on 1.3.x or 1.6.0? My chances 
to test that are very limited.

And yes, we already have wal_keep_segments = 1000 which is more than ugly and 
still provides no 100% guarantee that no WAL gets deleted prematurely.

Cheers,
Paul



Migrating from Db2

2020-03-12 Thread Joe Jess
We are evaluating migrating from Db2.

Would appreciate if you can point me to useful resources.  And any guidance
on things to what out for.

Our set up
- About 100+ tables
- 300+ user definable functions and tables.  Mainly for analysis and
reporting.
- Small number of stored procedures called by our reporting tool.
- 10+ GB.
- Database encryption
- Database audit

Look straightforward?

J


Re: Migrating from Db2

2020-03-12 Thread Ron

On 3/12/20 3:35 PM, Joe Jess wrote:

We are evaluating migrating from Db2.

Would appreciate if you can point me to useful resources.  And any 
guidance on things to what out for.


Our set up
- About 100+ tables
- 300+ user definable functions and tables.  Mainly for analysis and 
reporting.

- Small number of stored procedures called by our reporting tool.
- 10+ GB.
- Database encryption
- Database audit

Look straightforward?


Converting the UDFs and sprocs will be the biggest hurdles.

Encryption should be doable, but depends on what you currently encrypt.

--
Angular momentum makes the world go 'round.




plperl syntax question

2020-03-12 Thread stan
I am trying to run a query in plperl that uses a Perl variable from the
same function.

Here is the code snippet:

my $stmt = qq("SELECT employee_key from employee where id = '$user' ;");
elog( NOTICE, "stmt = $stmt" );
my $rv3 = spi_exec_query('$stmt');

Here is the runtime output:

NOTICE:  stmt = "SELECT employee_key from employee where id = 'stan' ;"
ERROR:  syntax error at or near "$" at line 22.

As you can see, the statement seems correctly formatted, right?

What am I doing wrong here?

-- 
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin




Re: plperl syntax question

2020-03-12 Thread Rob Sargent



> On Mar 12, 2020, at 4:34 PM, stan  wrote:
> 
> I am trying to run a query in plperl that uses a Perl variable from the
> same function.
> 
> Here is the code snippet:
> 
> my $stmt = qq("SELECT employee_key from employee where id = '$user' ;");
> elog( NOTICE, "stmt = $stmt" );
> my $rv3 = spi_exec_query('$stmt');
> 
> Here is the runtime output:
> 
> NOTICE:  stmt = "SELECT employee_key from employee where id = 'stan' ;"
> ERROR:  syntax error at or near "$" at line 22.
> 
> As you can see, the statement seems correctly formatted, right?
> 
> What am I doing wrong here?
> 
> -- 
> "They that would give up essential liberty for temporary safety deserve
> neither liberty nor safety."
>   -- Benjamin Franklin
> 
?try
 my $rv3 = spi_exec_query($stmt);
> 
> 





Re: polygon && polygon and precision

2020-03-12 Thread Kyotaro Horiguchi
Hello, Patrick.

At Thu, 12 Mar 2020 10:16:15 -0700, Patrick Dowler  
wrote in 
> I am using polygon datatype with some very small values and discovered that
> the overlaps operator appears to break down and give false positives for
> values smaller than ~1e-6. I have tested this on 9.5 (.3 and .16) and 10.10.

For usability, geometric arithmetics is performed having 1.0E-6 of
tolerance. For example equalness between two floating point values is
defined as:

#define EPSILON 1.0E-06
#define FPeq(A, B)  (fabs((A) - (B)) <= EPSILON)

Point-same-as is defined using the comparison, so the following
comparison gives true.

=# select '(1.5E-06, 0)'::point ~= '(1.0E-06, 0.5E-06)'::point;
 ?column? 
--
 t

All comparisons are performed taking that degree of tolerance. By a
rough calculation, that tolerance in long-lat coordinate is
corresnponding to that of about 40 meters on the ground.

> To reproduce (these examples only differ in the x-axis exponents) and
> should be false but the first one is t(rue)
> 
> select '((3.0e-07,-2),(9.0e-07,-2),(9.0e-07,1),(3.0e-07,1))'::polygon
> &&
> '((2.0e-07,-0.1),(2.0e-07,0.1),(2.01e-07,0.1),(2.01e-07,-0.1))'::polygon;
> 
> select '((3.0e-06,-2),(9.0e-06,-2),(9.0e-06,1),(3.0e-06,1))'::polygon
> &&
> '((2.0e-06,-0.1),(2.0e-06,0.1),(2.01e-06,0.1),(2.01e-06,-0.1))'::polygon;
> 
> Maybe suggests some single-precision floating point use in the
> calculations...

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center




Re: plperl syntax question

2020-03-12 Thread David G. Johnston
On Thursday, March 12, 2020, stan  wrote:
>
> my $rv3 = spi_exec_query('$stmt');
> What am I doing wrong here?
>

Putting a variable name into a single-quoted string and expecting it to
resolve to the contents of said variable instead of being treated as a
literal.

David J.


Re: plperl syntax question

2020-03-12 Thread stan
On Thu, Mar 12, 2020 at 06:00:01PM -0600, Rob Sargent wrote:
> 
> 
> > On Mar 12, 2020, at 5:16 PM, stan  wrote:
> > 
> > On Thu, Mar 12, 2020 at 04:58:08PM -0600, Rob Sargent wrote:
> >> 
> >> 
> >>> On Mar 12, 2020, at 4:49 PM, stan  wrote:
> >>> 
> >>> On Thu, Mar 12, 2020 at 04:45:58PM -0600, Rob Sargent wrote:
>  
>  
> > On Mar 12, 2020, at 4:34 PM, stan  wrote:
> > 
> > I am trying to run a query in plperl that uses a Perl variable from the
> > same function.
> > 
> > Here is the code snippet:
> > 
> > my $stmt = qq("SELECT employee_key from employee where id = '$user' ;");
> > elog( NOTICE, "stmt = $stmt" );
> > my $rv3 = spi_exec_query('$stmt');
> > 
> > Here is the runtime output:
> > 
> > NOTICE:  stmt = "SELECT employee_key from employee where id = 'stan' ;"
> > ERROR:  syntax error at or near "$" at line 22.
> > 
> > As you can see, the statement seems correctly formatted, right?
> > 
> > What am I doing wrong here?
> > 
> > -- 
> > "They that would give up essential liberty for temporary safety deserve
> > neither liberty nor safety."
> > -- Benjamin Franklin
> > 
>  ?try
>  my $rv3 = spi_exec_query($stmt);
> >>> 
> >>> OK, now  I have:
> >>> 
> >>> my $stmt = qq("SELECT employee_key from employee where id = '$user' ;");
> >>> elog( NOTICE, "stmt = $stmt" );
> >>> my $rv3 = spi_exec_query($stmt);
> >>> 
> >>> And the runtime output is now:
> >>> 
> >>> NOTICE:  stmt = "SELECT employee_key from employee where id = 'stan' ;"
> >>> ERROR:  syntax error at or near ""SELECT employee_key from employee where
> >>> id = 'stan' ;"" at line 22.
> >>> 
> >> 
> >> Change you double quotes to single around you select stmt.  $user probably 
> >> doesn???t need quotes at all
> >> 
> >>> Looks like somehow that is createing a double set of quotes
> >>> -- 
> >>> "They that would give up essential liberty for temporary safety deserve
> >>> neither liberty nor safety."
> >>>   -- Benjamin Franklin
> >> 
> > Thanks.
> > 
> > my $stmt = qq('SELECT employee_key from employee where id = $user ;');
> > elog( NOTICE, "stmt = $stmt" );
> > my $rv3 = spi_exec_query($stmt);
> > 
> > runtimeL
> > 
> > NOTICE:  stmt = 'SELECT employee_key from employee where id = stan ;'
> > ERROR:  syntax error at or near "'SELECT employee_key from employee where
> > id = stan ;'" at line 22.
> > CONTEXT:  PL/Perl function "a_foo"
> > 
> > This is not normally hard to get working in non plperl.
> > 
> Sorry, I didn???t know qq was adding surrounding double quotes.
> You may need something like 
> qq(SELECT employee_key from employee where id = ') + $user + qq(';);
> or
> qq(SELECT employee_key from employee where id = '$user???;);
> 
> depending on how qq works. 
> 

I will play with it, but i am not optimistic. You see the elog, that prints
the string that comes out of qq, right? qq is for quoting strings to be
passed to DBD/DBI calls.

I cannot figure out why the call in plpwel is so strange. I would love to
see a workign example of a call to this fucntion that uses a variable, and
works.

-- 
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin




Re: plperl syntax question

2020-03-12 Thread stan
On Thu, Mar 12, 2020 at 06:37:02PM -0700, David G. Johnston wrote:
> On Thursday, March 12, 2020, stan  wrote:
> >
> > my $rv3 = spi_exec_query('$stmt');
> > What am I doing wrong here?
> >
> 
> Putting a variable name into a single-quoted string and expecting it to
> resolve to the contents of said variable instead of being treated as a
> literal.
> David J.

Please look at this.

Here is the code:

my $stmt = qq('SELECT employee_key from employee where id = $user ;');
elog( NOTICE, "stmt = $stmt" );
my $rv3 = spi_exec_query($stmt);

As you cna see, I use qq to ahndle the qouting: runtime output looks like
this:

OTICE:  stmt = 'SELECT employee_key from employee where id = stan ;'
ERROR:  syntax error at or near "$" at line 22.

Looks like a very clean string with the variable substituted.

Anyone have a working example of a call to spi_exec_query() using a variable?

also tried:

my $rv3 = spi_exec_query('$stmt');

Different trun tiem error message.


-- 
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin




Re: plperl syntax question

2020-03-12 Thread Rob Sargent


> On Mar 12, 2020, at 7:44 PM, stan  wrote:
> 
> On Thu, Mar 12, 2020 at 06:37:02PM -0700, David G. Johnston wrote:
>> On Thursday, March 12, 2020, stan  wrote:
>>> 
>>> my $rv3 = spi_exec_query('$stmt');
>>> What am I doing wrong here?
>>> 
>> 
>> Putting a variable name into a single-quoted string and expecting it to
>> resolve to the contents of said variable instead of being treated as a
>> literal.
>> David J.
> 
> Please look at this.
> 
> Here is the code:
> 
> my $stmt = qq('SELECT employee_key from employee where id = $user ;');
> elog( NOTICE, "stmt = $stmt" );
> my $rv3 = spi_exec_query($stmt);
> 
> As you cna see, I use qq to ahndle the qouting: runtime output looks like
> this:
> 
> OTICE:  stmt = 'SELECT employee_key from employee where id = stan ;’
You can see that the entire sql string is quoted, where what you want from the 
elog is just single quotes around the value (i.e. 'stan’)

The example I saw for qq on the perl site 
print(qq(Welcome to GeeksForGeeks)); 
doesn’t have any quotes in arg to qq

Try making the sql string without using qq
my $select = “select’” + $user + “‘;”;
(or perhaps perl has a formatted string function like printf)

> ERROR:  syntax error at or near "$" at line 22.
> 
> Looks like a very clean string with the variable substituted.
> 
> Anyone have a working example of a call to spi_exec_query() using a variable?
> 
> also tried:
> 
> my $rv3 = spi_exec_query('$stmt');
> 
> Different trun tiem error message.
> 
> 
> -- 
> "They that would give up essential liberty for temporary safety deserve
> neither liberty nor safety."
>   -- Benjamin Franklin
> 
> 



Re: plperl syntax question

2020-03-12 Thread David G. Johnston
On Thursday, March 12, 2020, Rob Sargent  wrote:

>
>
> On Mar 12, 2020, at 7:44 PM, stan  wrote:
>
> On Thu, Mar 12, 2020 at 06:37:02PM -0700, David G. Johnston wrote:
>
> On Thursday, March 12, 2020, stan  wrote:
>
>
> my $rv3 = spi_exec_query('$stmt');
> What am I doing wrong here?
>
>
> Putting a variable name into a single-quoted string and expecting it to
> resolve to the contents of said variable instead of being treated as a
> literal.
> David J.
>
>
> Please look at this.
>
> Here is the code:
>
> my $stmt = qq('SELECT employee_key from employee where id = $user ;');
> elog( NOTICE, "stmt = $stmt" );
> my $rv3 = spi_exec_query($stmt);
>
>
So you fixed the error in the third line i and others pointed out but then
decided to introduce a new error by changing the first line...

David J.


Re: plperl syntax question

2020-03-12 Thread David G. Johnston
On Thursday, March 12, 2020, Rob Sargent  wrote:

>
> The example I saw for qq on the perl site
>
> print(qq(Welcome to GeeksForGeeks));
>
> doesn’t have any quotes in arg to qq
>

Correct.  It also says:

qq() operator in Perl  can
be used in place of double quotes. It uses a set of parentheses to surround
the string.

Try making the sql string without using qq
> my $select = “select’” + $user + “‘;”;
> (or perhaps perl has a formatted string function like printf)
>

This is worse than using correctly.

The OP should (I think) be using a parameterized query instead of brute
force string manipulation since this code is a prone to exploit.

David J.