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

From J.A.
Subject PL/pgSQL doesn't support variables in queries?
Date
Msg-id CALT+_gvfHtF5jqQg+J2suw3hOEh3ZWjZQDB8jJ945o4b1ekyyQ@mail.gmail.com
Whole thread Raw
Responses Re: PL/pgSQL doesn't support variables in queries?  (hubert depesz lubaczewski <depesz@depesz.com>)
Re: PL/pgSQL doesn't support variables in queries?  (Erik Wienhold <ewie@ewie.name>)
List pgsql-general
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

SELECT @fkId = fkId FROM SomeTable WHERE id = 1

-- and then do something with that value..

SELECT * FROM AnotherTable WHERE Id = @fkId
SELECT * FROM YetAnotherTable WHERE FKId = @fkId
-- etc..

If I have this information correct, has this concept ever been discussed before or considered to be included in PL/pgSQL ?

Thank you kindly for any help/conversations on this topic.

Sincere apologies if this is not the correct forum/list to ask this question.

Regards,

JA.

pgsql-general by date:

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