Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123369 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 2BD461A009C for ; Mon, 20 May 2024 13:08:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1716210581; bh=m2BNbKIhc2FADsQxtq3cpMWBo4huX8IPlnIboTwrHZk=; h=Date:Subject:To:References:From:Cc:In-Reply-To:From; b=FqSqxG5TKChr3jUOdRuQMMPYUp4b4/xXAGOvfWAAkkeoj99QkkmQVo7P8x0eDEl8p UkeSjMY8154X/XL9vHpoxjSj/gNDJVENcxURVq/OCuRFEuMzSo8f8IpVwaJUvko/xc lJwSpEJ4L2uHqsKPMgj4C7jVzkOCqPcdHEWdHi+B7iSYYQF831TYP2XwH502ANMwTz /M6YHVdjiA5SBanKNq9bKRouof6Gozx9sVp50G05Ts0JLbvS4f/qF7bOOcjzRAKfmZ wgSUdzyVNCGo8YLwGs36uDlqNz0gj44BvKq6MKsrCrPCKlOoSGXGb9HU9OTDWmhNEa ga3ih1WbzLKfw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B63BD180057 for ; Mon, 20 May 2024 13:09:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from wfout5-smtp.messagingengine.com (wfout5-smtp.messagingengine.com [64.147.123.148]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 20 May 2024 13:09:39 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfout.west.internal (Postfix) with ESMTP id E65F11C00189; Mon, 20 May 2024 09:08:42 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 20 May 2024 09:08:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beccati.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1716210522; x=1716296922; bh=tKNIa2P+9inFUPfq53RzPieax+r2opZI7YCKHieUICg=; b= KR4Q4Ib1Xa+Lfqxu544Ff1ECbiq7rnP3sSkfpKBb7P6ii26/m6pBLm31WWorOURL Idym811AcaJdMDTY/Zbdr4XRQQwoUKvNRQi/Cda/eOkT4kGsuzo7Xj4NPA5DvRxp BPMWKxmOqFK1j9JheWiCqiPFFOMoFzygK/bYym+1jpTqwSctDjifKVwcmqOlM5Kq xTYTcX6bXOouwFlMXasa+cP9nD4MHeCEb+7d5iMTpj5KW7cUgbN5BlbvKld61+xQ EYBNDMECzFGHYOynAfrHjPSBI8EYs8P7sbQg0+ehz/FyRSyfE5Ik+X5Z29S0i+ov AlhvtIIxb0/tq21W9EwGbw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1716210522; x= 1716296922; bh=tKNIa2P+9inFUPfq53RzPieax+r2opZI7YCKHieUICg=; b=c U2Fg46qxGBqI65ydZSwEeBXd0hudS4+HEWgE/LFvdNSXwsH+cLNJWrdcuQG58lnJ lQloLu9tTSJbtxL7+oKFfXOdZw3dQksTVaR+OlGeCDdfES+vmaur5otyB5S0t+Sv lu//pRYdXXtLUOPnQVg2T810fJThYyBb1sDLTdxK0xN42QqQOfN3PnY8btlNQfDC Mp57a+r9kcPHKsbHAfv+PZVnYZ3qHXJoLDeCfoeiY9yTuydl8crheQzyedHL3bfI tPGEotSloxYcPrqjb1N+5VGh9YmLgz8aDfqQcM9xTDGdlpbu3vqpKmmmc4qb3qFZ Y8g7xlf/xOvV7BVz/xBzQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdeitddgfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhvegjtgfgsehtkeertddtvdejnecuhfhrohhmpeforght thgvohcuuegvtggtrghtihcuoehphhhpsegsvggttggrthhirdgtohhmqeenucggtffrrg htthgvrhhnpeefledutddvteefheekffevleejieejhfelvddvheduiefftdevveehhefh ffdvueenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgpdhgihhthhhusgdrtg homhdpsggvtggtrghtihdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehphhhpsegsvggttggrthhirdgtohhm X-ME-Proxy: Feedback-ID: i6f4c46c2:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 20 May 2024 09:08:41 -0400 (EDT) Message-ID: <153b8bf3-961a-45c9-b808-a18c90d828b7@beccati.com> Date: Mon, 20 May 2024 15:08:39 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] ext/pgsql: pg_put_line deprecation proposal To: PHP internals References: Content-Language: it Cc: David CARLIER In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: php@beccati.com (Matteo Beccati) Hi, Il 20/05/2024 14:03, David CARLIER ha scritto: > I would like to know if it would be fine to deprecate pg_put_line > . > > Reasoning is PQPutLine is part of the obsolete list of calls for COPY > purpose >  since the PostgreSQL protocol 3.0 version (supported since postgresql 7.4 released about 20 years ago, see New client-to-server protocol regarding COPY ). > > Related PR . I have fond memories of using pg_put_line several years ago! It is true that it's obsolete and although they still work, they are deprecated in libpq. However, I have a few remarks... If you're targeting the protocol 3.0 change, what is deprecated is the pg_put_line('\\.') call that needed to be sent before calling pg_end_copy(). pg_put_line() is used to send data, not just the end message. Hence, the UPGRADING message misrepresents the reason why pg_put_line() is deprecated. In case we really decide to deprecate pg_put_line on the PHP side, so should be pg_end_copy. However we don't provide a full alternative to it, because pg_copy_from only accepts arrays, according to the documentation. As such, there is no real alternative for "streaming" data without storing it all in memory. Unless we provide it, I would vote against deprecating them. My opinion could change if pg_copy_from() worked with generators, but I still think the two function still have a place for those needing low-level access. Cheers -- Matteo Beccati Development & Consulting - http://www.beccati.com/