[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [GENERAL] executing os commands from a function
From:       "David G. Johnston" <david.g.johnston () gmail ! com>
Date:       2016-09-30 15:45:32
Message-ID: CAKFQuwYoQcEQ83B=tty-D0seT0=rfWbMxCZxAA5jnX_SDaGy+Q () mail ! gmail ! com
[Download RAW message or body]

On Thu, Sep 29, 2016 at 2:41 PM, Armand Pirvu (home) <armand.pirvu@gmail.com
> wrote:

> I used plsh extension but I had to use two functions and a trigger, see
> code below
>

​I don't see any way to not use a trigger given your requirement.  And as
written I don't see that you need the second function​ - just write the
trigger function in plsh.  Admittedly its probably better to have two
functions from an architecture standpoint.

Listen/Notify doesn't seem to make sense as you want the server to ensure
that the file exists - not some other client that may or may not be
connected.

​David J.

[Attachment #3 (text/html)]

<div dir="ltr"><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif"><span \
style="font-family:arial,sans-serif">On Thu, Sep 29, 2016 at 2:41 PM, Armand Pirvu \
(home) </span><span dir="ltr" style="font-family:arial,sans-serif">&lt;<a \
href="mailto:armand.pirvu@gmail.com" \
target="_blank">armand.pirvu@gmail.com</a>&gt;</span><span \
style="font-family:arial,sans-serif"> wrote:</span><br></div><div \
class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I used plsh \
extension but I had to use two functions and a trigger, see code \
below<br></blockquote><div><br></div><div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">​I don&#39;t see any way to not use \
a trigger given your requirement.   And as written I don&#39;t see that you need the \
second function​ - just write the trigger function in plsh.   Admittedly its \
probably better to have two functions from an architecture \
standpoint.</div></div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">Listen/Notify doesn&#39;t seem to make \
sense as you want the server to ensure that the file exists - not some other client \
that may or may not be connected.</div><div><br></div><div><div class="gmail_default" \
style="font-family:arial,helvetica,sans-serif">​David \
J.</div></div></div></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic