Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:: [': 0.03; 'postgres': 0.09; 'yeah,': 0.09; 'aug': 0.13; 'finished': 0.15; 'attempt.': 0.16; 'doing,': 0.16; 'event-driven': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'poll': 0.16; 'wrote:': 0.17; 'code,': 0.18; 'subject:] ': 0.19; 'appropriate': 0.20; 'received:209.85.214.174': 0.21; 'seems': 0.23; 'somewhere': 0.24; 'header:In-Reply-To:1': 0.25; 'thanks!': 0.26; 'message-id:@mail.gmail.com': 0.27; 'chris': 0.28; 'probably': 0.29; "i'm": 0.29; 'connection': 0.30; 'fri,': 0.30; 'could': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'server': 0.35; 'doing': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'test': 0.36; 'received:209': 0.37; 'sure': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'header:Received:5': 0.40; 'more': 0.63; 'hoping': 0.72; 'approach.': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=xA4uVAtXlRcbRe50/mgoQLZaE0mu7NVtREDyEnq7TMU=; b=uqFQMxckfTz9JFJFQ8C1I0JsTUGrnFc/DuM/eFGkT7Ou6rwiCF6TYyUYmJNlEYhBzi OylPexiK0UC6iPdhOLUai6S8PraCLLyeKWGn1GpIemFCP+UjV7QF0Fa1t5xR2/koMzcg H9YkInIVDUmZeCSrB1zgS34VAu3erQKG6Joy+icbrFC5XN9+4UfoyhjTqxAjUhUY6WS+ E2m7BSoqZmII2Prj12ELynHH45cbzSILIJWEd2mJ81vu9NK+Uef/ObJ69Irc7xxy2Psl JxuLVKNKWH6Hb3U7AuqmTHg98SCiOHHd7rTwhhgwZfhBxvYYme0YsA6nColrW5Ykze1Q 90Tg== MIME-Version: 1.0 In-Reply-To: References: Date: Sat, 11 Aug 2012 00:00:01 +1000 Subject: Re: [GENERAL] Postgres and Upstart From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1344607204 news.xs4all.nl 6965 [2001:888:2000:d::a6]:58218 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:26870 On Fri, Aug 10, 2012 at 11:56 PM, Albe Laurenz wrote: > Chris Angelico wrote: >> I'm looking for a reliable way to be sure that Postgres has finished >> its initialization and is ready to rumble. > > The normal way to test this is a connection attempt. > You could also look into the server logs for the > appropriate message, but that seems more fragile and difficult. Yeah, I can poll it, and that's what I do in a couple of places; but somewhere in the code, it probably "knows" that it's ready. I can keep doing what I'm doing, but was hoping for an event-driven approach. Thanks! ChrisA