Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jtHkj-0000k9-G5 for pljava-dev@arkaria.postgresql.org; Wed, 08 Jul 2020 21:37:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jtHki-0003UO-8s for pljava-dev@arkaria.postgresql.org; Wed, 08 Jul 2020 21:37:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jtHkh-0003SW-Pa for pljava-dev@lists.postgresql.org; Wed, 08 Jul 2020 21:37:16 +0000 Received: from anastigmatix.net ([68.171.219.55]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jtHkf-0003LL-CF for pljava-dev@lists.postgresql.org; Wed, 08 Jul 2020 21:37:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=anastigmatix.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Y8NRvlOtxVQWeKvPG4SIaU2n7l4F0kjgFlm99Ku8xVc=; b=UjgeSuNDdutkZv6djAiNVRORWW l3OI2ynQfAwv+2474pcN7dH4r8RuUUw52ngc5TjV/FqNkpKZM6jNcvmQ8bOhZBHqMC8P21z6APuGa YmNiecJyzT+XLygHyvz10U3iphLYX03+pye7/9bVWDa9wV1pze2gU4BmgSacq9f4mmQH7fg0FiX6R F5QlkipXwazdls855d9aHpJPJ/MHl2nZKZJBFvU0W2ZoOAYDIAN2SLT57oU0DxOAI7tGrw/vkBz5X kk/OpJW0dE/Es47qog7X48Lr8V2mdu7DB0duM6niHnmVKYcqs63zmpHWftKu0rpOVCuaEZYjyC1B/ S4/RcTJg==; Received: from [184.19.31.139] (port=51743) by bay.acenet.us with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jtHkd-008oId-Ff for pljava-dev@lists.postgresql.org; Wed, 08 Jul 2020 17:37:12 -0400 Subject: Re: Detecting test failures reported as warnings To: pljava-dev@lists.postgresql.org References: <5EC17E17.7070002@anastigmatix.net> <5ED15825.9060504@anastigmatix.net> <5ED270BA.9010001@anastigmatix.net> <5ED3D488.1010401@anastigmatix.net> <5ED474CA.3000106@anastigmatix.net> <5ED4EA10.4030801@anastigmatix.net> <5ED7E74B.9020800@anastigmatix.net> <5EDA576E.2000204@anastigmatix.net> <5EDBA5D9.8090506@anastigmatix.net> <5EE7AE8C.2040201@anastigmatix.net> <5EEA6F85.9040009@anastigmatix.net> From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <5F063C86.3070301@anastigmatix.net> Date: Wed, 8 Jul 2020 17:37:10 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <5EEA6F85.9040009@anastigmatix.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=-95.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bay.acenet.us X-AntiAbuse: Original Domain - lists.postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anastigmatix.net X-Get-Message-Sender-Via: bay.acenet.us: authenticated_id: chap@anastigmatix.net X-Authenticated-Sender: bay.acenet.us: chap@anastigmatix.net X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 06/17/20 15:31, Chapman Flack wrote: > I was looking at the various Python driver choices myself the other night > and it wasn't as promising as I thought. pg8000 was the pure-Python one > that I remembered, but can't access warnings (as far as I can tell). For the record, so no future reader of this thread is misinformed, I was wrong about that. pg8000 does make notices/warnings available, using the 'notices' property of a pg8000 Connection. It is a deque that will hold the most recent not-more-than-100 that were received. popleft() will retrieve them in arrival order. Each item is a dict that presents all of the fields of the PostgreSQL notice, keyed by their single-character codes: https://www.postgresql.org/docs/9.6/protocol-error-fields.html So, not only was I mistaken to say "can't access", it in fact provides better access than many other PG drivers. Errors are a bit botched: those raise exceptions of course, and the exception will have a tuple of values. Those are the values of all the fields received from PostgreSQL, just as in the warning case, but with all the keys thrown away, leaving you to guess which field is which. -Chap