Index: configure.in =================================================================== RCS file: /projects/cvsroot/pgsql-server/configure.in,v retrieving revision 1.236 diff -u -r1.236 configure.in --- configure.in 2003/02/14 14:05:00 1.236 +++ configure.in 2003/02/16 02:05:15 @@ -689,17 +689,19 @@ if test "$with_readline" = yes; then AC_CHECK_HEADERS(readline/readline.h, [], - [AC_CHECK_HEADERS(readline.h, [], + [AC_CHECK_HEADERS(editline/readline.h, [], + [AC_CHECK_HEADERS(readline.h, [], [AC_MSG_ERROR([readline header not found If you have readline already installed, see config.log for details on the failure. It is possible the compiler isn't looking in the proper directory. -Use --without-readline to disable readline support.])])]) +Use --without-readline to disable readline support.])])])]) AC_CHECK_HEADERS(readline/history.h, [], - [AC_CHECK_HEADERS(history.h, [], + [AC_CHECK_HEADERS(editline/history.h, [], + [AC_CHECK_HEADERS(history.h, [], [AC_MSG_ERROR([history header not found If you have readline already installed, see config.log for details on the failure. It is possible the compiler isn't looking in the proper directory. -Use --without-readline to disable readline support.])])]) +Use --without-readline to disable readline support.])])])]) fi if test "$with_zlib" = yes; then @@ -878,6 +880,7 @@ if test "$with_readline" = yes; then PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER AC_CHECK_FUNCS([rl_completion_matches rl_filename_completion_function]) + AC_CHECK_FUNCS([replace_history_entry]) fi Index: src/bin/psql/command.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/bin/psql/command.c,v retrieving revision 1.89 diff -u -r1.89 command.c --- src/bin/psql/command.c 2003/02/13 04:08:16 1.89 +++ src/bin/psql/command.c 2003/02/16 02:05:21 @@ -1649,7 +1649,12 @@ } #ifdef USE_READLINE +#ifdef HAVE_REPLACE_HISTORY_ENTRY + replace_history_entry(where_history(),query_buf->data,NULL); +#else + add_history(query_buf->data); +#endif #endif fclose(stream); } Index: src/bin/psql/input.h =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/bin/psql/input.h,v retrieving revision 1.17 diff -u -r1.17 input.h --- src/bin/psql/input.h 2002/09/04 20:31:36 1.17 +++ src/bin/psql/input.h 2003/02/16 02:05:21 @@ -18,11 +18,15 @@ #define USE_READLINE 1 #if defined(HAVE_READLINE_READLINE_H) #include +#elif defined(HAVE_EDITLINE_READLINE_H) +#include #elif defined(HAVE_READLINE_H) #include #endif #if defined(HAVE_READLINE_HISTORY_H) #include +#elif defined(HAVE_EDITLINE_HISTORY_H) +#include #elif defined(HAVE_HISTORY_H) #include #endif Index: src/include/pg_config.h.in =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/include/pg_config.h.in,v retrieving revision 1.39 diff -u -r1.39 pg_config.h.in --- src/include/pg_config.h.in 2003/02/14 14:05:00 1.39 +++ src/include/pg_config.h.in 2003/02/16 02:05:21 @@ -356,6 +356,12 @@ /* Set to 1 if you have */ #undef HAVE_READLINE_READLINE_H +/* Set to 1 if you have */ +#undef HAVE_EDITLINE_HISTORY_H + +/* Set to 1 if you have */ +#undef HAVE_EDITLINE_READLINE_H + /* Set to 1 if you have */ #undef HAVE_SECURITY_PAM_APPL_H @@ -552,6 +558,9 @@ /* Set to 1 if you have rl_filename_completion_function */ #undef HAVE_RL_FILENAME_COMPLETION_FUNCTION + +/* Set to 1 if you have replace_history_entry */ +#undef HAVE_REPLACE_HISTORY_ENTRY /* Set to 1 if you have getopt_long() (GNU long options) */ #undef HAVE_GETOPT_LONG