Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lCBDN-0008Gc-MB for pgsql-general@arkaria.postgresql.org; Wed, 17 Feb 2021 01:01:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lCBDL-0008Uj-0q for pgsql-general@arkaria.postgresql.org; Wed, 17 Feb 2021 01:01:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lCBDK-0008Uc-N3 for pgsql-general@lists.postgresql.org; Wed, 17 Feb 2021 01:01:10 +0000 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lCBDI-0005m5-Gd for pgsql-general@lists.postgresql.org; Wed, 17 Feb 2021 01:01:09 +0000 Received: by mail-oi1-x229.google.com with SMTP id 18so13261255oiz.7 for ; Tue, 16 Feb 2021 17:01:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=JAksS367N94beZd6bhog1jqE2SzahLLU9z4rX1dlHrQ=; b=DP+5ACupk2CAe7Bsha+ZNxBcjlHiktXvfgR5KB1LXiru6T52ZCFeC099zyCWZnPUAX 43NE+VBt+Dy3OyL5RU7Yyxi1sihYYFzqkqH7EmyjZv8nk6NX1gRLuFlohUyoNhRDgxs+ A+KwheSyoTzlG8qECysZkEWOPFHloUBRRuHK5iS+tPdw3KyisHepPY0PP3RpQzwgt5++ qxK9Yw9o1d1TRCpkbv07fH3UvZnRKX0auXZAyls00Tievui105wTn2uH6sanKQnT2kUi wpWWVanWokei0AvkyoCgvd6xwYyWVUyyySWlH3GfA8kiFBvZs8M8Kx8/AiEZTzDh0DLw 4v4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=JAksS367N94beZd6bhog1jqE2SzahLLU9z4rX1dlHrQ=; b=Kt6Q1HknzaO3A/y012bItjqKCZHawtkawuVCFwLDOQMKVNvXGmOuY8PFGKnF3NHTTM t1L7MGWgPISB9XnaN4EAqHyvefA8mFByo69Ewwin16C9Ilkf6vm/Cy8FVoiYBwQefTjW nFectJGgIFTetw47XKnuulr6y1LoWpd7QNb1GWhgDBzDncTgowAMSzmhh56N4sNqnnKN jXG0XA1l8p6j95mCyu837w3AghW4isHHvruGcBRkM4adWfhNXsui22uJiNBYpfHIGVEh lf7ExktLGtTsT0iqmVfRnd6JcyZQh5B3XYVgyMVcuRKswudbOWTqEQyORzSd9uET/AIA rUUQ== X-Gm-Message-State: AOAM532VqquE0gmIQVTBvk432xDi8oCaW5/ae6wqwrNTplf+wATAyc3Z h8qeZiRMNEEgM/zzc3hUVNE/c/Fnu+oqdw== X-Google-Smtp-Source: ABdhPJyUjytz8lS9ZLi0EzIJT8yLpqvtQFxl7F/2u6nT2GIAm/appXrwGNp5YuM2mpeGlBnJKPCYww== X-Received: by 2002:aca:30cf:: with SMTP id w198mr4176116oiw.36.1613523667159; Tue, 16 Feb 2021 17:01:07 -0800 (PST) Received: from [192.168.88.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id g3sm126822ooi.28.2021.02.16.17.01.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Feb 2021 17:01:06 -0800 (PST) Subject: Re: Syntax checking DO blocks and ALTER TABLE statements? To: pgsql-general@lists.postgresql.org References: <87r1lfpp7k.fsf@gmail.com> <87im6rpnye.fsf@gmail.com> <858b0f6b-fc12-c937-33e9-f893ecde5ac1@gmail.com> <87a6s3pmjg.fsf@gmail.com> From: Ron Message-ID: <5457fdc1-82a5-aa82-19d2-efc5862a0427@gmail.com> Date: Tue, 16 Feb 2021 19:01:06 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <87a6s3pmjg.fsf@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/16/21 6:19 PM, Tim Cross wrote: > Ron 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.