From: | Andrew Pennebaker <andrew(dot)pennebaker(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, PostgreSQL General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: ecpg rejects input parameters |
Date: | 2015-04-09 14:12:00 |
Message-ID: | CAHXt_SVENm8=j_S6qeKLsmJA+3JTsuR+HFqRw6J35=HQQkERTw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Makes sense.
Yes, it would be great if psql offered a flag for validating syntax. Other
programming languages do this, for example, bash -n, ruby -c, and php -l.
On Wed, Apr 8, 2015 at 3:53 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Andrew Pennebaker <andrew(dot)pennebaker(at)gmail(dot)com> writes:
> > I can't find a relevant section to address my specific problem: ecpg
> > complaining when I try to check the syntax of my .sql files that use
> input
> > parameters.
>
> I'm not sure why you think that should work. psql and ecpg have quite
> distinct input languages. Both are extensions of SQL, but the key word
> there is "extension". ecpg certainly isn't going to accept psql's
> backslash commands for instance, any more than psql would accept ecpg's
> C code portions. And I doubt it would be useful for ecpg to simply ignore
> the variable-interpolation symbols; but it has no way to know what's going
> to be substituted for those symbols.
>
> It would be more interesting to consider giving psql a syntax-check-only
> mode; though I'm afraid use of variable interpolation would still be pretty
> problematic, since the variables are commonly filled from execution of
> previous commands.
>
> regards, tom lane
>
--
Cheers,
Andrew Pennebaker
www.yellosoft.us
From | Date | Subject | |
---|---|---|---|
Next Message | Adrian Klaver | 2015-04-09 14:47:59 | Re: ecpg rejects input parameters |
Previous Message | John McKown | 2015-04-09 13:53:16 | Re: Cannot connect from local network to my postgresql server |