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 1s36fL-009UcN-Hv for pgsql-general@arkaria.postgresql.org; Sat, 04 May 2024 04:06:27 +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 1s36fI-00Er4W-Mc for pgsql-general@arkaria.postgresql.org; Sat, 04 May 2024 04:06:25 +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 1s36fI-00Er0w-5P for pgsql-general@lists.postgresql.org; Sat, 04 May 2024 04:06:25 +0000 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s36fG-001LMZ-2s for pgsql-general@lists.postgresql.org; Sat, 04 May 2024 04:06:23 +0000 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6ee2be5b765so169969a34.0 for ; Fri, 03 May 2024 21:06:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714795581; x=1715400381; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=SmwTLGtEnYYcy1TWUESHX4pIi2U9SlHEwHzmNIASgtI=; b=Kt0G0Fr7BKz1zRp9/x5xCoFfntyBzbOMcCBLOFS2He28bNydLdjt9/2qz/4fxyxIOO 3D57ROuGloZv4wdu2TllUx0rnIpiOVkjfS/tibDn1FS6Ba2frQiFTQlAcP9rfxNpKovL MebUYhDd45LTVaea02H0Xq6d4exPkrz4chN7z8i2sQtDbDKFS9bJvf9zD+iby1kF02f+ f+kPDrmjQuztOIoBX+T8fEYK0y4FZMCEYp83llz25/80GMfWKXZSJaZBLvL2dkvqIwe5 UL/Bh9ZTBz2NvEHbcwwmrQ9MDFinYR2txdz7tRH5l0HS6VC0AYRwO0sgH9Q9pep4Hwss x8hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714795581; x=1715400381; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SmwTLGtEnYYcy1TWUESHX4pIi2U9SlHEwHzmNIASgtI=; b=Gydst4qVm/ex/4Fse7H4C04rRnXoBwakvn2MqdSsXdQjq6O9KU5PfI96XKqhkhHUJ+ ieMGqIvuK1IrnvHJ3O7bxezYzuAgfPuBz3JiSvq6KgWY/0QprHu3YrYWa57DmCEyD7f5 TfB40WJnG5cZqIXtuFBxeGG3edWFRDlHNdKcB8quJTwmSgCzUdPCpnZfsi7TvXMdmpb1 BTQhTIXrooF4Q/u30bQVv9MwqFXaA7q38XgW6hbpXG8pty/S427CdfhojNU0kbQ6KFaR b+FjWX4W/ACWP0mnlpUUKxQyOu1DuCaZ4Jx7Ewa3qQbUySNdI9wpBHBp1VIIptqriqwh L38Q== X-Forwarded-Encrypted: i=1; AJvYcCUO0z0xS/r6Uv//9f+IHhOzMyPgs81Z+NiiTweMdfBlvsyOExAZK856sLwFI8ngIXt3sgXsNuVKwXKw8s6MpY2AIfRP+uH/SS66Ekwh8USxTAeO X-Gm-Message-State: AOJu0YxoEhFJkRqbqLprTjXmPNLPze+BCzZxu4/w4lhXVXZ8U2EMohhU YAVEsD9ImaKlzcy0OTdtgi8HL2KB45aCCKtIaMHM9BNuaD8motsNhmd1Ng6Qd8ZOgjGrGhxmasq tzLKkjbtfxxLxxkbDlnqUKuRodxQ= X-Google-Smtp-Source: AGHT+IFX37IYKeHpiS2NnDOTqi+J+rsply2NiWyewhF4Ky0OzPGblhrwOhICfqZSztpXJHgbQnhNZ02vJ2b2tVWL63E= X-Received: by 2002:a9d:6b84:0:b0:6eb:7edd:c2fa with SMTP id b4-20020a9d6b84000000b006eb7eddc2famr4895737otq.4.1714795580657; Fri, 03 May 2024 21:06:20 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:5f0a:0:b0:52a:9016:8503 with HTTP; Fri, 3 May 2024 21:06:20 -0700 (PDT) In-Reply-To: <2808875.1714794677@sss.pgh.pa.us> References: <7c3a1c91-566a-46f7-82b5-b47eac58c500@aklaver.com> <2746167.1714770911@sss.pgh.pa.us> <2808875.1714794677@sss.pgh.pa.us> From: "David G. Johnston" Date: Fri, 3 May 2024 21:06:20 -0700 Message-ID: Subject: Re: \dt shows table but \d says the table doesn't exist ? To: Tom Lane Cc: jian he , Adrian Klaver , Magnus Hagander , David Gauthier , "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000007296c1061798f5ae" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000007296c1061798f5ae Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Friday, May 3, 2024, Tom Lane wrote: > > > By and large, I'd expect people using mixed-case table names to get > accustomed pretty quickly to the fact that they have to double-quote > those names in SQL. I don't see why it's a surprise that that is also > true in \d commands. > > Every day the number of people increases who get mixed-case names in their DB because their client language preserves case and doesn=E2=80=99t require= quoting. And it isn=E2=80=99t like any sane person is using case to distinguish name= s in their DB and so would be at risk of seeing multiple unwanted matches for any given pattern. I don=E2=80=99t think name pattern matching during object lookup is a good = tool to wield to try and convince people that using camel case is a bad idea and they should use snake case instead. If they don=E2=80=99t write enough raw= SQL to be annoyed by their choice more power to them, making \d more accessible for them is a win and snake case people won=E2=80=99t notice or care. David J. --0000000000007296c1061798f5ae Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Friday, May 3, 2024, Tom Lane <t= gl@sss.pgh.pa.us> wrote:

By and large, I'd expect people using mixed-case table names to get
accustomed pretty quickly to the fact that they have to double-quote
those names in SQL.=C2=A0 I don't see why it's a surprise that that= is also
true in \d commands.


Every day the number of people increases w= ho get mixed-case names in their DB because their client language preserves= case and doesn=E2=80=99t require quoting.

And it = isn=E2=80=99t like any sane person is using case to distinguish names in th= eir DB and so would be at risk of seeing multiple unwanted matches for any = given pattern.

I don=E2=80=99t think name pattern = matching during object lookup is a good tool to wield to try and convince p= eople that using camel case is a bad idea and they should use snake case in= stead.=C2=A0 If they don=E2=80=99t write enough raw SQL to be annoyed by th= eir choice more power to them, making \d more accessible for them is a win = and snake case people won=E2=80=99t notice or care.

David J. --0000000000007296c1061798f5ae--