2011-06-05  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Release: 0.40 (tag v0.40)

2011-06-05  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[uninst int] Use $(DESTDIR) more.

	* Makefile.am (uninstall-hook): Use $(DESTDIR) more.

2011-06-05  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[inst] Zonk useless $(pkglibdir) if ‘USE_CMOD’.

	Probably better would be to teach Automake to DTRT.

	* Makefile.am (install-data-hook) [USE_CMOD]:
	Delete useless ‘$(DESTDIR)$(pkglibdir)’.

2011-06-04  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[C] For consistency, use ‘unsigned long int’ for sepo tag.

	* libpq.c (sepo_type_tag): Change type to ‘unsigned long int’.

2011-06-04  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[C] Paper signed/unsigned wart for ‘PQmblen’ first arg.

	* libpq.c (pg_mblen): Cast first arg of ‘PQmblen’ to ‘void *’.

2011-06-04  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[C] Use ‘ERROR’ more.

	* libpq.c (pg_trace): Use ‘ERROR’.

2011-06-04  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[C] Convert auto var ‘FUNC_NAME’ to #define.

	This avoids "unused variable" warnings in newer Guile versions.

	* libpq.c (lob_flush, lob_end_input, lob_seek, lob_fill_input)
	(lob_write): #define FUNC_NAME internally; #undef too.

2011-06-02  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build] Prefer libpq headers in $(includedir)/postgresql, if available.

	* libpq.c: If <postgresql/libpq-fe.h> is
	available, #include that instead of <libpq-fe.h>;
	likewise <postgresql/libpq/libpq-fs.h> over <libpq/libpq-fs.h>.

2011-06-02  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[int] Don't use assignment expression as ‘SCM_OPFPORTP’ arg.

	* libpq.c (pg_print): Assign to local var
	‘curout’ first; then use it as ‘SCM_OPFPORTP’ arg.

2011-06-02  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[int] If necessary, #define SCM_{ROCHARS,ROLENGTH,ROUCHARS}.

	* gi.h [!SCM_ROCHARS] (SCM_ROCHARS): New #define.
	[!SCM_ROLENGTH] (SCM_ROLENGTH): Likewise.
	[!SCM_ROUCHARS] (SCM_ROUCHARS): Likewise.

2011-06-02  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[scheme] Use ‘cons*’, not ‘list*’.

	Apparently, ‘list*’ is not cool enough for some Guile versions.

	* postgres-gxrepl.scm (defcc): Use ‘cons*’, not ‘list*’.

2011-05-18  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build] Don't clobber Makefile "user vars" ‘CPPFLAGS’, ‘LDFLAGS’.

	* Makefile.am (AM_CPPFLAGS, AM_LDFLAGS): New vars.
	(postgres_la_LDFLAGS): Add $(AM_LDFLAGS).
	(snarfcppopts): Add $(AM_CPPFLAGS).

2011-05-17  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build int] Decruft: Don't bother with ‘scm_gc_protect_object’.

	* gi.h (scm_protect_object): Delete #define.

2011-05-17  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build int] Use ‘AC_CHECK_DECLS’ for ‘scm_terminating’.

	* libpq.c: Throughout, replace ‘defined HAVE_SCM_TERMINATING’
	with ‘HAVE_DECL_SCM_TERMINATING’.

2011-05-17  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[pq int] Use ‘__func__’ more.

	* libpq.c (lob_fill_input, lob_write): Use ‘__func__’.

2011-05-16  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build int] Specify ‘ACLOCAL_AMFLAGS’ in Makefile.am.

	* Makefile.am (ACLOCAL_AMFLAGS): New var.

2011-05-16  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build install] Installed punified Scheme, sans ".scm" extension.

	* Makefile.am (d_DATA, stamp-all): Do s/schemesource/schemestems/.
	(SUFFIXES): New var.
	(.scm): New old-style suffix rule.
	(install-data-hook): Check for "foo.scm" in $(ddir); emit warning.
	(CLEANFILES): Add $(schemestems).

2011-05-16  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[v] Make partial install depend on ../src "make all".

	Omission from 2011-05-14, "Do a partial
	install under test/; point ‘%load-path’ there".

	* Makefile.am (stamp-all): New target.
	(noinst_DATA): New var.
	[MAINTAINER_MODE] (noinst_DATA): Change ‘=’ to ‘+=’.
	(CLEANFILES): Add stamp-all.

2011-05-16  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[uninstall] Fix bug: Make sure everything is properly deleted.

	* Makefile.am (update-libsite-module-catalog): New target.
	(install-data-hook) [USE_CMOD]: Use ‘update-libsite-module-catalog’.
	(uninstall-hook): New target.

2011-05-16  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build int] Refactor src/Makefile.am slightly.

	* Makefile.am (schemesource, EXTRA_DIST, d_DATA): New vars.
	(dist_d_DATA): Delete var.
	[!USE_CMOD] (d_DATA): Convert assignment from ‘=’ to ‘+=’.
	[MAINTAINER_MODE] (scheme.tsar): Use $(schemesource).

2011-05-16  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[qcons int] Avoid using literal symbols with ‘#\#’ in the name.

	These cause round-trip problems that vary from
	one Guile implementation to the next.

	* postgres-qcons.scm (*infix-operations*):
	Use ‘string->symbol’ for symbols named "#", "##", "?#".

2011-05-15  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[doc] Spiff docstrings; use ‘-args:’ instead of ‘-sig:’.

	* libpq.c: Throughout, as described above.
	* postgres-col-defs.scm: Likewise.
	* postgres-gxrepl.scm: Likewise.
	* postgres-meta.scm: Likewise.
	* postgres-qcons.scm: Likewise.
	* postgres-resdisp.scm: Likewise.
	* postgres-table.scm: Likewise.
	* postgres-types.scm: Likewise.

2011-05-15  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[doc int] Use ‘doc:’+comment for ‘PRIMPROC’ docstrings.

	* libpq.c: Throughout, convert series-of-strings
	style docstrings to ‘doc:’+comment style docstrings.

2011-05-15  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[int] Add abstractions for all gh_ elements.

	* gi.h (BOOLEANP, EXACTP, NULLP, PAIRP, STRINGP, SYMBOLP)
	(PROCEDUREP, BOOLEAN, NUM_INT, NUM_ULONG, SYMBOL, STRING, BSTRING)
	(CHARACTER, C_INT, VECTOR_LEN, EQ, CONS, CAR, CDR, SETCAR, SETCDR)
	(EVAL_STRING, APPLY, LISTIFY): New #define:s.
	(MEMQ): New macro.
	(ROZT_X): Use ‘BSTRING’.
	(PCHAIN): Use ‘LISTIFY’.
	* libpq.c: Use new abstractions, throughout.

2011-05-15  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[int] Add abstractions: PRIMPROC, STONED, MOD_INIT_LINK_THUNK

	* gi.h (PRIMPROC, STONED, MOD_INIT_LINK_THUNK): New #define:s.
	* libpq.c: Use them, throughout.

2011-05-15  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build maint] Don't bundle modsup.h; copy 3 macros from it, instead.

	* gi.h [!HAVE_GUILE_MODSUP_H] (GH_DEFPROC): New macro.
	[!HAVE_GUILE_MODSUP_H] (GH_MODULE_LINK_FUNC, GH_STONED): Likewise.
	* modsup.h.snap: Delete file.
	* Makefile.am (EXTRA_DIST): Delete var.

2011-05-15  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[int] Move guile abstractions from libpq.c to gi.h.

	* libpq.c (NOINTS, INTSOK, GIVENP, NOT_FALSEP, DEFAULT_FALSE)
	(RETURN_FALSE, RETURN_UNSPECIFIED, ASSERT, ASSERT_STRING, ROZT_X)
	(ROZT, MAX_NEWSTRING_LENGTH, SMOBDATA, PCHAIN, ERROR, MEMORY_ERROR)
	(SYSTEM_ERROR, WBPORT): Move from here...
	* gi.h (NOINTS, INTSOK, GIVENP, NOT_FALSEP, DEFAULT_FALSE)
	(RETURN_FALSE, RETURN_UNSPECIFIED, ASSERT, ASSERT_STRING, ROZT_X)
	(ROZT, MAX_NEWSTRING_LENGTH, SMOBDATA, PCHAIN, ERROR, MEMORY_ERROR)
	(SYSTEM_ERROR, WBPORT): ...to here.

2011-05-15  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[int] Decruft: Don't #define __func__.

	* libpq.c (__func__): Delete #define
	and surrounding preproc conditionals.

2011-05-15  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build inst] Add support for "no C module" mode.

	* Makefile.am (d_LTLIBRARIES): Conditionalize with ‘USE_CMOD’.
	[!USE_CMOD] (pkglib_LTLIBRARIES, d_DATA): New vars.
	[!USE_CMOD] (postgres.exports, postgres): New targets.
	(install-data-hook): Conditionalize sofix invocation with ‘USE_CMOD’.
	(install-data-hook) [USE_CMOD]: Don't use $(mkmodcat);
	instead, invoke "$(GUILE_TOOLS) make-module-catalog" directly.
	(install-data-hook) [!USE_CMOD]: Add commands to generate
	and install an in-tree Scheme wrapper, if ‘FOR_MAKE_CHECK’ set.
	(DISTCLEANFILES): Add postgres.exports.
	(CLEANFILES): Add postgres.
	* libpq.c (scm_init_database_postgres_module):
	Conditionalize this GH_MODULE_LINK_FUNC with ‘ifdef USE_CMOD’.
	[!USE_CMOD] (guile_pg_init_database_postgres_module): New func.

2011-05-15  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[int] Rename some libpq.c functions for uniformity.

	U(X) ≡ "Rename from X".
	* libpq.c (pg_lo_creat): U (lob_lo_creat).
	(pg_lo_open): U (lob_lo_open).
	(pg_lo_unlink): U (lob_lo_unlink).
	(pg_lo_get_oid): U (lob_lo_get_oid).
	(pg_lo_tell): U (lob_lo_tell).
	(pg_lo_seek): U (lob_lo_seek).
	(pg_lo_read): U (lob_lo_read).
	(pg_lo_import): U (lob_lo_import).
	(pg_lo_export): U (lob_lo_export).

2011-05-14  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[inst int] Move $(mkmodcat) invocation from top dir to src/.

	* Makefile.am (install-data-hook): Add command
	to make the module-catalog in $(GUILE_LIBSITE).

2011-05-14  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[inst] Decruft: Don't do "upgrade from previous install" actions.

	These are properly the duty of "make uninstall"
	for the previous release.

	* Makefile.am (retired): Delete var.
	(install-data-hook): Don't delete $(ddir)/postgres-sup.*;
	don't delete $(retired) and contents.

2011-05-07  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build int] Use Guile-BAUX for init snarfing.

	* Makefile.am (SUFFIXES): Delete var.
	(.c.x): Use ‘$(gx) c2x’ instead of $(c2x).

2011-05-03  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build] Use Guile-BAUX for doc snarfing.

	* Makefile.am: include .../common.mk.
	(dotdocfiles): Delete var.
	(SUFFIXES): Remove .doc.
	(.c.doc, .scm.doc): Delete old-style suffix rules.
	[MAINTAINER_MODE] (BUILT_SOURCES): Remove $(dotdocfiles).
	[MAINTAINER_MODE] (.doc-index): Delete target.
	[MAINTAINER_MODE] (noinst_DATA): Remove .doc-index; add all.tsar.
	[MAINTAINER_MODE] (all.tsar, libpq.tsar, scheme.tsar): New targets.
	(DISTCLEANFILES): Remove *.doc.

2010-11-18  Thien-Thi Nguyen  <ttn@gnuvola.org>

	New (database postgres-qcons) proc: idquote

	* postgres-qcons.scm (idquote): New proc, exported.
	(maybe-dq): Use ‘idquote’.

2010-07-19  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build] Fix bug: Extract documentation from Scheme source.

	Regression introduced 2009-06-21,
	"Minimize "make -C doc/" work in default case".
	* Makefile.am (dotdocfiles): Add $(schemestems:%=%.doc).

2010-06-26  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[C int] Avoid signed/unsigned comparison.

	* libpq.c (lob_fill_input): Simplify ‘lo_read’ rv handling.

2010-06-26  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Sync snapshot files with Guile 1.4.1.119.

	* modsup.h.snap: Sync with Guile 1.4.1.119.

2010-01-11  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Release: 0.39 (tag v0.39)

2010-01-11  Thien-Thi Nguyen  <ttn@gnuvola.org>

	No longer accept keyword for ‘pg-parameter-status’ PARM arg.

	* libpq.c (pg_parameter_status):
	No longer accept keyword for PARM arg.

2010-01-11  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Drop procs ‘pg-set-client-data!’, ‘pg-get-client-data’.

	* libpq.c (xc_t): Delete member ‘client’.
	(xc_mark): Update.
	(CONN_CLIENT): Delete cpp macro.
	(pg_connectdb): Update.
	(pg_get_client_data, pg_set_client_data): Delete funcs.

2010-01-11  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Drop proc ‘pg-lo-get-connection’.

	* libpq.c (lob_lo_get_connection): Delete func.

2010-01-11  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[C int] Add cast to silence compiler warning.

	* libpq.c (pg_mblen): Add cast in call to ‘PQmblen’.

2009-06-22  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Release: 0.38 (tag v0.38)

2009-06-22  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Make ‘pg-parameter-status’ accept symbol for PARM.

	* libpq.c (pg_parameter_status): Accept symbol as PARM.

2009-06-22  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Mention imminent demise of certain procs.

	* libpq.c (lob_lo_get_connection):
	Add "will be removed" notice to docstring.
	(pg_get_client_data, pg_set_client_data): Likewise.

2009-06-21  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build] Minimize "make -C doc/" work in default case.

	* Makefile.am (schemefrags, schemestems): New vars.
	(dotdocfiles): Delete postgres-resdisp.doc, postgres-types.doc,
	postgres-col-defs.doc, postgres-resx.doc, postgres-qcons.doc,
	postgres-gxrepl.doc, postgres-table.doc, postgres-meta.doc.
	(BUILT_SOURCES): Delete $(dotdocfiles).
	(dist_d_DATA): Use $(schemestems).
	(BUILT_SOURCES) [MAINTAINER_MODE]: Append $(dotdocfiles).

2009-06-21  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[config] Use CPPFLAGS, LDFLAGS directly.

	* Makefile.am (AM_CPPFLAGS): Delete var.
	(postgres_la_LDFLAGS): Remove $(LDFLAGS), $(PQ_LDFLAGS).
	(snarfcppopts): Remove $(AM_CPPFLAGS); add $(DEFAULT_INCLUDES).

2009-06-21  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[C int] Update #include:d files.

	* libpq.c: #include "config.h" instead of <config.h>;
	#include <stdlib.h>.

2009-06-20  Thien-Thi Nguyen  <ttn@gnuvola.org>

	New (database postgres) proc: pg-server-version

	* libpq.c (pg_server_version): New GH_DEFPROC.

2009-06-20  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Revert: Support "E-prefixing" for ‘pgtable-manager’ SQL quoting.

	That is the wrong approach.

	* postgres-table.scm: From module (database postgres),
	no longer select ‘pg-result-status’.
	(pgtable-manager): Use ‘sql-quote’ directly.

2009-06-20  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[qcons] Do single-quote escaping via doubling, per SQL standard.

	* postgres-qcons.scm (sql-quote): Escape single-quote
	by doubling, instead of inserting a backslash prior to, it.

2009-06-20  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[t-mgr int] For column values, allow keywords to stand for themselves.

	* postgres-table.scm (pgtable-manager ->db-insert-string):
	Pass all keywords through, unchanged.

2009-06-19  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[t-mgr] Recognize #:DEFAULT as column value.

	* postgres-table.scm (pgtable-manager ->db-insert-string):
	For #:DEFAULT, return "DEFAULT".

2009-06-18  Thien-Thi Nguyen  <ttn@gnuvola.org>

	New (database postgres) proc: pg-mblen

	* libpq.c (pg_char_to_encoding) [!HAVE_DECL_PG_CHAR_TO_ENCODING]:
	New func decl.
	(encoding_alist): New static data structure.
	(pg_mblen): New GH_DEFPROC.
	(init_module): Init ‘encoding_alist’.

2009-01-05  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Decruft: Use 1..7 instead of SCM_ARG1..SCM_ARG7.

	* libpq.c (pg_get_copy_data, pg_make_print_options)
	(pg_print, pg_set_notice_out_x): Use 1..7 directly.

2008-11-27  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Use ‘(ftell port)’ instead of ‘(seek port 0 SEEK_CUR)’.

	* libpq.c (lob_lo_tell): Use ‘scm_ftell’.

2008-11-21  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Decruft: Don't (pretend) to wrap system calls.

	* libpq.c (SYSCALL): Delete macro.
	(pg_trace, pg_untrace, pg_print): Update.

2008-09-18  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Use ‘(string-null? foo)’ instead of ‘(string=? "" foo)’.

	* postgres-gxrepl.scm (gxrepl -read): Use ‘string-null?’.
	(gxrepl -print): Likewise.
	* postgres-table.scm (pgtable-manager): Likewise.

2008-09-06  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Use ‘size_t’ instead of ‘scm_sizet’.

	* libpq.c (xc_free): Change return value type to ‘size_t’.
	(res_free, sepo_free): Likewise.

2008-08-16  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Remove support for unused SCM_OUTPORTP.

	* gi.h (SCM_OUTPORTP) [!HAVE_SCM_OUTPORTP]:
	Delete macro and surrounding #ifndef construct.

2008-08-16  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Hone C internals: Refactor, increase/add abstraction, etc.

	* libpq.c (PROB, NOINTS, INTSOK, GIVENP): New macros.
	(EXACTLY_FALSEP, EXACTLY_TRUEP): Delete macros.
	(DEFAULT_FALSE, RETURN_FALSE, RETURN_UNSPECIFIED): New macros.
	(ASSERT, ASSERT_STRING): New macros.
	(SYSCALL): Rename macro from ‘SCM_SYSCALL’.
	(ROZT_X): Use ‘gh_str2scm’.
	(SMOBDATA, PCHAIN, ERROR): New macros.
	(MEMORY_ERROR, SYSTEM_ERROR, WBPORT): New macros.
	(xc_unbox): Use ‘SMOBDATA’.
	(ASSERT_CONNECTION): Use ‘ASSERT’.
	(CONN_CONN): New macro.
	(xc_name): New static char array (string).
	(xc_display): Rewrite.
	(VALIDATE_CONNECTION_UNBOX_DBCONN): Use ‘ASSERT’ and ‘CONN_CONN’.
	(LOB_CONN): Use ‘CONN_CONN’.
	(LOBPORTP): Use ‘SCM_NIMP’.
	(lob_mklobport, lob_lo_creat, lob_lo_open, lob_lo_unlink): Update.
	(ASSERT_PORT, LOB_STREAM): New macros.
	(lob_lo_get_connection, lob_lo_get_oid, lob_lo_tell, lob_flush)
	(lob_end_input, lob_seek, lob_lo_seek, lob_fill_input, lob_write)
	(lob_lo_read, lob_close, lob_mark, lob_free, lob_lo_import)
	(lob_lo_export, lob_printpt, res_unbox, res_box): Update.
	(VALIDATE_RESULT_UNBOX): Use ‘ASSERT’.
	(res_name): New static cahr array (string).
	(res_display): Rewrite.
	(prep_paramspecs): Use ‘gh_vector_length’; update; call
	‘free’ unconditionally (without checking if its arg is NULL).
	(pg_protocol_version, pg_conndefaults, notice_processor)
	(pg_connectdb, pg_connection_p, pg_finish, pg_reset)
	(pg_set_client_data, pg_escape_string_conn, pg_escape_bytea_conn)
	(pg_unescape_bytea, pg_exec, pg_exec_params, pg_exec_prepared)
	(pg_result_p, pg_result_error_field, pg_error_message, pg_get_db)
	(pg_get_user, pg_get_pass, pg_get_host, pg_get_port, pg_get_tty)
	(pg_get_options, pg_backend_pid, pg_parameter_status)
	(pg_result_status, pg_ntuples, pg_nfields, pg_cmdtuples)
	(pg_oid_value, pg_fnumber): Update.
	(CHECK_TUPLE_COORDS): New macro.
	(pg_getvalue, pg_getlength, pg_getisnull, pg_binary_tuples)
	(pg_put_copy_end, pg_get_copy_data, pg_getline, pg_getlineasync)
	(pg_putline, pg_endcopy, pg_set_error_verbosity, pg_trace)
	(pg_untrace, sepo_unbox): Update.
	(sepo_name): New static byte array (string).
	(sepo_display): Rewrite.
	(pg_make_print_options, pg_print, pg_set_notice_out_x, pg_notifies)
	(pg_set_client_encoding_x, pg_set_nonblocking_x, pg_is_nonblocking_p)
	(pg_send_query, pg_send_query_params, pg_send_query_prepared)
	(pg_get_result, pg_consume_input, pg_is_busy_p, pg_request_cancel)
	(pg_flush, init_module): Update.

2008-08-15  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Omit port from connection external rep, if host is a socket dir.

	* libpq.c (xc_display): Omit port if host begins with '/'.

2008-08-13  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Make ‘pg-print’ faster: Add fast path for file ports.

	* libpq.c (pg_print): Rework detection for redirect case
	to exclude ports w/ an underlying file descriptor (file ports);
	for those, if the current output-port's has a file descriptor
	and it is the same as stdout's, use that directly, otherwise
	‘dup’ and ‘fdopen’ the current output-port's file descriptor,
	and ‘fclose’ it afterwards.

2008-08-13  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Assume system provides tmpfile(3).

	* libpq.c [!HAVE_TMPFILE]: Don't #include "tmpfile.h";
	don't #define tmpfile to the locally-provided one.
	* Makefile.am (postgres_la_SOURCES): Remove tmpfile.c.
	* tmpfile.h: Delete file.
	* tmpfile.c: Delete file.

2008-08-13  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Consolidate Guile API specification.

	* bcruft.h: Delete file.
	* fcruft.h: Delete file.
	* gi.h: New file.
	* libpq.c: No longer #include <libguile.h> and <guile/gh.h>.
	Instead, #include "gi.h".
	* Makefile.am (postgres_la_SOURCES):
	Add gi.h; remove bcruft.h and fcruft.h.

2008-08-13  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Add infrastructure to more easily tweak GCC warnings for "make all".

	* Makefile.am (AM_CFLAGS): New var.

2008-08-13  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Tweak C code to eliminate some compiler warnings.

	* libpq.c (lob_write): Remove unnecessary cast from ‘void *’.
	Also, use ‘size_t’ for vars involved in computing ‘remaining’.
	(pg_result_error_field): Add ‘default: ;’ to ‘switch’.
	(init_module): Use ‘unsigned int’ for iteration var.

2008-08-12  Thien-Thi Nguyen  <ttn@gnuvola.org>

	C optimization: Make ‘pg-lo-read’ faster.

	* libpq.c (MAX_NEWSTRING_LENGTH): New macro.
	(lob_lo_read): Rewrite.

2008-08-11  Thien-Thi Nguyen  <ttn@gnuvola.org>

	GCC annotation: Add __attribute__ ((unused)) for some args.

	* libpq.c (UNUSED): New macro.
	(xc_display, lob_input_waiting_p, res_display, sepo_display): Use it.

2008-08-11  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Decruft: Delete degenerate mark functions.

	* libpq.c (res_mark, sepo_mark): Delete funcs.
	(init_module): Don't specify mark funcs for res and sepo smobs.

2008-08-11  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Increase abstraction: Use SCM_{MEMORY,MISC}_ERROR and SCM_SYSERROR.

	* libpq.c (lob_mklobport): Use ‘SCM_MEMORY_ERROR’.
	(lob_lo_creat, lob_lo_open): Use ‘SCM_MISC_ERROR’.
	(lob_flush): Use ‘SCM_SYSERROR’.
	(lob_end_input, lob_seek, lob_fill_input): Use ‘SCM_MISC_ERROR’.
	(lob_write): Use ‘SCM_SYSERROR’.
	(prep_paramspecs, pg_connectdb): Use ‘SCM_MISC_ERROR’.
	(pg_escape_string_conn): Use ‘SCM_SYSERROR’.
	(pg_set_error_verbosity): Use ‘SCM_MISC_ERROR’.
	(pg_trace, pg_untrace, pg_print): Use ‘SCM_SYSERROR’.

2008-08-10  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Drop support for PostgreSQL 7.3.x and earlier.

	* libpq.c: Don't bother w/ INVALIDOID_HEADER.
	Throughout, remove code that does not assume
	HAVE_PQRESULTERRORMESSAGE, HAVE_PQPASS, HAVE_PQBACKENDPID,
	HAVE_PQOIDVALUE, HAVE_PQBINARYTUPLES, HAVE_PQFMOD,
	HAVE_PQPUTNBYTES, HAVE_PQSETNONBLOCKING, HAVE_PQISNONBLOCKING,
	HAVE_PQPROTOCOLVERSION and HAVE_PQFREEMEM, as well as the
	corresponding preprocessor macros (which in some cases makes
	code that does assume those conditions unconditional).
	Remove if-lacking-feature blurb from docstrings.
	(nosupp, noparams) [!HAVE_PQPROTOCOLVERSION]: Delete strings.
	(SORRYNOSUPPORT, SORRYNOPARAMS) [!HAVE_PQPROTOCOLVERSION]: Delete macros.
	(pg_result_error_message, pg_get_pass, pg_backend_pid)
	(pg_oid_value, pg_getvalue, pg_binary_tuples, pg_fmod)
	(pg_putline, pg_set_nonblocking_x, pg_is_nonblocking_p)
	(pg_protocol_version, pg_exec_params, pg_exec_prepared)
	(pg_result_error_field, pg_transaction_status, pg_parameter_status)
	(pg_ftable, pg_ftablecol, pg_fformat, pg_put_copy_data)
	(pg_put_copy_end, pg_get_copy_data, pg_set_error_verbosity)
	(pg_notifies, pg_send_query_params, pg_send_query_prepared)
	(pg_sym_PQRESULTERRORMESSAGE, pg_sym_PQPASS, pg_sym_PQBACKENDPID)
	(pg_sym_PQOIDVALUE, pg_sym_PQBINARYTUPLES, pg_sym_PQFMOD)
	(pg_sym_PQSETNONBLOCKING, pg_sym_PQISNONBLOCKING)
	(pg_sym_PQPROTOCOLVERSION, init_module): Update.

2008-08-10  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Increase abstraction: Define C macros to specify "result format".

	* libpq.c (RESFMT_TEXT, RESFMT_BINARY): New value macros.
	(pg_exec_params, pg_exec_prepared, pg_send_query_params)
	(pg_send_query_prepared): Use ‘RESFMT_TEXT’.

2008-08-10  Thien-Thi Nguyen  <ttn@gnuvola.org>

	C optimization: Declare smob-predicate funcs inline.

	* libpq.c (xc_p, res_p, sepo_p): Declare ‘inline’.

2008-08-08  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Support "E-prefixing" for ‘pgtable-manager’ SQL quoting.

	* postgres-table.scm: From module (database postgres),
	also select ‘pg-result-status’.
	(pgtable-manager): Don't use ‘sql-quote’ directly; instead, init
	at closure-creation time the SQL-quoting procedure that wraps
	‘sql-quote’ to a variant that does "E-prefixing" if the supported
	by the backend.

2008-08-07  Thien-Thi Nguyen  <ttn@gnuvola.org>

	New (database postgres-resx) proc: object<-result

	* postgres-resx.scm (object<-result): New proc, exported.

2008-08-07  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Hide ‘compile-outspec’ implementation details.

	* postgres-table.scm (compiled-outspec?): New object property.
	(compile-outspec): Replace ‘(cons compiled-outspec RV)’
	marking with setting of property ‘compile-outspec?’.
	(compiled-outspec?-extract): Rewrite.

2008-08-07  Thien-Thi Nguyen  <ttn@gnuvola.org>

	For ‘pgtable-manager’, validate INSERT column counts.

	* postgres-table (pgtable-manager check-col-count): New proc.
	(pgtable-manager insert-values): Use ‘check-col-count’.
	(pgtable-manager insert-col-values): Likewise.

2008-08-07  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Make ‘pgtable-manager’ INSERT commands faster.

	* postgres-table.scm (pgtable-manager):
	compute number of columns and type names once.
	(pgtable-manager serial?): Incorporate intneral proc into unique caller.
	(pgtable-manager qstring<-colname): Likewise.
	(pgtable-manager insert-variant): Delete internal proc.
	(pgtable-manager do-insert): New internal proc.
	(pgtable-manager insert-values): Likewise.
	(pgtable-manager insert-col-values): Likewise.
	(pgtable-manager insert-alist): Likewise.
	(pgtable-manager die!): No longer treat ‘insert-alist’,
	‘insert-col-values’ and ‘insert-values’ dynamically.

2008-08-06  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Debogify: Make ‘pgtable-manager’ INSERTs no longer strip ‘serial’ cols.

	* postgres-table.scm (pgtable-manager insert-variant clean-defs):
	Delete internal proc; update callers to elide its call.

2008-08-06  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Make ‘pgtable-manager’ faster.

	* postgres-table.scm: From module (ice-9 common-list),
	select also ‘pick-mappings’.
	(fmt): Incorporate into ‘pgtable-manager’.
	(symbol->qstring, serial? col-defs, drop-proc, create-proc)
	(->db-insert-string, clean-defs, pre-insert-into, insert-values-proc)
	(insert-col-values-cmd, insert-col-values-proc, insert-alist-proc)
	(delete-rows-proc, update-col-proc, select-proc): Likewise.
	(pgtable-manager): Compute each column name's "qstring" only once.

2008-07-17  Thien-Thi Nguyen  <ttn@gnuvola.org>

	C optimization: Declare unboxing funcs inline.

	* libpq.c (xc_unbox, res_unbox, sepo_unbox): Declare ‘inline’.

2008-07-17  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Decruft: Remove gc- and init-debugging macros.

	* libpq.c (GC_PRINT, INIT_PRINT): Delete macros
	and surrounding pre-processor conditionals.
	(xc_mark, xc_free): Remove ‘GC_PRINT’ call.
	(res_mark, res_free, sepo_mark, sepo_free): Likewise.
	(init_module): Remove ‘INIT_PRINT’ call.

2008-07-16  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Increase abstraction: Use "cell word 0" for lobport access.

	* libpq.c (LOBPORT_WITH_FLAGS_P): New macro.
	(OPLOBPORTP, OPINLOBPORTP): Use ‘LOBPORT_WITH_FLAGS_P’.
	(lob_mklobport): Use ‘SCM_SET_CELL_WORD_0’.

2008-07-16  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Increase abstraction: Make ‘res_box’ handle NULL-check.

	* libpq.c (res_box): If given NULL, return Scheme false.
	(pg_exec, pg_exec_params, pg_exec_prepared, pg_send_query): Update.

2008-07-16  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Decruft: Inline single-use *_box funcs.

	* libpq.c (xc_box, sepo_box): Delete funcs.
	(pg_connectdb): Use ‘SCM_RETURN_NEWSMOB’ directly.
	(pg_make_print_options): Likewise.

2008-07-16  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Increase abstraction: Use C macros for smob data access.

	* libpq.c (xc_unbox): Use ‘SCM_SMOB_DATA’.
	(res_unbox, sepo_unbox): Likewise.
	(xc_free): Use ‘SCM_SET_SMOB_DATA’.
	(res_free, sepo_free): Likewise.

2008-07-16  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Decruft: Elide internal function ‘make_res’.

	* libpq.c (make_res): Delete func;
	convert all callers to use ‘res_box (result)’ instead.

2008-07-16  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Use guile.m4 facilities from Guile 1.4.1.118.

	* Makefile.am (install-data-hook): Use $(mkmodcat).

2008-07-15  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Move Scheme code into src/.

	* postgres-col-defs.scm: Move from ../scm/.
	* postgres-gxrepl.scm: Likewise.
	* postgres-meta.scm: Likewise.
	* postgres-qcons.scm: Likewise.
	* postgres-resdisp.scm: Likewise.
	* postgres-resx.scm: Likewise.
	* postgres-table.scm: Likewise.
	* postgres-types.scm: Likewise.
	* Makefile.am (dotdocfiles): New var.
	(BUILT_SOURCES): Remove libpq.doc; add $(dotdocfiles).
	(dist_d_DATA): New var.
	(.scm.doc): New pattern rule.
	(.doc-index) [MAINTAINER_MODE]: New target.
	(noinst_DATA) [MAINTAINER_MODE]: New var.
	(retired): New variable.
	(install-data-hook): Add check/cleanup for $(retired) files.

2008-07-15  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Move C code into src/.

	* bcruft.h: Move from parent dir.
	* fcruft.h: Likewise.
	* modsup.h.snap: Likewise.
	* tmpfile.h: Likewise.
	* tmpfile.c: Likewise.
	* libpq.c: New file, from integrating ../libpostgres.h,
	../libpostgres.c and ../libpostgres_lo.c.
	* Makefile.am: New file.


Copyright (C) 2010, 2011 Thien-Thi Nguyen

Copying and distribution of this file, with or without modification,
are permitted provided the copyright notice and this notice are preserved.
