public inbox for [email protected]
help / color / mirror / Atom feedFrom: Igor Korot <[email protected]>
To: Pavel Stehule <[email protected]>
Cc: pgsql-generallists.postgresql.org <[email protected]>
Subject: Re: Error on the query
Date: Tue, 4 Mar 2025 17:04:43 -0600
Message-ID: <CA+FnnTx_osKNmJpkaTLjkJvcu75sKESzW79=Ei_xMepTkAAJ-Q@mail.gmail.com> (raw)
In-Reply-To: <CAFj8pRDGvEV-rN7W69zuvg64ASG==mEqfLCVXxANAYPhfmUtNg@mail.gmail.com>
References: <CA+FnnTxq1e5wRjjO2VDfikkn0Stq6W8qFFykE9iJskSz=2+7Ug@mail.gmail.com>
<CAFj8pRDGvEV-rN7W69zuvg64ASG==mEqfLCVXxANAYPhfmUtNg@mail.gmail.com>
Hi, Pavel,
On Tue, Mar 4, 2025 at 11:36 AM Pavel Stehule <[email protected]> wrote:
>
> Hi
>
> út 4. 3. 2025 v 18:30 odesílatel Igor Korot <[email protected]> napsal:
>>
>> Hi, ALL,
>> Trying to execute following query:
>>
>> [code]
>> queries.push_back( L"DO $$ BEGIN IF NOT EXISTS( SELECT 1 FROM
>> pg_class c, pg_namespace n WHERE n.oid = c.relnamespace AND c.relname
>> = \'abcatc_x\' AND n.nspname = \'public\' ) THEN CREATE UNIQUE INDEX
>> \"abcatc_x\" ON \"abcatcol\"(\"abc_tnam\" ASC, \"abc_ownr\" ASC,
>> \"abc_cnam\" ASC); END IF; END;" );
>> [/code]
>>
>> I got:
>>
>> [quote]
>> $4 = L"ERROR: unterminated dollar-quoted string at or near \"$$ BEGIN
>> IF NOT EXISTS( SELECT 1 FROM pg_class c, pg_namespace n WHERE n.oid =
>> c.relnamespace AND c.relna
>> me = 'abcatc_x' AND n.nspname = 'public' "...
>>
>> [/quote]
>>
>> What am I missing?
>
>
>
> you miss ending string separator
>
> DO $$ .... $$;
>
> DO $$
> BEGIN
> IF ... THEN
> END IF;
> END;
> $$;
Thank you.
Works now.
>
> Regards
>
> Pavel
>>
>>
>> Thank you.
>>
>>
view thread (3+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Error on the query
In-Reply-To: <CA+FnnTx_osKNmJpkaTLjkJvcu75sKESzW79=Ei_xMepTkAAJ-Q@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox