Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] Patch (tiny): \cd (change dir) for psql [with feedback]

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Mark Hamby <mark(at)archer(dot)leavenworth(dot)army(dot)mil>
Cc: <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [GENERAL] Patch (tiny): \cd (change dir) for psql [with feedback]
Date: 2001-03-26 20:04:13
Message-ID: Pine.LNX.4.30.0103262200100.1114-100000@peter.localdomain (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-patches
Mark Hamby writes:

> Here's a patch for a \cd (change dir) command in psql program.
> It's very small and only adds a few lines.
> Personally, I am surprised psql does not have this command.
> It is EXTREMELY useful when \include'ing SQL scripts to set
> up a database schema.

This sounds like a good idea.

Problems with your patch:

1. You can't portably use getcwd(NULL, xxx).

2. You should test for !quiet before printing messages to stdout.

3. You should use scan_option() to read command arguments.  See \connect
   above your code (rather than \copy below).

Unless you manage to fix these issues, I will do it. :-)

-- 
Peter Eisentraut      peter_e(at)gmx(dot)net       http://yi.org/peter-e/


In response to

pgsql-patches by date

Next:From: Lee HarrDate: 2001-03-27 00:09:35
Subject: Re: Patch (tiny): \cd (change dir) for psql.
Previous:From: Mark HambyDate: 2001-03-26 20:04:03
Subject: Patch (tiny): \cd (change dir) for psql [with feedback]

pgsql-general by date

Next:From: Scott GrittonDate: 2001-03-26 20:21:55
Subject: Starting Postmaster
Previous:From: Mark HambyDate: 2001-03-26 20:04:03
Subject: Patch (tiny): \cd (change dir) for psql [with feedback]

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group