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 1sWNRR-00EnfB-0I for pgsql-general@arkaria.postgresql.org; Tue, 23 Jul 2024 21:53:04 +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 1sWNRO-00GtiE-TU for pgsql-general@arkaria.postgresql.org; Tue, 23 Jul 2024 21:53:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sWNRO-00Gti5-Ip for pgsql-general@lists.postgresql.org; Tue, 23 Jul 2024 21:53:02 +0000 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sWNRM-0016B9-9h for pgsql-general@postgresql.org; Tue, 23 Jul 2024 21:53:01 +0000 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-260e99b6661so132944fac.1 for ; Tue, 23 Jul 2024 14:53:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721771579; x=1722376379; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=eaJ/sVi1CxMx91xirSegJ1jmAPUsKGa52GHMoNqb8xI=; b=d8QUVVutels1AaKZO0VNRi9iUHBa44QeHih1hs8QPgigx+acD66nPTPx3wp2gYNlWt RDE+9bskyP913Le/yF8F9om5grfXsARdA3rbsYKOed9f105EMUhQIbol6KPHbR0wBETQ kTNgtwvL4Pqg6utvCC1jSF7cvrixDCEa+vf6J0ImjgwEC45secdS8z6pN25/VE8bDNvt F3eBforeoy11BeebMyww62KuGI3RIXdAW8xXJ4YToNI8oQUImrKSFNAgRgWUMZ8S+UrR YAJgRt/fGQlby/nc02JPIzfeGuQl+rPfsOuQ2r0PEfZ8hiwK/hxgj4GTxurl3NAGiGia qLSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721771579; x=1722376379; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eaJ/sVi1CxMx91xirSegJ1jmAPUsKGa52GHMoNqb8xI=; b=kXnGgC33My8o5QZq9gg/3XqtlzlNdz6EVMcZi8yEFij2q44+ppTCGoqddiYvRFIuF2 IHMkrpZ5JcF3m1ILPLW2stGqtyUbgyGvSeIJb5CBDHXPyOGPQ8+sHphXDmLwyg29LQE5 beXQ/2XSC6hcw2CdGhmgHaZcFTE9JH18KNk1iHIB/QJrAqu6bwmBAl5QAO2TDFhi49Xg f3cYmfFpQcNKynWuShXyYQoNNafxfx8f/+Z0t3HPkkSDIJ/WgRCZKiIJ6ZLpQARf5ECF JBEX2oxdpm8wTgaKAic52aah5k6Yj/Q5BdwxeFTHEsxVNX67mfiKQQxvey8RO4WjBTgB LhiA== X-Forwarded-Encrypted: i=1; AJvYcCU6wZ98Md6lZuhTm/XyUxr8nnI5qE0QwAFanVnuRFVW4jz88JiIkfFPNIJKxtdJkCVF9DZ9R6XemcibytXETiO4Zl9QRHoe6Xh86Ko6 X-Gm-Message-State: AOJu0YxNicPfEC+x49ndwnuwF3jZRVbZJZ6pjJBDuFhu4/0SwkqpbM0V mznxAPF+C3a7BmqxEuHyRDXqhQYAzLRqpBB9G1yuj8No5dK5QjkO627Zfbm/bzJIWcORew0qlv4 U5djCZKVhx84wRCyDZY609LQbdsA= X-Google-Smtp-Source: AGHT+IF9i+7eQavB4T3VTlur5E03lrro8PJ4WcruYNDMXUhJ4D31Sykhu8ZCJwACJmsIEQiVHmIX8fA3DhQV2fjmmFo= X-Received: by 2002:a05:6871:9c10:b0:261:a04:2aad with SMTP id 586e51a60fabf-2646ea52bf5mr1680405fac.6.1721771578815; Tue, 23 Jul 2024 14:52:58 -0700 (PDT) MIME-Version: 1.0 References: <1aea530e4c96109b91fdde53a29e38beb625dc77.camel@kortschak.io> <20240723221121.51f2b3872d0ebfc36a6fa8ff@wanadoo.fr> <2f11b2ba-3182-492a-ab46-23cfa5ec913c@aklaver.com> In-Reply-To: <2f11b2ba-3182-492a-ab46-23cfa5ec913c@aklaver.com> From: Dominique Devienne Date: Tue, 23 Jul 2024 23:52:47 +0200 Message-ID: Subject: Re: re-novice coming back to pgsql: porting an SQLite update statement to postgres To: Adrian Klaver Cc: Vincent Veyron , Dan Kortschak , pgsql-general@postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jul 23, 2024 at 10:35=E2=80=AFPM Adrian Klaver wrote: > Just know that SQLite does not enforce types [...] That's true, and applies to the OP's schema. But for the record, SQLite *can* enforce types these days, on an opt-in basis, with [STRICT tables][1]. Albeit with a limited type-system. --DD PS: and could be done manually even before, with CHECK (typeof(col)=3D'blob') for example. [1]: https://www.sqlite.org/stricttables.html