pgsql-general
❮
How to escape string in Postgres?
- Jump to comment-1Igor Korot<ikorot01@gmail.com>Mar 29, 2026, 6:09 AM UTCHi,
In MS SQL server one can write a query like so
What do I use in Postgres instead of []?SELECT a, b, c FROM [catalog].[schema].[table];
Thank you.- Jump to comment-1Laurenz Albe<laurenz.albe@cybertec.at>Mar 29, 2026, 6:56 AM UTCOn Sat, 2026-03-28 at 23:08 -0700, Igor Korot wrote:
In MS SQL server one can write a query like so
Normally, you read the documentation.
SELECT a, b, c FROM [catalog].[schema].[table];
What do I use in Postgres instead of []?
Yours,
Laurenz Albe- Jump to comment-1Igor Korot<ikorot01@gmail.com>Mar 29, 2026, 7:21 AM UTCHi, Lauren’s,
On Sat, Mar 28, 2026 at 11:56 PM Laurenz Albe <laurenz.albe@cybertec.at>
wrote:On Sat, 2026-03-28 at 23:08 -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 []?
Agreed.
Normally, you read the documentation.
However trying to google on “Postgres escaping query” didnt produce any
links to the docs.
Thx.
Yours,
Laurenz Albe- Jump to comment-1Pavel Stehule<pavel.stehule@gmail.com>Mar 29, 2026, 8:00 AM UTCHi
ne 29. 3. 2026 v 9:21 odesílatel Igor Korot <ikorot01@gmail.com> napsal:Hi, Lauren’s,
On Sat, Mar 28, 2026 at 11:56 PM Laurenz Albe <laurenz.albe@cybertec.at>
wrote:
On Sat, 2026-03-28 at 23:08 -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 []?
Normally, you read the documentation.
generally, your question is not related to escaping
Agreed.
However trying to google on “Postgres escaping query” didnt produce any
links to the docs.
https://www.postgresql.org/docs/18/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
Regards
Pavel
Thx.
Yours,
Laurenz Albe
- Jump to comment-1hubert depesz lubaczewski<depesz@depesz.com>Mar 29, 2026, 11:54 AM UTCOn Sat, Mar 28, 2026 at 11:08:17PM -0700, Igor Korot wrote:
In MS SQL server one can write a query like so
Generally you put there name of schema and table.
SELECT a, b, c FROM [catalog].[schema].[table];
What do I use in Postgres instead of []?
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