Quick little \h enhancement for psql

Started by Greg Sabino Mullaneabout 21 years ago3 messagespatches
Jump to latest
#1Greg Sabino Mullane
greg@turnstep.com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Attached is a patch that enhances the "\h" capability in psql. I often
find myself typing a command and then wanting to get the syntax for
it. So I do a ctrl-a and add a \h: but psql does not recognize the
command, because I have stuff attached to it (e.g. "alter table
foobar"),
so I have to scroll over and delete everything except the name of the
command itself. This patch gives \h three chances to match: if nothing
matches the complete string (current behavior), it tries to match the
first two words (e.g. "ALTER TABLE"). If that fails, it tries to match
the first word (e.g. "DELETE").

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200505161840
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFCiSF3vJuQZxSWSsgRAumaAKCKd0xns4V+ITRSfxGJCrJUtZOrjgCfW8FC
qbFC2jdXGOWWP8cN3Um/1hY=
=kZeh
-----END PGP SIGNATURE-----

Attachments:

helpcpatchtext/x-patch; charset=UTF-8; name=helpcpatchDownload+100-100
#2Greg Sabino Mullane
greg@turnstep.com
In reply to: Greg Sabino Mullane (#1)
Re: Quick little \h enhancement for psql

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Attached is a patch that enhances the "\h" capability in psql.

Any feedback on this? I'd like to see it added, but willing to
discuss/rewrite if not acceptable.

Thanks,
- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200506171234
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFCsvxevJuQZxSWSsgRAhwTAJ0bv/OrJ+7uXJvjI8M8DStXL7tOZQCgqKUL
lqDbO3AWAs9kJJWJ8npKJeI=
=SqgW
-----END PGP SIGNATURE-----

#3Bruce Momjian
bruce@momjian.us
In reply to: Greg Sabino Mullane (#2)
Re: Quick little \h enhancement for psql

Greg Sabino Mullane wrote:
[ There is text before PGP section. ]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Attached is a patch that enhances the "\h" capability in psql.

Any feedback on this? I'd like to see it added, but willing to
discuss/rewrite if not acceptable.

Uh, where is that patch? I don't have it and don't remember seeing it
either.

-- 
  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