Re: [PATCHES] minor psql cleanup

2003-12-01 Thread Bruce Momjian

Patch applied.  Thanks.  Someone had already removed the assert() from
tab_complete.c, but not the #include assert.h.

---


Neil Conway wrote:
 This patch reduces some unsightly #ifdefs, and fixes two typos in
 comments in the psql code. This doesn't make any functional change, so
 feel free to save it for 7.5
 
 -Neil
 

[ 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
  [EMAIL PROTECTED]   |  (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 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [PATCHES] minor psql cleanup

2003-11-30 Thread Bruce Momjian

Your patch has been added to the PostgreSQL unapplied patches list at:

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

I will try to apply it within the next 48 hours.

---


Neil Conway wrote:
 This patch reduces some unsightly #ifdefs, and fixes two typos in
 comments in the psql code. This doesn't make any functional change, so
 feel free to save it for 7.5
 
 -Neil
 

[ 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
  [EMAIL PROTECTED]   |  (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: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


Re: [PATCHES] minor psql cleanup

2003-10-25 Thread Bruce Momjian

This has been saved for the 7.5 release:

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

---

Neil Conway wrote:
 This patch reduces some unsightly #ifdefs, and fixes two typos in
 comments in the psql code. This doesn't make any functional change, so
 feel free to save it for 7.5
 
 -Neil
 

[ 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
  [EMAIL PROTECTED]   |  (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 7: don't forget to increase your free space map settings


[PATCHES] minor psql cleanup

2003-10-17 Thread Neil Conway
This patch reduces some unsightly #ifdefs, and fixes two typos in
comments in the psql code. This doesn't make any functional change, so
feel free to save it for 7.5

-Neil

Index: src/bin/psql/command.c
===
RCS file: /var/lib/cvs/pgsql-server/src/bin/psql/command.c,v
retrieving revision 1.105
diff -c -r1.105 command.c
*** src/bin/psql/command.c	11 Oct 2003 18:04:26 -	1.105
--- src/bin/psql/command.c	18 Oct 2003 04:02:50 -
***
*** 9,15 
  #include command.h
  
  #include errno.h
- #include assert.h
  #include ctype.h
  #ifdef HAVE_PWD_H
  #include pwd.h
--- 9,14 
***
*** 97,106 
  	const char *continue_parse = NULL;	/* tell the mainloop where the
  		 * backslash command ended */
  
! #ifdef USE_ASSERT_CHECKING
! 	assert(line);
! #endif
! 
  	my_line = xstrdup(line);
  
  	/*
--- 96,102 
  	const char *continue_parse = NULL;	/* tell the mainloop where the
  		 * backslash command ended */
  
! 	psql_assert(line);
  	my_line = xstrdup(line);
  
  	/*
***
*** 1234,1242 
  			   *tmp;
  	size_t		length;
  
! #ifdef USE_ASSERT_CHECKING
! 	assert(source);
! #endif
  
  	length = Min(len, strlen(source)) + 1;
  
--- 1230,1236 
  			   *tmp;
  	size_t		length;
  
! 	psql_assert(source);
  
  	length = Min(len, strlen(source)) + 1;
  
***
*** 1515,1526 
  	char	   *sys;
  	int			result;
  
! #ifdef USE_ASSERT_CHECKING
! 	assert(fname);
! #else
! 	if (!fname)
! 		return false;
! #endif
  
  	/* Find an editor to use */
  	editorName = getenv(PSQL_EDITOR);
--- 1509,1515 
  	char	   *sys;
  	int			result;
  
! 	psql_assert(fname);
  
  	/* Find an editor to use */
  	editorName = getenv(PSQL_EDITOR);
***
*** 1755,1766 
  {
  	size_t		vallen = 0;
  
! #ifdef USE_ASSERT_CHECKING
! 	assert(param);
! #else
! 	if (!param)
! 		return false;
! #endif
  
  	if (value)
  		vallen = strlen(value);
--- 1744,1750 
  {
  	size_t		vallen = 0;
  
! 	psql_assert(param);
  
  	if (value)
  		vallen = strlen(value);
Index: src/bin/psql/common.h
===
RCS file: /var/lib/cvs/pgsql-server/src/bin/psql/common.h,v
retrieving revision 1.29
diff -c -r1.29 common.h
*** src/bin/psql/common.h	3 Sep 2003 22:05:09 -	1.29
--- src/bin/psql/common.h	18 Oct 2003 04:00:20 -
***
*** 13,18 
--- 13,25 
  #include pqsignal.h
  #include libpq-fe.h
  
+ #ifdef USE_ASSERT_CHECKING
+ #include assert.h
+ #define psql_assert(p) assert(p)
+ #else
+ #define psql_assert(p)
+ #endif
+ 
  extern char *xstrdup(const char *string);
  
  extern bool setQFout(const char *fname);
Index: src/bin/psql/copy.c
===
RCS file: /var/lib/cvs/pgsql-server/src/bin/psql/copy.c,v
retrieving revision 1.33
diff -c -r1.33 copy.c
*** src/bin/psql/copy.c	4 Aug 2003 23:59:39 -	1.33
--- src/bin/psql/copy.c	18 Oct 2003 04:03:02 -
***
*** 9,15 
  #include copy.h
  
  #include errno.h
- #include assert.h
  #include signal.h
  #include sys/stat.h
  #ifndef WIN32
--- 9,14 
Index: src/bin/psql/stringutils.c
===
RCS file: /var/lib/cvs/pgsql-server/src/bin/psql/stringutils.c,v
retrieving revision 1.34
diff -c -r1.34 stringutils.c
*** src/bin/psql/stringutils.c	4 Aug 2003 23:59:40 -	1.34
--- src/bin/psql/stringutils.c	18 Oct 2003 04:02:28 -
***
*** 7,16 
   */
  #include postgres_fe.h
  
- #include assert.h
  #include ctype.h
  
  #include libpq-fe.h
  #include settings.h
  #include stringutils.h
  
--- 7,16 
   */
  #include postgres_fe.h
  
  #include ctype.h
  
  #include libpq-fe.h
+ #include common.h
  #include settings.h
  #include stringutils.h
  
***
*** 234,243 
  	char	   *src;
  	char	   *dst;
  
! #ifdef USE_ASSERT_CHECKING
! 	assert(source);
! 	assert(quote);
! #endif
  
  	src = dst = source;
  
--- 234,241 
  	char	   *src;
  	char	   *dst;
  
! 	psql_assert(source);
! 	psql_assert(quote);
  
  	src = dst = source;
  
Index: src/bin/psql/tab-complete.c
===
RCS file: /var/lib/cvs/pgsql-server/src/bin/psql/tab-complete.c,v
retrieving revision 1.89
diff -c -r1.89 tab-complete.c
*** src/bin/psql/tab-complete.c	17 Oct 2003 11:52:06 -	1.89
--- src/bin/psql/tab-complete.c	18 Oct 2003 04:27:01 -
***
*** 50,58 
  #ifdef USE_READLINE
  
  #include ctype.h
- #ifdef USE_ASSERT_CHECKING
- #include assert.h
- #endif
  
  #include libpq-fe.h
  
--- 50,55 
***
*** 1342,1348 
  			}
  	}
  
- 
  	/*
  	 * If we still don't have anything to match we have to fabricate some
  	 * sort of default list. If we were to just return NULL, readline
--- 1339,1344 
***
*** 1357,1363 
  #endif
  	}
  
- 
  	/* free