Unix Technical Forum

Change < to -f in examples with input files

This is a discussion on Change < to -f in examples with input files within the Pgsql Patches forums, part of the PostgreSQL category; --> Folks, Please find enclosed a patch, per Dennis Björklund, that uses -f for input files rather than <. This ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 11:04 PM
David Fetter
 
Posts: n/a
Default Change < to -f in examples with input files

Folks,

Please find enclosed a patch, per Dennis Björklund, that uses -f for
input files rather than <. This makes error messages, &c. more
expressive.

Cheers,
D
--
David Fetter david@fetter.org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 11:04 PM
Peter Eisentraut
 
Posts: n/a
Default Re: Change < to -f in examples with input files

David Fetter wrote:
> Please find enclosed a patch, per Dennis Björklund, that uses -f for
> input files rather than <. This makes error messages, &c. more
> expressive.


To be portable, options must be before non-option arguments, so you need
to rearrange the command-line arguments in the examples if you want to
make that change.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 11:04 PM
Bruce Momjian
 
Posts: n/a
Default Re: Change < to -f in examples with input files

David Fetter wrote:
>
> Please find enclosed a patch, per Dennis Bj<C3><B6>rklund, that uses -f for
> input files rather than <. This makes error messages, &c. more
> expressive.


Uh, how is it more expressive? The only difference I see is the line
numbers. Is that it?

--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-17-2008, 11:04 PM
David Fetter
 
Posts: n/a
Default Re: Change < to -f in examples with input files

On Mon, Feb 21, 2005 at 02:18:31PM -0500, Bruce Momjian wrote:
> David Fetter wrote:
> >
> > Please find enclosed a patch, per Dennis Bj<C3><B6>rklund, that
> > uses -f for input files rather than <. This makes error messages,
> > &c. more expressive.

>
> Uh, how is it more expressive? The only difference I see is the
> line numbers. Is that it?


That could be a very big deal in case of error on a large file, so
yes.

Cheers,
D
--
David Fetter david@fetter.org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-17-2008, 11:04 PM
Christopher Kings-Lynne
 
Posts: n/a
Default Re: Change < to -f in examples with input files

>>Uh, how is it more expressive? The only difference I see is the
>>line numbers. Is that it?

>
>
> That could be a very big deal in case of error on a large file, so
> yes.


In IRC, I always recommend that ppl use -f, since it's so much more
useful

Chris

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-17-2008, 11:05 PM
Bruce Momjian
 
Posts: n/a
Default Re: Change < to -f in examples with input files

David Fetter wrote:

> Please find enclosed a patch, per Dennis Bj<C3><B6>rklund, that uses -f
> for input files rather than <. This makes error messages, &c. more
> expressive.
>
> David Fetter


Applied. Thanks.

(I reordered the arguments as Peter suggested.)

--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Index: doc/src/sgml/backup.sgml
================================================== =================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/backup.sgml,v
retrieving revision 2.55
diff -c -r2.55 backup.sgml
*** doc/src/sgml/backup.sgml 22 Jan 2005 22:56:35 -0000 2.55
--- doc/src/sgml/backup.sgml 20 Feb 2005 20:45:07 -0000
***************
*** 177,183 ****
</synopsis>
The resulting dump can be restored with <application>psql</>:
<synopsis>
! psql template1 &lt; <replaceable class="parameter">infile</replaceable>
</synopsis>
(Actually, you can specify any existing database name to start from,
but if you are reloading in an empty cluster then <literal>template1</>
--- 177,183 ----
</synopsis>
The resulting dump can be restored with <application>psql</>:
<synopsis>
! psql -f <replaceable class="parameter">infile</replaceable> template1
</synopsis>
(Actually, you can specify any existing database name to start from,
but if you are reloading in an empty cluster then <literal>template1</>
***************
*** 1210,1216 ****
gmake install
initdb -D /usr/local/pgsql/data
postmaster -D /usr/local/pgsql/data
! psql template1 &lt; backup
</programlisting>

See <xref linkend="runtime"> about ways to start and stop the
--- 1210,1216 ----
gmake install
initdb -D /usr/local/pgsql/data
postmaster -D /usr/local/pgsql/data
! psql -f backup template1
</programlisting>

See <xref linkend="runtime"> about ways to start and stop the


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:43 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com