Re: [pgScript patch] Improved test output + make use of pgAdmin UI for error output

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Mickael Deloison <mdeloison(at)gmail(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgScript patch] Improved test output + make use of pgAdmin UI for error output
Date: 2009-03-11 17:34:15
Message-ID: 937d27e10903111034i5109a28fve3c87f21684a797@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hmm, I see similar results if I revert the patch. I wonder if the one
Magnus applied broke something?

On Wed, Mar 11, 2009 at 5:24 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
> Hi.
>
> On Wed, Mar 11, 2009 at 1:52 PM, Mickael Deloison <mdeloison(at)gmail(dot)com> wrote:
>> Hi,
>>
>> Attached to this email, three patches for pgScript:
>> 1. The first one improves the output of the pgScript integration test
>> suite: only a bash file has been modified.
>
> Applied.
>
>> 2. The second one corrects an extra space introduced in the output
>> from the previous patch.
>
> Applied.
>
>> 3. The third one enables pgScript to use the pgAdmin UI for error
>> output: when an error occurs while interpreting a script then the line
>> where the error occurred is signaled.
>
> Testing on Windows, it fails the first tests I try :-(
>
> select * from missing_table
>
> I get no error message at all. If I enter garbage, I just get the following:
>
> 1.0: syntax error, unexpected character
>
> If I enter this example from the docs:
>
> SET @A = INTEGER(100, 200);
> PRINT @A; -- Prints an integer between 100 and 200
> PRINT @A; -- Prints another integer between 100 and 200
>
> I get:
>
> 3.9-10: syntax error, unexpected '-'
>
> I would expect an error message from the first query, and nicely
> formatted errors from the second and third tests (though actually I
> wouldn't expect an error at all from the docs example). FWIW, other
> (non-erroring) examples work fine:
>
> SET @PROGR(at)M#TITLE = 'pgScript';
> PRINT '';
> PRINT @PROGR(at)M#TITLE + ' features:';
> PRINT '';
> PRINT '  * Regular PostgreSQL commands';
> PRINT '  * Control-of-flow language';
> PRINT '  * Local variables';
> PRINT '  * Random data generators';
>
> gives:
>
> [PGSCRIPT ]
> [PGSCRIPT ] pgScript features:
> [PGSCRIPT ]
> [PGSCRIPT ]   * Regular PostgreSQL commands
> [PGSCRIPT ]   * Control-of-flow language
> [PGSCRIPT ]   * Local variables
> [PGSCRIPT ]   * Random data generators
>
> and
>
> DECLARE @I, @T; -- Variable names begin with a @
> SET @I = 0; -- @I is an integer
> WHILE @I < 20
> BEGIN
>    SET @T = 'table' + CAST (@I AS STRING); -- Casts @I
>    CREATE TABLE @T (id integer primary key, data text);
>
>    SET @I = @I + 1;
> END
>
> Outputs the queries and resulting notices as expected.
>
> --
> Dave Page
> EnterpriseDB UK:   http://www.enterprisedb.com
>

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2009-03-11 17:38:40 Re: pgadmin 1.8.4 freeze ?
Previous Message Dave Page 2009-03-11 17:24:45 Re: [pgScript patch] Improved test output + make use of pgAdmin UI for error output