Re: comments in load scripts - Mailing list pgsql-novice

From Oliver Elphick
Subject Re: comments in load scripts
Date
Msg-id 1030352777.20178.26.camel@linda
Whole thread Raw
In response to comments in load scripts  ("Aurangzeb M. Agha" <aagha@bigfoot.com>)
List pgsql-novice
On Sun, 2002-08-25 at 21:39, Aurangzeb M. Agha wrote:
> I have two questions regarding using load scripts to create and populate
> my DB.
>
> I use the following command to create my DB with a script which has a lot
> of create statements in it:
>
>     %> psql testDB < loadTestDB.sql
>
> Question 1: Is this the best way to create my DB?  I know there's a pg_dump
> command, but is there some kind of a pgload I should be using instead?

This is fine

> Secondly, my create and populate scripts are very long.  When running the
> populate script, I get a ton of output with Insert OID statements:
>
>     ...
>     INSERT 30094 1
>     INSERT 30095 1
>     INSERT 30096 1
>     INSERT 30097 1
>     INSERT 30098 1
>     ...
>
> Is there any way I can put comments into my load scripts so that I can get
> an indication of the progress the load is making.

You can put SQL comments in your script:

  -- This is a comment (preceded by a double hyphen)

You can see these comments and the commands being executed by running
psql with the -e option:

      %> psql -e -d testDB < loadTestDB.sql

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK
http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Seeing then that all these things shall be dissolved,
      what manner of persons ought ye to be? You ought to
      live holy and godly lives as you look forward to the
      day of God and speed its coming."
                                II Peter 3:11,12


pgsql-novice by date:

Previous
From: "Aurangzeb M. Agha"
Date:
Subject: comments in load scripts
Next
From: Andrei Popovici
Date:
Subject: functions