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 1rqK84-00BjVt-NV for pgsql-general@arkaria.postgresql.org; Fri, 29 Mar 2024 21:51:17 +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 1rqK83-004ltm-Rb for pgsql-general@arkaria.postgresql.org; Fri, 29 Mar 2024 21:51:15 +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 1rqK83-004ltW-FY for pgsql-general@lists.postgresql.org; Fri, 29 Mar 2024 21:51:15 +0000 Received: from smtp-relay-01-8.dondominio.net ([31.214.176.31]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rqK7n-0077Ct-0j for pgsql-general@lists.postgresql.org; Fri, 29 Mar 2024 21:51:14 +0000 Received: from localhost (smtp-relay-local.scip.local [127.0.0.1]) by smtp-relay.dondominio.com (Postfix) with SMTP id 3702B40647 for ; Fri, 29 Mar 2024 22:50:54 +0100 (CET) Received: from mail-node.dondominio.com by smtp-relay.dondominio.com (Postfix) with ESMTP id 093464062A; Fri, 29 Mar 2024 22:50:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=negora.com; s=dddk; t=1711749053; bh=SsqzO11xYfbeED3VUOMH/5wzc8hgrs+YQI/KsowT3RQ=; h=Content-Type:Message-ID:Date:Subject:To:From; b=hUZxccFlDlkJmgciAlHg4u3S8amtsW8xv+1QEjFxfoYTT6/udUeAR3r6R1JYE11Jh xf+GJuLGcsrzdQLHQZ2pAhXg5OqXmCuigzJjylT2hJDYUzh1J2evrvPONGMMbXxaiL EhtWrnkpcmQNYiFkjIUhZtpq0+571XBNWb6K4rgs= Received: from [192.168.24.5] (4.red-83-58-241.dynamicip.rima-tde.net [83.58.241.4]) (Authenticated sender: public@negora.com) by mail-node.dondominio.com (Postfix) with ESMTPA id CD2E8401DF; Fri, 29 Mar 2024 22:50:52 +0100 (CET) Content-Type: multipart/alternative; boundary="------------L1GdhMXTeLQ0NFyU9zbBYAIg" Message-ID: <36cef37d-32cf-45f4-a4ce-01dc29cad5e1@negora.com> Date: Fri, 29 Mar 2024 22:50:52 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: How to reference a DB with a period in its name ? To: David Gauthier References: Content-Language: en-US, es-ES, en-GB Cc: pgsql-general@lists.postgresql.org From: negora In-Reply-To: X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail-node.dondominio.com [0.0.0.0]); Fri, 29 Mar 2024 22:50:52 +0100 (CET) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------L1GdhMXTeLQ0NFyU9zbBYAIg Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi: I think your problem is in the Perl side more than in PostgreSQL's. When you said you tried escaping with \, Did you mean *exactly* this? "delete from \"thedb.v1\".theschem.thetab where col1 = 1" I think this should work. Or you can use single quotes to enclose the query, so that you don't need to escape the double quotes: 'delete from "thedb.v1".theschem.thetab where col1 = 1' Best regards. On 29/03/2024 22:16, David Gauthier wrote: > Hi: > > I have a DB named "thedb", which has a schema called "theschem" which > has a table called "thetab".  In a perl/DBI script, I am able to work > with the table by referencing it as... "thedb.theschem.thetab" as > in... "delete from thedb.theschem.thetab where col1=1" > > No problem (so far...) > > New DB now has a name "thedb.v1" (notice the "."), the schem and table > are the same as above.  But now I'm getting a syntax error presumably > because of that "." introduced in the DB name. > > I tried encapsulating the DB name in double quotes (no good), single > quotes (still no good) escaping with '\' (no good), escaping with ".." > (no good). > > Is there a way I can reference the DB which has the "." in it's name ? > > v11.5 on linux (I know, way past time to upgrade) > > Thanks in Advance ! --------------L1GdhMXTeLQ0NFyU9zbBYAIg Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi:

I think your problem is in the Perl side more than in PostgreSQL's. When you said you tried escaping with \, Did you mean exactly this?

"delete from \"thedb.v1\".theschem.thetab where col1 = 1"

I think this should work.

Or you can use single quotes to enclose the query, so that you don't need to escape the double quotes:

'delete from "thedb.v1".theschem.thetab where col1 = 1'

Best regards.


On 29/03/2024 22:16, David Gauthier wrote:
Hi:

I have a DB named "thedb", which has a schema called "theschem" which has a table called "thetab".  In a perl/DBI script, I am able to work with the table by referencing it as... "thedb.theschem.thetab" as in... "delete from thedb.theschem.thetab where col1=1"

No problem (so far...)

New DB now has a name "thedb.v1" (notice the "."), the schem and table are the same as above.  But now I'm getting a syntax error presumably because of that "." introduced in the DB name.

I tried encapsulating the DB name in double quotes (no good), single quotes (still no good) escaping with '\' (no good), escaping with ".." (no good). 

Is there a way I can reference the DB which has the "." in it's name ?

v11.5 on linux (I know, way past time to upgrade)

Thanks in Advance !
--------------L1GdhMXTeLQ0NFyU9zbBYAIg--