question about verify output from tutorial

8 views
Skip to first unread message

Matt Zagrabelny

unread,
Nov 4, 2021, 5:22:38 PM11/4/21
to Sqitch Users
Greetings!

$ sqitch --version
sqitch (App::Sqitch) v1.1.0

I'm following the tutorial at:

https://sqitch.org/docs/manual/sqitchtutorial/

and I'm running Pg version 12. [psql (12.4 (Debian 12.4-3))]

In the tutorial I see for the verify command:

SELECT pg_catalog.has_schema_privilege('flipr', 'usage');

but I also see, for Pg 9.5+:

DO $$
BEGIN
   ASSERT (SELECT has_schema_privilege('flipr', 'usage'));
END $$;


Which SQL should I put in the verify file?

Thanks for the help!

-m

David E. Wheeler

unread,
Nov 5, 2021, 10:29:29 AM11/5/21
to Matt Zagrabelny, Sqitch Users
On Nov 4, 2021, at 17:22, 'Matt Zagrabelny' via Sqitch Users <sqitch...@googlegroups.com> wrote:

> In the tutorial I see for the verify command:
>
> SELECT pg_catalog.has_schema_privilege('flipr', 'usage');
>
> but I also see, for Pg 9.5+:
>
> DO $$
> BEGIN
> ASSERT (SELECT has_schema_privilege('flipr', 'usage'));
> END $$;
>
>
> Which SQL should I put in the verify file?

Try it and see. It should fail the deploy if the flipr schema does not exist, and should succeed if it does exist. You can force it to fail by changing the name of the schema in the test.

I don’t know where the DO block is from, but I just use the SELECT statement.

Best,

David

Reply all
Reply to author
Forward
0 new messages