Re: persistant psql feature suggestion

From: PeterKorman <calvin-pgsql-ml(at)eigenvision(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: persistant psql feature suggestion
Date: 2003-06-30 01:38:35
Message-ID: 20030630013835.GA13745@eigenvision.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jun 29, 2003 at 05:24:18PM -0400, Andrew Dunstan wrote:
>
> ----- Original Message -----
> From: "PeterKorman" <calvin-pgsql-ml(at)eigenvision(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Jacobs 2003-06-30 01:54:39 Re: [HACKERS] PlPython
Previous Message Joe Conway 2003-06-30 01:01:53 Re: [HACKERS] Missing array support