Re: How to escape string in Postgres?

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Igor Korot <ikorot01(at)gmail(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: How to escape string in Postgres?
Date: 2026-03-29 11:54:52
Message-ID: ackTDN0KiD9AX__U@depesz.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Igor Korot 2026-04-01 06:49:21 Any reason why PQclear() do not assign the pointer to NULL?
Previous Message Pavel Stehule 2026-03-29 08:00:08 Re: How to escape string in Postgres?