Re: PL/pgSQL doesn't support variables in queries? - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: PL/pgSQL doesn't support variables in queries?
Date
Msg-id ZFJUFK5bDvpSIKFH@depesz.com
Whole thread Raw
In response to PL/pgSQL doesn't support variables in queries?  ("J.A." <postgresql@world-domination.com.au>)
List pgsql-general
On Wed, May 03, 2023 at 10:25:55PM +1000, J.A. wrote:
> Heya folks :)
> 
> ms-sql person here migrating over to pgsql. One of the first thing's I
> noticed with pgsql (or more specifically, PL/pgSQL) is that it doesn't
> support "variables" in a query?
> 
> for example, here's some T-SQL:
> 
> DECLARE @fkId INTEGER

Sure it does.

There is nothing relating to "@" character, though.

You can easily find examples in docs:
https://www.postgresql.org/docs/current/plpgsql-structure.html

depesz



pgsql-general by date:

Previous
From: "J.A."
Date:
Subject: PL/pgSQL doesn't support variables in queries?
Next
From: Michael Loftis
Date:
Subject: Re: libpq and multi-threading