Search Postgresql Archives

Re: newbie question: reading sql commands from script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2005-10-24 at 20:39 -0400, Sean Davis wrote:
> In psql, look at \i.
>  
> Sean
>  
>         ----- Original Message ----- 
>         From: basel novo 
>         To: pgsql-general@xxxxxxxxxxxxxx 
>         Sent: Monday, October 24, 2005 8:28 PM
>         Subject:  newbie question: reading sql commands from
>         script files
>         
>         
>         What is the equivalent of the mysql 'source' command for
>         reading sql 
>         commands from ascii script files? 

Also, for shell scripting, there are command line options:

   psql -f filename

or redirection:

   psql < filename

(the former gives line numbers), or for a single command:

   psql -c "sql command"

-- 
Oliver Elphick                                          olly@xxxxxxxxxx
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0 5664 7A2F A543 10EA
                 ========================================
   Do you want to know God?   http://www.lfix.co.uk/knowing_god.html


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux