Commit Graph

13631 Commits

Author SHA1 Message Date
Tom Lane 9e83d73b6c Add a GUC_SUPERUSER_ONLY flag to mark GUC variables that should not be
examinable by non-superusers, and use it to protect the recently-added
GUC variables for data directory and config files.  For now I have only
flagged those variables that could be used to deduce something about
the server's filesystem layout, but possibly we should also mark vars
related to logging settings and other admin-only information?
2004-10-22 19:48:19 +00:00
Tom Lane 9309d5f2ba In ALTER COLUMN TYPE, strip any implicit coercion operations appearing
at the top level of the column's old default expression before adding
an implicit coercion to the new column type.  This seems to satisfy the
principle of least surprise, as per discussion of bug #1290.
2004-10-22 17:20:05 +00:00
Peter Eisentraut 4733dcc592 Translation updates 2004-10-22 16:05:02 +00:00
Peter Eisentraut 77c0204a37 Message styling 2004-10-22 16:04:35 +00:00
Dennis Bjorklund c70b7b7a6c Translation update 2004-10-22 14:14:24 +00:00
Dennis Bjorklund f4eb440279 New swedish translation of pg_config 2004-10-22 14:13:04 +00:00
Dennis Bjorklund 26149e9738 Translation updates 2004-10-22 13:49:15 +00:00
Dennis Bjorklund cae2018b49 Translation updates 2004-10-22 13:41:47 +00:00
Dennis Bjorklund 7e62f0578a Translation updates. 2004-10-22 12:04:13 +00:00
Neil Conway 121aca39ba Minor code cleanup: hdefault() only ever returned "true", so it may as
well be declared to return "void" to save callers the trouble of
checking for errors.
2004-10-22 07:21:06 +00:00
Tom Lane c58675b428 Prevent pg_ctl from being run as root. Since it uses configuration files
owned by postgres, doing "pg_ctl start" as root could allow a privilege
escalation attack, as pointed out by iDEFENSE.  Of course the postmaster would
fail, but we ought to fail a little sooner to protect sysadmins unfamiliar
with Postgres.  The chosen fix is to disable root use of pg_ctl in all cases,
just to be confident there are no other holes.
2004-10-22 00:24:18 +00:00
Tom Lane 12a47c6aca Disallow referential integrity actions from being deferred; only the
NO ACTION check is deferrable.  This seems to be a closer approximation
to what the SQL spec says than what we were doing before, and it prevents
some anomalous behaviors that are possible now that triggers can fire
during the execution of PL functions.
Stephan Szabo.
2004-10-21 21:33:59 +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 380bd04c16 Standardize on using the Min, Max, and Abs macros that are in our c.h file,
getting rid of numerous ad-hoc versions that have popped up in various
places.  Shortens code and avoids conflict with Windows min() and max()
macros.
2004-10-21 19:28:36 +00:00
Tom Lane fb22b32095 Allow functions returning void or cstring to appear in FROM clause,
to make life cushy for the JDBC driver.  Centralize the decision-making
that affects this by inventing a get_type_func_class() function, rather
than adding special cases in half a dozen places.
2004-10-20 16:04:50 +00:00
Neil Conway 857e210ea9 When using GCC, change the default CFLAGS to:
-O2 -Wall -Wmissing-prototypes -Wpointer-arith

Check whether the version of GCC we are using supports any of:

  -Wdeclaration-after-statement
  -Wendif-labels
  -Wold-style-definition

And add the supported flags to CFLAGS.
2004-10-20 02:12:07 +00:00
Tom Lane a1bc728cf9 Add a HINT about the likely reason for 'invalid multibyte character for locale' failure. 2004-10-19 15:04:17 +00:00
Peter Eisentraut 3371b99e65 New translation 2004-10-19 13:39:27 +00:00
Peter Eisentraut 9f2d5df3b9 Organize the help output a little better. Improve clarity of some messages. 2004-10-19 13:38:53 +00:00
Tom Lane c77d06633a Add some code to ensure that we don't lose communication sync due to
an oversize message, per suggestion from Oliver Jowett.  I'm a bit
dubious that this is a real problem, since the client likely doesn't
have any more space available than the server, but it's not hard to
make it behave according to the protocol intention.
2004-10-18 23:23:19 +00:00
Peter Eisentraut 6e53f18b84 New translation 2004-10-18 22:19:15 +00:00
Peter Eisentraut 2aa8d0a807 Might want to initialize the gettext library, if we're going to do all that
translation work.
2004-10-18 22:19:00 +00:00
Peter Eisentraut a465f24a1e Translation update 2004-10-18 22:18:03 +00:00
Tom Lane 9d9cfb1ad7 Add PQprepare/PQsendPrepared functions to libpq to support preparing
statements without necessarily specifying the datatypes of their parameters.
Abhijit Menon-Sen with some help from Tom Lane.
2004-10-18 22:00:42 +00:00
Bruce Momjian b3fe6bcafe Remove use of "miscadmin.h" in port C files and remove test for frontend
in miscadmin.h.
2004-10-18 19:08:58 +00:00
Peter Eisentraut cd8db9532b New translation 2004-10-18 17:58:54 +00:00
Peter Eisentraut d5213d94b9 Translation updates 2004-10-18 17:56:46 +00:00
Peter Eisentraut 68970b3e61 New translation 2004-10-18 17:53:40 +00:00
Bruce Momjian 0060b3c8eb The attached patch fixes psql's win32 frontend-only build, by using
pg_strcasecmp in variables.c, and #ifdef'ing out PostmasterPid in
miscadmin.h.

Dave Page
2004-10-18 16:24:40 +00:00
Michael Meskes 51aacecae6 Synced parser 2004-10-18 13:36:23 +00:00
Neil Conway 301d6e419c Trivial fix: remove a pointless cast. 2004-10-18 01:45:38 +00:00
Tom Lane 877179245d Tweak pg_dump to handle default tablespaces correctly --- same logic
as the corrected pg_get_indexdef code.
2004-10-18 00:20:41 +00:00
Bruce Momjian edb1ba113d Better document win32_open and its ability to allow concurrent
unlink/rename().
2004-10-17 23:53:30 +00:00
Bruce Momjian 1311667b5c Fix some typos. 2004-10-17 23:39:22 +00:00
Tom Lane 4347cc2392 Allow background writing to be shut down by setting limit values to zero.
This does not disable the bgwriter process: it still has to wake up often
enough to collect fsync requests from backends in a timely fashion.  But
it responds to the recent gripe about not being able to prevent the disk
from being spun up constantly.
2004-10-17 22:01:51 +00:00
Tom Lane bdbe9c9f06 pg_get_indexdef() didn't do quite the right thing with identifying
an index's tablespace.
2004-10-17 21:17:27 +00:00
Peter Eisentraut ca14e3bc01 New translation 2004-10-17 21:12:55 +00:00
Peter Eisentraut 8de2e16f1f New translation 2004-10-17 21:10:25 +00:00
Peter Eisentraut 2ae65595cc Translation update 2004-10-17 21:08:22 +00:00
Peter Eisentraut 2f2121ffbe Translation updates 2004-10-17 21:05:03 +00:00
Peter Eisentraut 63d4f1cdbf Adjust message 2004-10-17 21:04:41 +00:00
Tom Lane 830c168e5c Give a more user-friendly error message in situation where CREATE DATABASE
specifies a new default tablespace and the template database already has
some tables in that tablespace.  There isn't any way to solve this fully
without modifying the clone database's pg_class contents, so for now the
best we can do is issue a better error message.
2004-10-17 20:47:21 +00:00
Tom Lane fae7ce83fe Make locale_messages_assign() really work on Windows; the prior hack
only covered the case of assigning "", and failed to recognize that
actually setlocale(LC_MESSAGES,...) does not work at all on this platform.
Magnus Hagander, some code prettification by Tom Lane.
2004-10-17 20:02:26 +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
Tom Lane dc19aaa12f Give a more user-friendly error message in case where a table is created
in a schema whose default tablespace has been dropped.
2004-10-16 21:16:36 +00:00
Tom Lane 2a63c1602d Generate the various .def files for libpq DLLs from a single list of
exportable functions.  The .def files are removed from CVS, but will
still be present in distribution tarballs, since we can't assume that
Windows boxes will have sed.
2004-10-16 20:10:57 +00:00
Tom Lane f68d05d5ec Limit NBuffers and some related values to INT_MAX / BLCKSZ, to prevent
arithmetic overflow during initial sizing calculations.  This is not
water-tight but it should avoid the grossest sorts of failures.
2004-10-16 19:08:38 +00:00
Tom Lane fdd13f1568 Give the ResourceOwner mechanism full responsibility for releasing buffer
pins at end of transaction, and reduce AtEOXact_Buffers to an Assert
cross-check that this was done correctly.  When not USE_ASSERT_CHECKING,
AtEOXact_Buffers is a complete no-op.  This gets rid of an O(NBuffers)
bottleneck during transaction commit/abort, which recent testing has shown
becomes significant above a few tens of thousands of shared buffers.
2004-10-16 18:57:26 +00:00
Tom Lane 1c2de47746 Remove BufferLocks[] array in favor of a single pointer to the buffer
(if any) currently waited for by LockBufferForCleanup(), which is all
that we were using it for anymore.  Saves some space and eliminates
proportional-to-NBuffers slowdown in UnlockBuffers().
2004-10-16 18:05:07 +00:00
Bruce Momjian 72f9013741 Fix Cygwin using of pg_ctl by not usig START.
Reini Urban
2004-10-16 03:32:08 +00:00