Re: comments in load scripts

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: aagha(at)bigfoot(dot)com
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: comments in load scripts
Date: 2002-08-26 09:06:17
Message-ID: 1030352777.20178.26.camel@linda
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)Elphick(at)lfix(dot)co(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Andrei Popovici 2002-08-26 11:44:51 functions
Previous Message Aurangzeb M. Agha 2002-08-25 20:39:13 comments in load scripts