How to escape string in Postgres?

Started by Igor Korot3 months ago4 messagesgeneral
Jump to latest
#1Igor Korot
ikorot01@gmail.com

Hi,

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 []?

Thank you.

#2Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Igor Korot (#1)
Re: How to escape string in Postgres?

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.

Yours,
Laurenz Albe

#3Igor Korot
ikorot01@gmail.com
In reply to: Laurenz Albe (#2)
Re: How to escape string in Postgres?

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.

Agreed.
However trying to google on “Postgres escaping query” didnt produce any
links to the docs.

Thx.

Show quoted text

Yours,
Laurenz Albe

#4Pavel Stehule
pavel.stehule@gmail.com
In reply to: Igor Korot (#3)
Re: How to escape string in Postgres?

Hi

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.

Agreed.
However trying to google on “Postgres escaping query” didnt produce any
links to the docs.

generally, your question is not related to escaping

https://www.postgresql.org/docs/18/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS

Regards

Pavel

Show quoted text

Thx.

Yours,
Laurenz Albe