pgScript Help Index

Mickael Deloison


The pgScript project is a PostgreSQL Community project that is a part of the pgFoundry. The pgFoundry page for the project is at http://pgfoundry.org/projects/pgscript, where you can find downloads, documentation, bug reports, mailing lists, and a whole lot more.

                            ___         _      _
                 _ __  __ _/ __| __ _ _(_)_ __| |_
                | '_ \/ _` \__ \/ _| '_| | '_ \  _|
                | .__/\__, |___/\__|_| |_| .__/\__|
                |_|   |___/              |_|

 ------------------------------------------------------------------------------
| README                                                                       |
 ------------------------------------------------------------------------------

    1. Overview
    2. Install & Usage
    3. License

 ------------------------------------------------------------------------------
| 1. Overview                                                                  |
 ------------------------------------------------------------------------------

pgScript enhances PostgreSQL SQL commands with these additional features:

    * Control-of-flow language
    * Local variables
    * Random data generators    

For instance:

    SET @A = INTEGER(0, 10);           -- Random integer generator into @A
    IF (SELECT 1 FROM table)           -- Then table exists
    BEGIN
        SET @B = SELECT * FROM table;  -- Stores result of the query in @B
        INSERT INTO table VALUES (@A); -- Inserts a random integer
        PRINT @B;                      -- Prints result of the previous query
    END
    ELSE                               -- Else table does not exist
    BEGIN
        CREATE TABLE table ( ... );    -- Regular PostgreSQL command
    END

pgScript interprets the kind of script above. For more details on the scripting
language please look at SCRIPT.html.

pgScript is also integrated into pgAdmin. This document describes how to use the
standalone version. However you can access pgScript through the Query tool in
pgAdmin: see http://www.pgadmin.org for information & download.

 ------------------------------------------------------------------------------
| 2. Install & Usage                                                           |
 ------------------------------------------------------------------------------

Please look at INSTALL.html and USAGE.html.

 ------------------------------------------------------------------------------
| 3. License                                                                   |
 ------------------------------------------------------------------------------

This piece of software is protected by the Artistic License. See COPYING.