Re: [pgScript patch] Improved test output + make use of pgAdmin UI for error output - Mailing list pgadmin-hackers

From Dave Page
Subject Re: [pgScript patch] Improved test output + make use of pgAdmin UI for error output
Date
Msg-id 937d27e10903111024r2f12f68fr94a903660d6a7010@mail.gmail.com
Whole thread Raw
In response to [pgScript patch] Improved test output + make use of pgAdmin UI for error output  (Mickael Deloison <mdeloison@gmail.com>)
Responses Re: [pgScript patch] Improved test output + make use of pgAdmin UI for error output  (Dave Page <dpage@pgadmin.org>)
Re: [pgScript patch] Improved test output + make use of pgAdmin UI for error output  (Mickael Deloison <mdeloison@gmail.com>)
Re: [pgScript patch] Improved test output + make use of pgAdmin UI for error output  (Mickael Deloison <mdeloison@gmail.com>)
Re: [pgScript patch] Improved test output + make use of pgAdmin UI for error output  (Mickael Deloison <mdeloison@gmail.com>)
List pgadmin-hackers
Hi.

On Wed, Mar 11, 2009 at 1:52 PM, Mickael Deloison <mdeloison@gmail.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@M#TITLE = 'pgScript';
PRINT '';
PRINT @PROGR@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

pgadmin-hackers by date:

Previous
From: svn@pgadmin.org
Date:
Subject: SVN Commit by dpage: r7677 - trunk/pgadmin3/pgadmin/pgscript/expressions
Next
From: Dave Page
Date:
Subject: Re: [pgScript patch] Improved test output + make use of pgAdmin UI for error output