Re: Let file_fdw access COPY FROM PROGRAM - Mailing list pgsql-hackers
From | Corey Huinker |
---|---|
Subject | Re: Let file_fdw access COPY FROM PROGRAM |
Date | |
Msg-id | CADkLM=eNZrtJJmB5DN1WgT7bU6tiiyWt2axW-oLFVVnVe4-usw@mail.gmail.com Whole thread Raw |
In response to | Re: Let file_fdw access COPY FROM PROGRAM (Craig Ringer <craig.ringer@2ndquadrant.com>) |
Responses |
Re: Let file_fdw access COPY FROM PROGRAM
|
List | pgsql-hackers |
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Sep 6, 2016 at 11:44 PM, Craig Ringer <span dir="ltr"><<ahref="mailto:craig.ringer@2ndquadrant.com" target="_blank">craig.ringer@2ndquadrant.com</a>></span> wrote:<br/><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><spanclass="gmail-">On 7 September 2016 at 11:37, Corey Huinker <<a href="mailto:corey.huinker@gmail.com">corey.huinker@gmail.com</a>>wrote:<br /> > On Tue, Sep 6, 2016 at 11:24 PM, CraigRinger <<a href="mailto:craig.ringer@2ndquadrant.com">craig.ringer@2ndquadrant.com</a>><br /> > wrote:<br />>><br /> >> On 7 September 2016 at 11:21, Corey Huinker <<a href="mailto:corey.huinker@gmail.com">corey.huinker@gmail.com</a>><br/> >> wrote:<br /> >> > On Tue, Sep6, 2016 at 6:53 PM, Craig Ringer<br /> >> > <<a href="mailto:craig.ringer@2ndquadrant.com">craig.ringer@2ndquadrant.com</a>><br/> >><br /> >> > And theTAP test would detect the operating system and know to create an<br /> >> > FDW<br /> >> > that hasthe PROGRAM value 'cat test_data.csv' on Unix, 'type<br /> >> > test_data.csv'<br /> >> > on windows,and 'type test_data.csv;1' on VMS?<br /> >><br /> >> Right. Or just "perl <a href="http://emit_test_data.pl"rel="noreferrer" target="_blank">emit_test_data.pl</a>" that works for all of them,<br />>> since TAP is perl so you can safely assume you have Perl.<br /> ><br /> ><br /> > Thanks. I was mentallylocked in more basic OS commands. Am I right in<br /> > thinking perl is about the *only* OS command you can besure is on every<br /> > architecture?<br /><br /></span>Probably, there's a lot of crazy out there.<br /><br /> TAPtests can be conditionally run based on architecture, but<br /> something like this is probably worth testing as widelyas possible.<br /><div class="gmail-HOEnZb"><div class="gmail-h5"><br /> --<br /> Craig Ringer <ahref="http://www.2ndQuadrant.com/" rel="noreferrer" target="_blank">http://www.2ndQuadrant.com/</a><br /> PostgreSQLDevelopment, 24x7 Support, Remote DBA, Training & Services<br /></div></div></blockquote></div><br /></div><divclass="gmail_extra"><br /></div><div class="gmail_extra">Stylistically, would a separate .pl file for the emitterbe preferable to something inline like<br /><br /></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><divclass="gmail_extra">perl -e 'print "a\tb\tcc\t4\n"; print "b\tc\tdd\t5\n"'</div></blockquote><divclass="gmail_extra"><br /></div><div class="gmail_extra">?<br /></div><div class="gmail_extra"><br/></div><div class="gmail_extra">I'm inclined to go inline to cut down on the number of moving parts,but I can see where perl's readability is a barrier to some, and either way I want to follow established patterns.</div><divclass="gmail_extra"><br /></div><div class="gmail_extra"><br /></div><div class="gmail_extra">[*] Forthose who don't perl, the command prints:</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_extra">a b cc 4</div><div class="gmail_extra"><div class="gmail_extra">b c dd 5</div></div></blockquote></div>
pgsql-hackers by date: