Re: [PATCHES] psql tab-completion for COMMIT/ROLLBACK PREPARED

2005-07-28 Thread Bruce Momjian

Patch applied.  Thanks.

---


Heikki Linnakangas wrote:
 On Fri, 1 Jul 2005, Bruce Momjian wrote:
 
  Heikki Linnakangas wrote:
  On Fri, 1 Jul 2005, Oliver Jowett wrote:
 
  PS: noticed in passing: psql's help doesn't seem to know about the 2PC
  command syntax yet.
 
  True.
 
  Should we add support for it? 2PC is not something you normally do
  interactively...
 
  Yes, we should add psql support for it.
 
 Ok, here's a patch.
 
 There's no tab-completion for PREPARE TRANSACTION 'xxx' since that would 
 be ambigous with PREPARE xxx AS xx.
 
 - Heikki

Content-Description: 

[ Attachment, skipping... ]

 
 ---(end of broadcast)---
 TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

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


[PATCHES] psql tab-completion for COMMIT/ROLLBACK PREPARED

2005-07-01 Thread Heikki Linnakangas

On Fri, 1 Jul 2005, Bruce Momjian wrote:


Heikki Linnakangas wrote:

On Fri, 1 Jul 2005, Oliver Jowett wrote:


PS: noticed in passing: psql's help doesn't seem to know about the 2PC
command syntax yet.


True.

Should we add support for it? 2PC is not something you normally do
interactively...


Yes, we should add psql support for it.


Ok, here's a patch.

There's no tab-completion for PREPARE TRANSACTION 'xxx' since that would 
be ambigous with PREPARE xxx AS xx.


- HeikkiIndex: src/bin/psql/tab-complete.c
===
RCS file: /projects/cvsroot/pgsql/src/bin/psql/tab-complete.c,v
retrieving revision 1.133
diff -c -r1.133 tab-complete.c
*** src/bin/psql/tab-complete.c 22 Jun 2005 21:14:30 -  1.133
--- src/bin/psql/tab-complete.c 1 Jul 2005 18:34:20 -
***
*** 926,941 
 pg_strcasecmp(prev_wd, USER) == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_users);
  
! /* BEGIN, END, COMMIT, ABORT */
else if (pg_strcasecmp(prev_wd, BEGIN) == 0 ||
 pg_strcasecmp(prev_wd, END) == 0 ||
-pg_strcasecmp(prev_wd, COMMIT) == 0 ||
 pg_strcasecmp(prev_wd, ABORT) == 0)
{
static const char *const list_TRANS[] =
{WORK, TRANSACTION, NULL};
  
COMPLETE_WITH_LIST(list_TRANS);
}
  /* RELEASE SAVEPOINT */
else if (pg_strcasecmp(prev_wd, RELEASE) == 0)
--- 926,948 
 pg_strcasecmp(prev_wd, USER) == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_users);
  
! /* BEGIN, END, ABORT */
else if (pg_strcasecmp(prev_wd, BEGIN) == 0 ||
 pg_strcasecmp(prev_wd, END) == 0 ||
 pg_strcasecmp(prev_wd, ABORT) == 0)
{
static const char *const list_TRANS[] =
{WORK, TRANSACTION, NULL};
  
COMPLETE_WITH_LIST(list_TRANS);
+   } 
+ /* COMMIT */
+   else if(pg_strcasecmp(prev_wd, COMMIT) == 0)
+   {
+   static const char *const list_COMMIT[] =
+   {WORK, TRANSACTION, PREPARED, NULL};
+ 
+   COMPLETE_WITH_LIST(list_COMMIT);
}
  /* RELEASE SAVEPOINT */
else if (pg_strcasecmp(prev_wd, RELEASE) == 0)
***
*** 944,950 
else if (pg_strcasecmp(prev_wd, ROLLBACK) == 0)
{
static const char *const list_TRANS[] =
!   {WORK, TRANSACTION, TO SAVEPOINT, NULL};
  
COMPLETE_WITH_LIST(list_TRANS);
}
--- 951,957 
else if (pg_strcasecmp(prev_wd, ROLLBACK) == 0)
{
static const char *const list_TRANS[] =
!   {WORK, TRANSACTION, TO SAVEPOINT, PREPARED, NULL};
  
COMPLETE_WITH_LIST(list_TRANS);
}

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [PATCHES] psql tab-completion for COMMIT/ROLLBACK PREPARED

2005-07-01 Thread Heikki Linnakangas
Oh, just realized after Tom's reply that you were talking about help, not 
tab-completion...


On Fri, 1 Jul 2005, Heikki Linnakangas wrote:


On Fri, 1 Jul 2005, Bruce Momjian wrote:


Heikki Linnakangas wrote:

On Fri, 1 Jul 2005, Oliver Jowett wrote:


PS: noticed in passing: psql's help doesn't seem to know about the 2PC
command syntax yet.


True.

Should we add support for it? 2PC is not something you normally do
interactively...


Yes, we should add psql support for it.


Ok, here's a patch.

There's no tab-completion for PREPARE TRANSACTION 'xxx' since that would be 
ambigous with PREPARE xxx AS xx.


- Heikki


- Heikki

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
   (send unregister YourEmailAddressHere to [EMAIL PROTECTED])