Re: if not exists (SELECT 1... UNION SELECT 1...)

From: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
To:
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: if not exists (SELECT 1... UNION SELECT 1...)
Date: 2022-02-16 16:23:29
Message-ID: CAADeyWi+2ULFv7h-N+LHAZ8Gs4TYfUPqMM0fv5pQA30AcSk4mg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ah, thank you Ralf! That has explained it (because I was still grumbling...)

On Wed, Feb 16, 2022 at 4:44 PM Ralf Schuchardt <rasc(at)gmx(dot)de> wrote:

> You must rather end the assignment with a semicolon:
>
> out_text := '___WRONG___';
> RETURN;
>
> Otherwise what really happens is:
>
> out_text := '___WRONG___' RETURN;
>
> where „return“ is a simple column name as in this select statement:
>
> select '___WRONG___' return;
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Farber 2022-02-16 16:24:47 Re: if not exists (SELECT 1... UNION SELECT 1...)
Previous Message Ralf Schuchardt 2022-02-16 15:44:36 Re: if not exists (SELECT 1... UNION SELECT 1...)