Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iNJr7-0002Ek-BW for pgsql-general@arkaria.postgresql.org; Wed, 23 Oct 2019 16:51:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iNJr5-0008VZ-9Q for pgsql-general@arkaria.postgresql.org; Wed, 23 Oct 2019 16:51:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iNJr4-0008VG-Pu for pgsql-general@lists.postgresql.org; Wed, 23 Oct 2019 16:51:27 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iNJqx-0004Ey-QX for pgsql-general@lists.postgresql.org; Wed, 23 Oct 2019 16:51:25 +0000 Received: by mail-wr1-x435.google.com with SMTP id l10so22468863wrb.2 for ; Wed, 23 Oct 2019 09:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ocado.com; s=google; h=reply-to:subject:to:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Cv+VZSHU0i+4eVFCmIPGOYBLExRDAUh0kevGnW8nXPA=; b=ULywVE5C7WXUjzG+DH7aZ7OMJeNrcloVcZW7crT11/g32Djkj+fItuCj5x7GLLPaj4 22TzCjFlqV3T+5XYEkgiABDN6zzopkgC6dFoA996A6HLtRPuut+q2+HL1RffDhimPcXY itzfh2CYLfQPH4SR8G2LAkeBMQFSfM11QS+SNMvuFhtEGP7wgf0nqRDdyuSPwNPoP3rC GCjQ81gYhJGrD5HP7CvfnXMJr5a9mBLcoaa+pUXvMQAu3xhYEInyslDQ2WOuaiAU9bVo tIk6QvFmdrMidERxL9cjfkNHFaIKsl73CPzBuL2dH2FYBK+sJEJjJ7wSEbzY0mAUot0p dr8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Cv+VZSHU0i+4eVFCmIPGOYBLExRDAUh0kevGnW8nXPA=; b=FXDW9CptdHrfF6Ax27uiTX7vt3BVtlq7TWsnbHyd2PV6gpPrn/CvOv7zw4Bf58p2JZ 29+LggWOmJ+LVVuUsPlTASYsS/UdD4ZxybXWDo3j2oL8/4rePCadOIk6SOIn5V3xyfYR mjt6u6kezNcjYOs3pFHG5i/YXuh5/R+Y42z6ZbPvOAiPDyniIa6+izy2r3ye2MGw5QSH KX46j5alo3qJGRv3Ae6D7YvLydvgXHsEMTCIcKC9eQHG8BcoTTUvHe9FBli7Hae9KbFT A7mihx4QPe/n0jWoWBB5ZCsKJj0ClJkVlDRlYAnZENDvV/ZBxQ4rn4IDhIqtdbNaef9B DKcA== X-Gm-Message-State: APjAAAWWDi1vvZaGrHvHx3js/B1A2aq9iywTmFZIqvEtZayedk/+LY7i 84s0mJ2SNpv48ygb0oUhOU5RIaJzAqOcja2arRwo9h4ylXfJYgrmKpywqJjNVTzbBxqQjE5hujj QpVYU11v6WyBVYNfW8cAcfE0FAQowgg== X-Google-Smtp-Source: APXvYqyavrTUbLMPzbnL9NQ7LXD9Rjd3eBz1Qv9c6nnsYChbFAQww8X9AxCl9uR1UxrE0pq8SDrk0Q== X-Received: by 2002:a5d:630b:: with SMTP id i11mr8846386wru.87.1571849477770; Wed, 23 Oct 2019 09:51:17 -0700 (PDT) Received: from [10.62.14.68] ([91.206.1.124]) by smtp.gmail.com with ESMTPSA id i1sm30203552wmb.19.2019.10.23.09.51.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Oct 2019 09:51:16 -0700 (PDT) Reply-To: f.venchiarutti@ocado.com Subject: Re: Is this a bug ? To: Ron , "pgsql-generallists.postgresql.org" References: <6048315C-CE0E-482F-9F48-B300E4D7AC52@aol.com> <9df3ba0d-974d-f13d-ec91-bc22c3ab362b@gmail.com> <24295.1571846414@sss.pgh.pa.us> <98b7422b-7ee6-03b5-2312-cd310b763747@gmail.com> From: Fabio Ugo Venchiarutti Organization: Ocado Technology Message-ID: Date: Wed, 23 Oct 2019 17:51:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <98b7422b-7ee6-03b5-2312-cd310b763747@gmail.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 23/10/2019 17:30, Ron wrote: > On 10/23/19 11:27 AM, Geoff Winkless wrote: >> On Wed, 23 Oct 2019 at 17:20, Geoff Winkless wrote= : >>> For what it's worth, I can see a value to having >>> >>> SELECT 'this is quite a long string' >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 'which I've joined together ' >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 'across multiple lines'; >>> >>> although the advantage of it vs using a concat operator is slim. >> As an aside, Postgres isn't the only DB to follow the standard here. >> >> mysql> select 'hello' >> =C2=A0=C2=A0=C2=A0=C2=A0 -> ' there'; >> +-------------+ >> | hello=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | >> +-------------+ >> | hello there | >> +-------------+ >=20 > This is the kind of weird stuff that we mocked mysql for. >=20 > This too would have been roundly mocked if discovered in mysql: >=20 > postgres=3D# select to_date('2018150X','YYYYMMDD'); > =C2=A0 to_date > ------------ > =C2=A02019-03-03 > (1 row) >=20 >=20 The main difference being that we mocked MySQL because it BROKE the=20 standard requirements in bespoke, arguably lazy/stupid/dangerous ways=20 (and often undocumented as a result). You ran into a gotcha of the SQL specification; in your shoes I'd=20 instead appreciate the fact that the PG maintainers went out of their=20 way and documented this spec weirdness as such in their own project when=20 they could have just went "look into the specification for oddities". MySQL silently truncated your overflowing string for years without as=20 much as a warning, by default. In my book that broke specification, rule=20 of least surprise, data safety and a lot more. --=20 Regards Fabio Ugo Venchiarutti OSPCFC Network Engineering Dpt. Ocado Technology --=20 Notice:=20 This email is confidential and may contain copyright material of=20 members of the Ocado Group. Opinions and views expressed in this message=20 may not necessarily reflect the opinions and views of the members of the=20 Ocado Group. If you are not the intended recipient, please notify us=20 immediately and delete all copies of this message. Please note that it is= =20 your responsibility to scan this message for viruses. References to the=20 "Ocado Group" are to Ocado Group plc (registered in England and Wales with= =20 number 7098618) and its subsidiary undertakings (as that expression is=20 defined in the Companies Act 2006) from time to time. The registered office= =20 of Ocado Group plc is Buildings One & Two, Trident Place, Mosquito Way,=20 Hatfield, Hertfordshire, AL10 9UL.