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.96) (envelope-from ) id 1w6ojJ-004gKt-1c for pgsql-general@arkaria.postgresql.org; Sun, 29 Mar 2026 11:54:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w6ojH-00GDQX-1k for pgsql-general@arkaria.postgresql.org; Sun, 29 Mar 2026 11:54:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w6ojH-00GDQO-0W for pgsql-general@lists.postgresql.org; Sun, 29 Mar 2026 11:54:55 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w6ojF-00000001oT3-0JQe for pgsql-general@lists.postgresql.org; Sun, 29 Mar 2026 11:54:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description; bh=Pwls04QDNjz//DUdQHxioE/eIezFjjLpQ0krsxY6MjA=; b=OUAAh5x/dLbpsUK6PTCgbHXRey xKFMuLZshwNQIm3xOy20bFxkk2XpxNZQ27QXg+PEo4H+UP+ZlpiWQw2CYB2Ed5zHSwDy6jRocswRW s8czTyBbg+ywIaZQSdmluv0DspDVFTdZyfMyL3oHW2NyHOjww4cjen2ZL9Twd6QRmYlc=; Received: from depesz by depesz.com with local (Exim 4.96) (envelope-from ) id 1w6ojE-008kTe-0v; Sun, 29 Mar 2026 13:54:52 +0200 Date: Sun, 29 Mar 2026 13:54:52 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Igor Korot Cc: "pgsql-generallists.postgresql.org" Subject: Re: How to escape string in Postgres? Message-ID: Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Mar 28, 2026 at 11:08:17PM -0700, Igor Korot wrote: > In MS SQL server one can write a query like so > SELECT a, b, c FROM [catalog].[schema].[table]; > What do I use in Postgres instead of []? Generally you put there name of schema and table. select * from public.zzz; if your schema/table name would contain "weird" characters, then put the identifier inside "quotes", like: select * from "WeirdyNamedSchema"."badly named table"; If that's not what you're after, you have to be more specific. Best regards, depesz