Re: Syntax checking DO blocks and ALTER TABLE statements? - Mailing list pgsql-general

From David G. Johnston
Subject Re: Syntax checking DO blocks and ALTER TABLE statements?
Date
Msg-id CAKFQuwYTyXCinTZfqjbm3uWR8gZQ-tssStxhAFFu3RQmSPUjDA@mail.gmail.com
Whole thread Raw
In response to Syntax checking DO blocks and ALTER TABLE statements?  (Ron <ronljohnsonjr@gmail.com>)
Responses Re: Syntax checking DO blocks and ALTER TABLE statements?  (Tim Cross <theophilusx@gmail.com>)
List pgsql-general
On Tue, Feb 16, 2021 at 3:43 PM Ron <ronljohnsonjr@gmail.com> wrote:

How does one go about syntax checking this?

(There are 222 ALTER TABLE ADD FOREIGN KEY statements that I'm wrapping in
similar DO blocks, and want to make sure the statements are clean.)


Begin a transaction, execute the DO, capture an error if there is one, rollback the transaction.

David J.

pgsql-general by date:

Previous
From: Ron
Date:
Subject: Syntax checking DO blocks and ALTER TABLE statements?
Next
From: Tim Cross
Date:
Subject: Re: Syntax checking DO blocks and ALTER TABLE statements?