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

Re: psql slash# command

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Sibte Abbas <sibtay(at)gmail(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: psql slash# command
Date: 2007-09-14 14:17:01
Message-ID: 200709141417.l8EEH1b27953@momjian.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
This has been saved for the 8.4 release:

	http://momjian.postgresql.org/cgi-bin/pgpatches_hold

---------------------------------------------------------------------------

Sibte Abbas wrote:
> On 9/9/07, Sibte Abbas <sibtay(at)gmail(dot)com> wrote:
> > Attached is the patch for the TODO item mentioned at
> > http://archives.postgresql.org/pgsql-hackers/2007-09/msg00352.php
> >
> > The command has the following synopsis:
> >
> > \#: displays the command history. Like \s but prefixes the lines with line
> > numbers
> >
> > \# <line_no>: executes the command(if any) executed at the line specified by
> > line_no
> >
> > regards,
> > --
> > Sibte Abbas
> >
> >
> 
> The attached patch adds the following new functionality:
> 
> \#e <lineno>: Will open the command at the given lineno in an editor.
> \#e with no lineno will behave exactly like \e.
> 
> Example:
> =====
> 
> psql> \#
> 
> 199: create or replace function foo() returns integer as $$
> begin
> return 10;
> end;
> $$language 'plpgsql';
> 
> 200: select version();
> 
> 201: select * from foo();
> 
> \# 200
> <select version() is executed>
> 
> psql> \#e 199
> <the contents of lineno 199 are opened in the editor>
> 
> Definitely not for 8.3, however I hope that it can be queued for 8.4.
> 
> thanks,
> --
> Sibte Abbas

[ Attachment, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
> 
>                http://archives.postgresql.org

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

In response to

pgsql-hackers by date

Next:From: Oleg BartunovDate: 2007-09-14 14:20:25
Subject: Re: tsearch2 documentation done
Previous:From: Sibte AbbasDate: 2007-09-14 14:13:03
Subject: Re: psql slash# command

pgsql-patches by date

Next:From: Bruce MomjianDate: 2007-09-14 14:32:21
Subject: Re: documentation patch for LDAP service lookup
Previous:From: Sibte AbbasDate: 2007-09-14 14:13:03
Subject: Re: psql slash# command

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