Re: Syntax checking DO blocks and ALTER TABLE statements?

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Syntax checking DO blocks and ALTER TABLE statements?
Date: 2021-02-17 01:01:06
Message-ID: 5457fdc1-82a5-aa82-19d2-efc5862a0427@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2/16/21 6:19 PM, Tim Cross wrote:
> Ron <ronljohnsonjr(at)gmail(dot)com> writes:
>
>> On 2/16/21 5:44 PM, Tim Cross wrote:
>>> Given the number, I think I would do the same. A good example of why
>>> being 'lazy' can be a virtue. Faster and easier to write a procedure to
>>> generate dynamic SQL than write out all those alter statements manually
>>> or even write it using a scripting language and ODBC if there is
>>> sufficient variation in the statements to make writing it in plsql
>>> 'messy'.
>> In my case, the statements are generated by Ora2Pg, and the DO blocks are
>> generated by a bash script I wrote. Input data can be messy, so want to
>> verify things before running.
>>
>> Sure, vim is great at highlighting some problems, but certainly not all.
>>
>> What I'm really looking for the PostgreSQL version of SQL Server's Ctrl-F5:
>> it runs just the parser and then stops,
> Sounds like exactly what LSP aims to provide. Don't know if the LSP SQL
> servers available are mature enough yet, but that is definitely the
> objective. Real benefit is that it is editor agnostic. Once your editor
> has LSP support, all you need to do is configure the server details and
> you get parsing, completion, re-factoring, definition lookup etc.

Naively, it seems that it should be easy to add this to psql.  The EXPLAIN
verb exists, so it shouldn't be hard to add SYNTAX, which does less work
than EXPLAIN.

--
Angular momentum makes the world go 'round.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stacey Haysler 2021-02-17 05:43:02 Proposed Update to Japanese Translation of Code of Conduct Policy
Previous Message Tim Cross 2021-02-17 00:19:44 Re: Syntax checking DO blocks and ALTER TABLE statements?