Re: pgScript patch based on pgScript-1.0-beta-3 - Mailing list pgadmin-hackers

From Erikjan Rijkers
Subject Re: pgScript patch based on pgScript-1.0-beta-3
Date
Msg-id 20063.156.83.0.124.1218677483.squirrel@webmail.xs4all.nl
Whole thread Raw
In response to pgScript patch based on pgScript-1.0-beta-3  ("Mickael Deloison" <mdeloison@gmail.com>)
Responses Re: pgScript patch based on pgScript-1.0-beta-3  ("Mickael Deloison" <mdeloison@gmail.com>)
List pgadmin-hackers
On Thu, August 14, 2008 02:00, Mickael Deloison wrote:

> There is a new patch for pgAdmin that includes pgScript. Maybe the

> Everything is here: http://pgscript.projects.postgresql.org/pgadmin/

Hi Mickael,

I played a bit with pgScript; I like it. Here are a few observations:


  1) It would be nice if pgScript would only execute a select-block, like the
normal pgAdmin querytool does.



  2) The example script from the url above says:

   IF (SELECT 1 FROM table)   -- Then table exists

which is only true if the table has rows, which of course initially it hasn't.
This totally confounds the pgScript newbie ;-)  Maybe it can be changed to:

   IF (SELECT count(*) FROM table)  -- Then table exists

  Now it will NOT fail when table exist, but is empty.

  This will make the snippet executable with pressing repeated F6.



  3) When the BEGIN - END block fails, pgScript executes the ELSE block.  This
seems questionable behaviour, no?  It can be seen with that same
above-mentioned script. (in the original 'IF (SELECT 1 FROM table)' form )


Great project - keep up the good work!


Erikjan Rijkers




pgadmin-hackers by date:

Previous
From: "Mickael Deloison"
Date:
Subject: pgScript patch based on pgScript-1.0-beta-3
Next
From: "Dave Page"
Date:
Subject: Re: pgScript patch based on pgScript-1.0-beta-3