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:24:45
Message-ID: 937d27e10903111024r2f12f68fr94a903660d6a7010@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

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

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2009-03-11 17:34:15 Re: [pgScript patch] Improved test output + make use of pgAdmin UI for error output
Previous Message svn 2009-03-11 16:59:01 SVN Commit by dpage: r7677 - trunk/pgadmin3/pgadmin/pgscript/expressions