Re: persistant psql feature suggestion - Mailing list pgsql-hackers

From PeterKorman
Subject Re: persistant psql feature suggestion
Date
Msg-id 20030630013835.GA13745@eigenvision.com
Whole thread Raw
In response to persistant psql feature suggestion  (James Pye <jwp@rhid.com>)
List pgsql-hackers
On Sun, Jun 29, 2003 at 05:24:18PM -0400, Andrew Dunstan wrote:
> 
> ----- Original Message ----- 
> From: "PeterKorman" <calvin-pgsql-ml@eigenvision.com>
> > 
> > I like your solution. But I think I'd code it:
> > 
> > my $psqlpid = open(OUTPIPE,"|-") || die qq(cant fork: $!);
> > 
> 
> Won't that cause the child to die because it will have 0 in  $psqlpid?

Doh!!

A rhetorical question, no doubt.


----------------------------------------------------------
#!/usr/bin/perl
                  
 

#except for sigchld, This is better.

my $pid;
defined($pid=open(X, "|-")) || die qq(cant fork: $!\n);

if ($pid){   system(qq(touch parent));
}
else{   system(qq(touch child));
};

----------------------------------------------------------

I wrongly guessed that control would resume at the line 
following:

> my $psqlpid = open(OUTPIPE,"|-") || die qq(cant fork: $!);

There are, evidently, many things I'm too stupid to remember;-\

Cheers,


JPK





pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: pgsql-hackers@postgresql.org
Next
From: Tom Lane
Date:
Subject: Re: PlPython