Commit Graph

323 Commits

Author SHA1 Message Date
Tom Lane d330f1554d Clean up libpq's pollution of application namespace by renaming the
exported routines of ip.c, md5.c, and fe-auth.c to begin with 'pg_'.
Also get rid of the vestigial fe_setauthsvc/fe_getauthsvc routines
altogether.
2005-10-17 16:24:20 +00:00
Bruce Momjian 1dc3498251 Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
Peter Eisentraut 7fe1f9a2c2 Don't need gettext calls around debug messages. 2005-09-26 17:49:09 +00:00
Bruce Momjian 43bf3a6bc6 The attached patch updates the thread test program to run stand-alone on
Windows. The test itself is bypassed in configure as discussed, and
libpq has been updated appropriately to allow it to build in thread-safe
mode.

Dave Page
2005-08-23 21:02:05 +00:00
Bruce Momjian a970a8cb95 Back out incorrect commit. 2005-08-23 20:48:47 +00:00
Bruce Momjian eef7e30cc1 Fix function name. 2005-08-23 20:45:11 +00:00
Tom Lane 8e9c52e427 EINTR return from connect() should be treated exactly the same as
EINPROGRESS, according to Florian Hars.  I'm not completely convinced
but the spec does seem to read that way.
2005-08-11 22:53:41 +00:00
Bruce Momjian d359facb05 Remove unintended file change. 2005-08-09 05:14:26 +00:00
Bruce Momjian 487b757b7a Clarify wal_sync_method options in documentation. 2005-08-09 04:50:44 +00:00
Tom Lane faea3db958 Fix libpq memory leak during PQreset() --- closePGconn() was not
freeing all transient state of the PGconn object.
2005-07-13 15:25:55 +00:00
Neil Conway a159ad3048 Remove support for Kerberos V4. It seems no one is using this, it has
some security issues, and upstream has declared it "dead". Patch from
Magnus Hagander, minor editorialization from Neil Conway.
2005-06-27 02:04:26 +00:00
Bruce Momjian 624789d191 Cleanup for Win32 compile.
Andreas Pflug
2005-06-19 13:10:56 +00:00
Neil Conway 294505e2b1 This patch removes some old code from libpq that implements a URI-like
syntax for database connection parameters. It has been inside an
#ifdef NOT_USED block since 2001 or so and is marked as "broken", so
I don't think it is likely to be rehabilitated any time soon.
2005-06-12 00:07:07 +00:00
Neil Conway 72a5db15d1 libpq was not consistently checking for memory allocation failures. This
patch adds missing checks to the call sites of malloc(), strdup(),
PQmakeEmptyPGresult(), pqResultAlloc(), and pqResultStrdup(), and updates
the documentation. Per original report from Volkan Yazici about
PQmakeEmptyPGresult() not checking for malloc() failure.
2005-06-12 00:00:21 +00:00
Bruce Momjian c1e4869467 Remove unneeded variable test, per Tom. 2005-06-10 04:01:36 +00:00
Bruce Momjian 453d74b99c Add the "PGPASSFILE" environment variable to specify to the password
file.

Andrew Dunstan
2005-06-10 03:02:30 +00:00
Bruce Momjian 72c53ac3a7 Allow kerberos name and username case sensitivity to be specified from
postgresql.conf.

---------------------------------------------------------------------------


Here's an updated version of the patch, with the following changes:

1) No longer uses "service name" as "application version". It's instead
hardcoded as "postgres". It could be argued that this part should be
backpatched to 8.0, but it doesn't make a big difference until you can
start changing it with GUC / connection parameters. This change only
affects kerberos 5, not 4.

2) Now downcases kerberos usernames when the client is running on win32.

3) Adds guc option for "krb_caseins_users" to make the server ignore
case mismatch which is required by some KDCs such as Active Directory.
Off by default, per discussion with Tom. This change only affects
kerberos 5, not 4.

4) Updated so it doesn't conflict with the rendevouz/bonjour patch
already in ;-)

Magnus Hagander
2005-06-04 20:42:43 +00:00
Bruce Momjian bd9b2fa84b Add comments on WSAStartup usage. 2005-05-05 16:40:42 +00:00
Bruce Momjian 3731a400b4 Add WSACleanup() for Win32 socket cleanup.
Jason Erickson
2005-05-05 16:36:12 +00:00
Tom Lane e6befdc9d1 Kerberos fixes from Magnus Hagander --- in theory Kerberos 5 auth
should work on Windows now.  Also, rename set_noblock to pg_set_noblock;
since it is included in libpq, the former name polluted application
namespace.
2005-03-25 00:34:31 +00:00
Bruce Momjian 0542b1e2fe Use _() macro consistently rather than gettext(). Add translation
macros around strings that were missing them.
2005-02-22 04:43:23 +00:00
Tom Lane 889f038129 Use SHGetFolderPath instead of SHGetSpecialFolderPath to find the
APPDATA directory on Windows.  Magnus Hagander
2005-01-26 19:24:03 +00:00
Bruce Momjian 29e58330a6 Change Win32 client configuration files from *.txt to *.conf. 2005-01-14 00:25:56 +00:00
Tom Lane 8e4f4078d8 Un-break MSVC build, per Andrew Dunstan. 2005-01-10 00:19:51 +00:00
Tom Lane bbeeea1437 Minor mop-up for Windows home-directory stuff, per Magnus. 2005-01-06 21:41:45 +00:00
Tom Lane 4717992b4e Instead of a bare recv() to read the server's response to an SSL
request packet, use pqReadData().  This has the same effect since
conn->ssl isn't set yet and we aren't expecting more than one byte.
The advantage is that we will correctly detect loss-of-connection
instead of going into an infinite loop.  Per report from Hannu Krosing.
2005-01-06 20:06:58 +00:00
Tom Lane a3f98d5795 Adjust lookup of client-side profile files (.pgpass and so on) as per
discussion on pgsql-hackers-win32 list.  Documentation still needs to
be tweaked --- I'm not sure how to refer to the APPDATA folder in
user documentation.
2005-01-06 18:29:11 +00:00
Tom Lane d97ae8230e Make the various places that determine the user's "home directory"
consistent.  On Unix we now always consult getpwuid(); $HOME isn't used
at all.  On Windows the code currently consults $USERPROFILE, or $HOME
if that's not defined, but I expect this will change as soon as the win32
hackers come to a consensus.  Nothing done yet about changing the file
names used underneath $USERPROFILE.
2005-01-06 01:00:12 +00:00
Tom Lane edf3832b5c Clean up code in libpq that obtains user's home directory: make a single
subroutine that can hide platform dependencies.  The WIN32 path is still
a stub, but I await a fix from one of the win32 hackers.
Also clean up unnecessary #ifdef WIN32 ugliness in a couple of places.
2005-01-04 23:18:25 +00:00
PostgreSQL Daemon 2ff501590b Tag appropriate files for rc3
Also performed an initial run through of upgrading our Copyright date to
extend to 2005 ... first run here was very simple ... change everything
where: grep 1996-2004 && the word 'Copyright' ... scanned through the
generated list with 'less' first, and after, to make sure that I only
picked up the right entries ...
2004-12-31 22:04:05 +00:00
Tom Lane d9236a69fc Make libpq default to localhost connections on machines without Unix-domain
sockets, rather than failing as it formerly did.  Revert the
thereby-obsoleted patch to make psql supply the localhost default.
2004-12-28 23:17:54 +00:00
Tom Lane 5d7a555d0f Code review for recent libpq changes. Be more careful about error
handling in SIGPIPE processing; avoid unnecessary pollution of application
link-symbol namespace; spell 'pointer to function' in the conventional
way.
2004-12-02 23:20:21 +00:00
Bruce Momjian 8408f65252 Rework libpq threaded SIGPIPE handling to avoid interference with
calling applications.  This is done by blocking sigpipe in the libpq
thread and using sigpending/sigwait to possibily discard any sigpipe we
generated.
2004-12-02 15:32:54 +00:00
Bruce Momjian ee9007a2e1 Allow libpq to build on MS Visual Studio .NET 2003 on Windows XP. 2004-12-01 23:42:26 +00:00
Tom Lane 44e8a968e3 Invent a new, more thread-safe version of PQrequestCancel, called PQcancel.
Use this new function in psql.  Implement query cancellation in psql for
Windows.  Code by Magnus Hagander, documentation and minor editorialization
by Tom Lane.
2004-10-30 23:11:27 +00:00
Bruce Momjian 4eb1165ff3 No need to set errorMessage length --- already set in goto target. 2004-10-29 19:30:02 +00:00
Bruce Momjian 08510856a4 Set errorMessage length in PQrequestCancel() in all places. 2004-10-29 17:53:13 +00:00
Tom Lane 7627b91cd5 Set the close-on-exec flag for libpq's socket to the backend, to avoid
any possible problems from child programs executed by the client app.
Per suggestion from Elliot Lee of Red Hat.
2004-10-21 20:23:19 +00:00
Tom Lane cc6a90e4af Remove dllist.c from libpq. It's overkill for what libpq needs; we can
just stick a list-link into struct PGnotify instead.  Result is a smaller
faster and more robust library (mainly because we reduce the number of
malloc's and free's involved in notify processing), plus less pollution
of application link-symbol namespace.
2004-10-16 22:52:55 +00:00
Bruce Momjian b6b71b85bc Pgindent run for 8.0. 2004-08-29 05:07:03 +00:00
Bruce Momjian da9a8649d8 Update copyright to 2004. 2004-08-29 04:13:13 +00:00
Bruce Momjian 84f878f5cd Don't use get_home_path so libpq doesn't pull path.c into the library. 2004-08-19 00:00:34 +00:00
Bruce Momjian 1abf13db3c Add get_home_path() to use USERPROFILE on Win32 and HOME on Unix. 2004-08-18 02:59:12 +00:00
Tom Lane 109d7aff73 Fix linking problem when enabling thread safety on Darwin: uninitialized
global variables are problematic on this platform.  Simplest solution
seems to be to initialize pthread key variable to 0.  Also, rename this
variable and check_sigpipe_handler to something involving "pq" to
avoid gratuitous pollution of application namespace.
2004-08-17 04:24:23 +00:00
Tom Lane f79fbb2bec Add PQserverVersion() to libpq to provide more-convenient access to
the server version number.  This commit also removes bogus DOS line
endings from libpqddll.def.

Greg Sabino Mullane
2004-08-11 18:06:01 +00:00
Bruce Momjian f4c5e06edf > win32 doesn't support a static initializer for mutexes, thus the first
> user must initialize the lock. The problem are concurrent "first" users
> - the pthread_mutex_t initialization must be synchronized.
> The current implementation is broken, the attached patches fixes that:
> mutex_initlock is a spinlock. If the pthread_mutex_t mutex is not
> initialized, then the spinlock is acquired, if the pthread_mutex_t is
> initialized if it's not yet initialized and then the spinlock is dropped.

Manfred Spraul
2004-07-12 14:23:28 +00:00
Bruce Momjian a29d26a3cd Back out thread fix until I get clarification. 2004-07-12 14:16:28 +00:00
Bruce Momjian a41463e31c win32 doesn't support a static initializer for mutexes, thus the first
user must initialize the lock. The problem are concurrent "first" users
- the pthread_mutex_t initialization must be synchronized.
The current implementation is broken, the attached patches fixes that:
mutex_initlock is a spinlock. If the pthread_mutex_t mutex is not
initialized, then the spinlock is acquired, if the pthread_mutex_t is
initialized if it's not yet initialized and then the spinlock is
dropped.

Manfred Spraul
2004-07-12 14:11:17 +00:00
Bruce Momjian af70d57825 Enable thread safety for win32.mak build of PostgreSQL.
Andreas Pflug
2004-06-19 04:22:17 +00:00
Bruce Momjian 6cc4175b25 Attached is a patch that takes care of the PATHSEP issue. I made a more
extensive change then what was suggested. I found the file path.c that
contained a lot of "Unix/Windows" agnostic functions so I added a function
there instead and removed the PATHSEP declaration in exec.c altogether. All
to keep things from scattering all over the code.

I also took the liberty of changing the name of the functions
"first_path_sep" and "last_path_sep". Where I come from (and I'm apparently
not alone given the former macro name PATHSEP), they should be called
"first_dir_sep" and "last_dir_sep". The new function I introduced, that
actually finds path separators, is now the "first_path_sep". The patch
contains changes on all affected places of course.

I also changed the documentation on dynamic_library_path to reflect the
chagnes.

Thomas Hallgren
2004-06-10 22:26:24 +00:00