Re: [GENERAL] ecpg rejects input parameters

2015-04-09 Thread Adrian Klaver
On 04/09/2015 07:12 AM, Andrew Pennebaker wrote: 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. Or pgsanity could take this: CREATE DATABASE :db; and convert it into: CREATE DA

Re: [GENERAL] ecpg rejects input parameters

2015-04-09 Thread Andrew Pennebaker
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 wrote: > Andrew Pennebaker writes: > > I can't find a relevant section to address my specif

Re: [GENERAL] ecpg rejects input parameters

2015-04-08 Thread Adrian Klaver
On 04/08/2015 01:38 PM, Andrew Pennebaker wrote: Could you be more specific? 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 think this has more to do with pgsanity: https://github.co

Re: [GENERAL] ecpg rejects input parameters

2015-04-08 Thread Tom Lane
Andrew Pennebaker 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 ex

Re: [GENERAL] ecpg rejects input parameters

2015-04-08 Thread Andrew Pennebaker
Could you be more specific? 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. On Wed, Apr 8, 2015 at 9:34 AM, Adrian Klaver wrote: > On 04/08/2015 07:22 AM, Andrew Pennebaker wrote: > >> Po

Re: [GENERAL] ecpg rejects input parameters

2015-04-08 Thread Adrian Klaver
On 04/08/2015 07:22 AM, Andrew Pennebaker wrote: PostgreSQL uses a :colon syntax for parameterizing SQL commands with command line variables. create-database.sql: CREATE DATABASE :db; Usage: $ psql -f create-database.sql -v db=test However, pgsanity/ecpg rejects these. $ pgsanity create-dat