Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jjSyB-00069C-FQ for pgsql-general@arkaria.postgresql.org; Thu, 11 Jun 2020 19:34:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jjSyA-00021H-CB for pgsql-general@arkaria.postgresql.org; Thu, 11 Jun 2020 19:34:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jjSyA-000219-2q for pgsql-general@lists.postgresql.org; Thu, 11 Jun 2020 19:34:34 +0000 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jjSy6-000764-4a for pgsql-general@postgresql.org; Thu, 11 Jun 2020 19:34:33 +0000 Received: by mail-ej1-x62b.google.com with SMTP id f7so7675214ejq.6 for ; Thu, 11 Jun 2020 12:34:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=x393KKLjokeCMLz7bfFaUggrbiozZKaiKT1im/3o+k8=; b=mUulLw+6FKaNndmWPzxw8qS+sR6xP7s53m4VcLVt6ZJLcnjR1gqOCAHS1Rz0boj1T9 +0OoRqkqYi/V4feFZjQSL22vwu5QabVRqiUEAZyaXg9FBS5GjEK1hPl1BYxzHYVH1lG4 Ie20WgxWYobKRRvfJTBuac+4hI9z/SMDODWGGZLomppzPT6Cfv8O4AX84SMUpUyx7T4l GHWeAsju1hcXcoQt1KdawLkkCysAVmiFQzy0DtQyTz7YMSYwu+IZ2noo//7LmmSbYfU1 6meE1tFIL/zgzexECHx5k9BpGwJRPOEccO1dtX33ShJ8+0yOEFCpJJH4a6O04E7woLTu 64Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=x393KKLjokeCMLz7bfFaUggrbiozZKaiKT1im/3o+k8=; b=mQsqWFenRZV+RhE2PGDHaBekpM8XPA/5FS5oiFY4NtyimbBkvWk6mjjagmTMzNFwEs 9OcLNx072Dv331yQzqzzpsZIhjcLZ+Rzoxk16qdquGsl0iPDS+C2t9VYu46LPJ4JoaJK XbGycbd4hDLwUGD2ItwraOo5lufZiqIlc0rbcrueW2jXSwJcXG/H106LZ5o9eFhAe338 gsJ9ZIfjPKlHnEPCwuOh2bBE5mX+mXhs+46mTuP/AKK+psZW+cHwZB647AqyNfVWcIOk y7FSOrDwCel6U4FbY0k96sJ3Zdu371Flk3tXOcMP1R+elNkcwjcQ9PwSMBwsTZM3dsOf bZPw== X-Gm-Message-State: AOAM530wQTlL9SIaYCI4sveEHyTeeVy+aIQCzeqH7oTgR8fKs7qXqCkp bki4edlG+kwIlSYhOfwsnLU= X-Google-Smtp-Source: ABdhPJwhQLB5EYbRuGPhjt/JtFX/4izFP+2S5NO1qHyG23j5ryqMsDrdRdJohgZiDeH3MkC+qbTDAA== X-Received: by 2002:a17:906:7247:: with SMTP id n7mr9885980ejk.105.1591904068367; Thu, 11 Jun 2020 12:34:28 -0700 (PDT) Received: from hollewijn.internal (217-19-30-105.dsl.cambrium.nl. [217.19.30.105]) by smtp.gmail.com with ESMTPSA id f1sm1953533edn.66.2020.06.11.12.34.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jun 2020 12:34:27 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: table name From: Alban Hertroys In-Reply-To: <75D93B48-9BBC-41C9-A1F8-CB1142F0A031@gmail.com> Date: Thu, 11 Jun 2020 21:34:26 +0200 Cc: Marc Millas , pgsql-general Content-Transfer-Encoding: quoted-printable Message-Id: References: <75D93B48-9BBC-41C9-A1F8-CB1142F0A031@gmail.com> To: =?utf-8?Q?Paul_F=C3=B6rster?= X-Mailer: Apple Mail (2.3445.104.11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On 11 Jun 2020, at 20:58, Paul F=C3=B6rster = wrote: >=20 > Hi Marc, >=20 >> On 11. Jun, 2020, at 20:54, Marc Millas = wrote: >> sorry if my question is tooo simple :-) >=20 > it's not. :-) >=20 >> obviously if I ask: >> select * from regions-20180101; >> I get a syntax error. >> if I try select * from $$regions_20180101$$; >> I get another syntax error. >> If I try to rename that table, same thing. >> if I try a cte, same thing. >>=20 >> What should I do ? >=20 > you can just quote its name: >=20 > select * from "regions-20180101"; >=20 > Cheers, > Paul The background here is that =E2=80=98=E2=80=99 and $$ are quoting of = literals (strings, integers, JSON objects, etc.), while =E2=80=9C=E2=80=9D= is identifier quoting (tables, indices, types, etc.). Identifier quoting not only allows to include special symbols, it also = makes the identifier case-sensitive. That=E2=80=99s probably why Paul = suggested to rename the table to no longer require identifier quoting - = many people consider it a PITA, but it can be used to get out of trouble = like yours - some people insist on it, for example because it makes = using camel-caps in identifiers meaningful. Regards, Alban Hertroys -- There is always an exception to always.