Re: fcntl(SETLK) [was Re: 2nd update on TOAST]

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: fcntl(SETLK) [was Re: 2nd update on TOAST]
Дата
Msg-id 200007081300.JAA10328@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: fcntl(SETLK) [was Re: 2nd update on TOAST]  (Mike Mascari <mascarm@mascari.com>)
Ответы Re: fcntl(SETLK) [was Re: 2nd update on TOAST]  (Alfred Perlstein <bright@wintelcom.net>)
Список pgsql-hackers
> > my $pgsocket = "/tmp/.s.PGSQL.5432";
> > 
> > # try to connect to the postmaster
> > socket(SOCK, PF_UNIX, SOCK_STREAM, 0)
> >         or die "unable to create unix domain socket: $!";
> > 
> > connect(SOCK, sockaddr_un($pgsocket))
> >         and errexit("postmaster is running you must shut it down");
> > 
> > oh yeah... :)
> > 
> > -Alfred
> 
> I don't get this. Isn't there a race condition here?

That's a good point.  I don't think so because the socket will only
create for one user.  Basically, we don't need something bulletproof
here.  We just need something to prevent admins from accidentally
starting two postmasters on the same port.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alfred Perlstein
Дата:
Сообщение: Re: fcntl(SETLK) [was Re: 2nd update on TOAST]
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: postgres TODO