Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sWMEi-00Eg5w-7K for pgsql-general@arkaria.postgresql.org; Tue, 23 Jul 2024 20:35:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sWMEg-00GLkD-CQ for pgsql-general@arkaria.postgresql.org; Tue, 23 Jul 2024 20:35:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sWMEf-00GLk4-5r for pgsql-general@lists.postgresql.org; Tue, 23 Jul 2024 20:35:50 +0000 Received: from fout5-smtp.messagingengine.com ([103.168.172.148]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sWMEb-00174z-Ed for pgsql-general@postgresql.org; Tue, 23 Jul 2024 20:35:48 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id D222F1380073; Tue, 23 Jul 2024 16:35:43 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 23 Jul 2024 16:35:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.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=1721766943; x=1721853343; bh=D3pw7Gly4UMhzICaT0kZKs3lBysy5Z5TdndkA7IABMc=; b= QrbmhyIZcS9DcIIGunBv5SebQk/K56wG4StI5WTyJkFolFL4IWbuGEjYY9Ft2zyp huvk0DtFXjaEMeLplh0ogzScHh0M7rh5+0IhD+9cW60j5MXGBl39JZ34z98bi9GE b6Su8tweKAv0vqnJJZ1hgmvKeZeccAA9HSOugs3n5Xr0UwFPxoi9U4oYDbQyWAU9 6Ru3NfMsvqlG5yTf0VFqVQeB9kAsFrrF8SY6DVzEEfS6HBONm3iOmyPFD9ASDolt lDw8Uxj20B/19uMs9uUKA2i1A9zYiK5NZZTSGcfVjsYhBpNhB/sIYnqRUR1GRBvT lHgnQ9Lo4WbuTVszMGbBhQ== 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=fm3; t=1721766943; x= 1721853343; bh=D3pw7Gly4UMhzICaT0kZKs3lBysy5Z5TdndkA7IABMc=; b=i y83KWoy0B7zf+dNXHgb6v9X+NZy+LZ/tMpLT8+Tja/14c5tN7XqrUS4O3XpR82Tk i1QMCSlBnjbr1dHsP87aC811L05lI9gxopBEaOWVqL9MLo6GTibNpEm3hpryRayd fH0yR3AaJ5vwqmxuhS64NLnkYTzZNdCW9ARpt2EhSwdmJMx6+f144m+tQuSe6MgS HiHFfUWxLCWzDTFz2wt+NKf6w10Ho2ptTHXteJIY2GfxD0GSDC5oBZ/IARBBADv4 eSLsW95kR+whH5vCOfpLNnxg4a98LSJwCuTg0CJT3eDbdSAhf79zLs2ivihNpAx/ ZEgI1skZzro8nRqimp6nA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrheelgdduhedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfevfhfhjggtgfesth ejredttddvjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeeuudefje ejgffgtddtgeehgfekueevkeekieettedtkeffheeivdethfevffegueenucffohhmrghi nhepphhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdr tghomhdpnhgspghrtghpthhtoheptd X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 23 Jul 2024 16:35:42 -0400 (EDT) Message-ID: <2f11b2ba-3182-492a-ab46-23cfa5ec913c@aklaver.com> Date: Tue, 23 Jul 2024 13:35:42 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: re-novice coming back to pgsql: porting an SQLite update statement to postgres To: Vincent Veyron , Dan Kortschak Cc: pgsql-general@postgresql.org References: <1aea530e4c96109b91fdde53a29e38beb625dc77.camel@kortschak.io> <20240723221121.51f2b3872d0ebfc36a6fa8ff@wanadoo.fr> Content-Language: en-US From: Adrian Klaver In-Reply-To: <20240723221121.51f2b3872d0ebfc36a6fa8ff@wanadoo.fr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 7/23/24 13:11, Vincent Veyron wrote: > On Mon, 15 Jul 2024 20:31:13 +0000 > Dan Kortschak wrote: > >> My question is where would be the best place for me to looks to learn >> about how to implement a port of this SQLite? and what would broadly be >> the most sensible approach to take (to narrow down what I need to read >> through in learning)? >> > > This is the goto page for anything SQL : > https://www.postgresql.org/docs/current/sql-commands.html > > For DateTime types : > https://www.postgresql.org/docs/current/datatype-datetime.html > > For JSON types : > https://www.postgresql.org/docs/current/datatype-json.html Just know that SQLite does not enforce types, therefore it is entirely possible that there are values in fields that are not valid in Postgres. Think: select ''::integer ERROR: invalid input syntax for type integer: "" LINE 1: select ''::integer > > If your query works in SQLite, all you have to do is read those, and try to port; if it fails, read them again. Also search the archives of the pgsql-general list, many answers in there > > -- Adrian Klaver adrian.klaver@aklaver.com