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 1p5GTC-0003ZL-4D for pgsql-general@arkaria.postgresql.org; Wed, 14 Dec 2022 01:22:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p5GT9-00035U-3d for pgsql-general@arkaria.postgresql.org; Wed, 14 Dec 2022 01:21:59 +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 1p5GT8-00035E-22 for pgsql-general@lists.postgresql.org; Wed, 14 Dec 2022 01:21:58 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p5GT4-0006xb-Pq for pgsql-general@postgresql.org; Wed, 14 Dec 2022 01:21:56 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 006295C0184; Tue, 13 Dec 2022 20:21:54 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 13 Dec 2022 20:21:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1670980913; x= 1671067313; bh=YuHlNEEGgvwv/KG010MHD+vm6TufEhsbNqGQiVP1aw0=; b=S 2dRipsMkWOPjjQFbVss6tXZZPzzdMo+pQoLswD1EDXm+Smx5n6U32KV3ouj0A/zu yi4rEGYUsGOlc1tXeWVQeqL5g1iddNb0NTDW1C5Ub7BrXej4/F6mzbasF9U/QV8R X82aZsE7cIMghSlngfdKu9XyYAWkeYRjQoakC1pyZftouSdGFKSJQLH/E+8FUiMr WQWs43oyx2kYxbMqX6+B71apria9GbKkZskrWfsDSSgcQniHJP61Jr93HDrosePe IevZlFy6emHq2wpjnXw3+hrGG3O7eaIuJFZk8+eyybheOE7AEkucVUJz/IGCrxyx R8W/OkPdCGH0a6tGfzA4Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1670980913; x= 1671067313; bh=YuHlNEEGgvwv/KG010MHD+vm6TufEhsbNqGQiVP1aw0=; b=S Gzc1julvxfBAQe+ahnFvTMtNLfTGx8fE/lfbAm556WEU0gIXr7jBJ70qMsuwdVvp dFyP8ngLf4i+JC3K8puy58wZ/Jm+EEcr9EJWwDC2B7+dPWEw4FUeycSGEJHW2UNs 0T+g92q+NJnYxAgZHPkcBQAFtnG6obFDB4MKBotyFrc6WX29C7lnj+chDN3xHUtO JcnNov0f7sX5A9vpigBIpBxL7Hv0phHVody5bFxzSFT1AS2TGZr2tDYzCWk0F4WL I7viyuW/mX29GJC/hK+hKjwS9GD/xJwgupm7rWHmLH5HY4QjF3fGt58jayxTvT2d X1EjOkWiOHRpfdv0d5VwA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedvgdefvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeehudfgtefhtedtheeiveetueektdejvdfhveekgfdu feegveetuddvuedvgeeggeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Dec 2022 20:21:53 -0500 (EST) Message-ID: <82cb253b-aabf-e7f1-90ba-82a4ef9350c1@aklaver.com> Date: Tue, 13 Dec 2022 17:21:52 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: print in plpython not appearing in logs To: Shaozhong SHI , Ludwig Isaac Lim Cc: "pgsql-general@postgresql.org" References: <1649936435.214554.1669982358413.ref@mail.yahoo.com> <1649936435.214554.1669982358413@mail.yahoo.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/13/22 13:20, Shaozhong SHI wrote: > What is brilliant about plpython?  Any brilliant examples to look at? > 1) It is actually plython(3)u where the u means untrusted. This means you can reach outside the database and do things. That can seen as brilliant or dangerous. 2) You have no end of Python libraries you can work with. Again combined with 1) up you whether that is brilliant or dangerous. 3) Python is more dynamic then plpgsql so you can get more adventurous with doing dynamic SQL. Downside is that plpython(3)u is not tied as closely to SQL as plpgsql so it very often takes you many more lines of code to get something done. -- Adrian Klaver adrian.klaver@aklaver.com