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 1lCAfc-0006g1-39 for pgsql-general@arkaria.postgresql.org; Wed, 17 Feb 2021 00:26:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lCAfb-0005vg-15 for pgsql-general@arkaria.postgresql.org; Wed, 17 Feb 2021 00:26:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lCAfa-0005vT-NS for pgsql-general@lists.postgresql.org; Wed, 17 Feb 2021 00:26:18 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lCAfY-0006TC-Jq for pgsql-general@lists.postgresql.org; Wed, 17 Feb 2021 00:26:18 +0000 Received: by mail-pl1-x635.google.com with SMTP id a9so4313859plh.8 for ; Tue, 16 Feb 2021 16:26:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=BPX4rce4CG1OuqPtETKkaBQ33NfME8iY3AmuB/4mb5I=; b=hZf9ywe9R1weqHzt6lpEtrdFF9pvXV28fd2U+HyBkKzitBlG/TxbRLIb8AcWWuHFuB b0WjGFkpmTw1ojNhw4+tOpPMdot72hdJBhCxYYPPfCMi+wA7FikEcx6kZssX+pvaGM0e b0wVjW8+yIY70aisyuF+mbVy7715+lFggEdpCldv/rLpNguRug1NMaCSkL82TOBh77Y7 Gke1HqBeexUICtrbzoPCllD8zLgC/gMiVz+pcpc7P8qSvWI0ZxJKF4JMJao66cMYshPv 6v5yAx1bH8/UtI8C6H6ujTAQDpEiG7lhU16P95JCEauQNFK1I4ii+JtbLVGPtvfHKvx3 DsXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=BPX4rce4CG1OuqPtETKkaBQ33NfME8iY3AmuB/4mb5I=; b=WZNGaDrPl4MlEx6xRIm9jFlNNoJABmVP96cQpypjlV0XmFWpYl/+PzyRt3FotNTKJ9 WH9HnQW4oFgJCcgbdZEChcOM/F26yWO65TKskd6GYADPyqLnyXvfxLeTa9kxW54gfrGN zQP8WGT092XyUGjXxpI0bOyI4j23kS2vtJfnsGz34W3FTXpypOFegIr9kWonxTZgmOTh qrCwLNtV1i+ESBHpJRr68Kf7LeOBE+jIUjBUgiHtY3EDFR5Tq0nI3SgvvQOmg6NdGuhj xTBa+PQhZnUxrd/ldD+hSt65PqLAfaFAx+zmQxCHVVWB/so6N6UXv2vEViPZB1DMXGjU c1yg== X-Gm-Message-State: AOAM531TZYJJy2uWsNZliQFwk6WDACldYOGH6RW+yFCSfFhme11ebyQJ Atk7hzA+HAd2XirlRlFqBEV1JT9EncY= X-Google-Smtp-Source: ABdhPJwBSDRCzxWql0lZ3wXEhZC18+kef+mcJE6Qv9d5DsV4ZkehPorpWzCdYYQfA1VWnFrxfRz6kw== X-Received: by 2002:a17:90a:517:: with SMTP id h23mr6638336pjh.108.1613521574421; Tue, 16 Feb 2021 16:26:14 -0800 (PST) Received: from tim-desktop (106-69-135-243.dyn.iinet.net.au. [106.69.135.243]) by smtp.gmail.com with ESMTPSA id 143sm111497pfv.134.2021.02.16.16.26.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Feb 2021 16:26:14 -0800 (PST) References: <87r1lfpp7k.fsf@gmail.com> <87im6rpnye.fsf@gmail.com> <858b0f6b-fc12-c937-33e9-f893ecde5ac1@gmail.com> User-agent: mu4e 1.5.8; emacs 27.1.91 From: Tim Cross To: pgsql-general@lists.postgresql.org Subject: Re: Syntax checking DO blocks and ALTER TABLE statements? Date: Wed, 17 Feb 2021 11:19:44 +1100 In-reply-to: <858b0f6b-fc12-c937-33e9-f893ecde5ac1@gmail.com> Message-ID: <87a6s3pmjg.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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. -- Tim Cross