Commit Graph

13816 Commits

Author SHA1 Message Date
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 1e6457dfce Fix timestamptz_age() to do calculation in local timezone not GMT, per bug 1332. 2004-12-01 19:57:49 +00:00
Tom Lane 5374d097de Change planner to use the current true disk file size as its estimate of
a relation's number of blocks, rather than the possibly-obsolete value
in pg_class.relpages.  Scale the value in pg_class.reltuples correspondingly
to arrive at a hopefully more accurate number of rows.  When pg_class
contains 0/0, estimate a tuple width from the column datatypes and divide
that into current file size to estimate number of rows.  This improved
methodology allows us to jettison the ancient hacks that put bogus default
values into pg_class when a table is first created.  Also, per a suggestion
from Simon, make VACUUM (but not VACUUM FULL or ANALYZE) adjust the value
it puts into pg_class.reltuples to try to represent the mean tuple density
instead of the minimal density that actually prevails just after VACUUM.
These changes alter the plans selected for certain regression tests, so
update the expected files accordingly.  (I removed join_1.out because
it's not clear if it still applies; we can add back any variant versions
as they are shown to be needed.)
2004-12-01 19:00:56 +00:00
Bruce Momjian a6c1377085 Add \n to end of output for psql \s with no history file name.
This prevents the next psql prompt from showing up on the end of the
last history line.
2004-11-30 20:00:34 +00:00
Bruce Momjian f44c64c727 Quote SHELL arguments only on Win32. 2004-11-30 19:01:28 +00:00
Neil Conway 16c46870b7 Fix a few typos in comments. 2004-11-30 03:50:29 +00:00
Tom Lane af434fcdf4 Update plperl to use ereport() not elog() for user-facing messages,
so that they will be translatable.  Give messages some semblance of
conformance to the style guide.
2004-11-29 20:11:06 +00:00
Tom Lane 66cd815063 Clean up initdb's error handling so that it prints something more
useful than just \'failed\' when there's a problem.  Per gripe from
Chris Albertson.

In an unrelated change, use VACUUM FULL; VACUUM FREEZE; rather than
a single VACUUM FULL FREEZE command, to respond to my worries of a
couple days ago about the reliability of doing this in one go.
2004-11-29 03:05:03 +00:00
Bruce Momjian 5548122829 Add comment explaining possible compiler warning:
/*
     *  Some compilers with throw a warning knowing this test can never be
     *  true because off_t can't exceed the compared maximum.
     */
    if (th->fileLen > MAX_TAR_MEMBER_FILELEN)
        die_horribly(AH, modulename, "archive member too large for tar format\n");
2004-11-29 03:01:54 +00:00
Bruce Momjian ee814b4511 Have initdb display relative paths to start postmaster if used to invoke
initdb, and display in a path-native way.
2004-11-29 01:14:45 +00:00
Tom Lane 839484f9f5 Avoid scribbling on original parsetree during DECLARE CURSOR. This
prevents problems when the DECLARE is in a portal and is executed
repeatedly, as is possible in v3 protocol.  Per analysis by Oliver
Jowett, though I didn't use his patch exactly.
2004-11-28 22:16:31 +00:00
Peter Eisentraut 99b735cc03 Work around lack of NLS support in libpgport by making those components
who use it scan the relevant source files for their own catalog.  It
creates a bit of duplicate work for translators, but it gets the job done
for now.
2004-11-27 22:44:15 +00:00
Peter Eisentraut 49cbef7947 Update of conformance information to SQL:2003
by Troels Arvin, Simon Riggs, Elein Mustain

Make spelling of SQL standard names uniform.
2004-11-27 21:27:08 +00:00
Tom Lane 90c3ebe4d7 Fix HAVE_OPTRESET to be HAVE_INT_OPTRESET. Typos spotted by Lorne Sunley. 2004-11-27 18:51:08 +00:00
Bruce Momjian 3aa9776d95 Add to CPPFLAGS/CFLAGS in template files, don't over-ride them. 2004-11-27 05:03:26 +00:00
Tom Lane c2e5631760 RelOptInfo.pages should really be declared as BlockNumber, not long. 2004-11-26 21:08:35 +00:00
Tom Lane d4c4d28427 Install Tcl regex fixes to sync our regex engine with Tcl 8.4.8 (up from
8.4.1).  This corrects some curious regex bugs, though not the greediness
issue I was hoping to find a solution for :-(
2004-11-24 22:56:54 +00:00
Tom Lane 236404fcd1 Our interface code for Spencer's regexp package was checking for regexp
error conditions during regexp compile, but not during regexp execution;
any sort of "can't happen" errors would be treated as no-match instead
of being reported as they should be.  Noticed while trying to duplicate
a reported Tcl bug.
2004-11-24 22:44:07 +00:00
Tom Lane cf796cc702 A client_encoding specification coming from the connection request has
to be processed by GUC before InitPostgres, because any required lookup
of the encoding conversion function has to be done during InitializeClientEncoding.
So, I broke this last week by moving GUC processing to after InitPostgres :-(.
What we can do as a compromise is process non-SUSET variables during
command line scanning (the same as before), and postpone the processing
of only SUSET variables.  None of the SUSET variables need to be set
before InitPostgres.
2004-11-24 19:51:05 +00:00
Tom Lane 5597fee8d7 Avoid getting bit by roundoff error while checking $Safe::VERSION.
Per report from Mark Kirkwood.
2004-11-24 18:47:38 +00:00
Neil Conway e17766c12e Trivial fix for a bug introduced in r1.94 of help.c: we want to only
include "\s" in \? output when readline is enabled, but that commit
supressed "\s" whether readline was enabled or not.
2004-11-24 04:58:42 +00:00
Neil Conway 4acc97d7e4 Assert that BufferIsPinned() in IncrBufferRefCount(), rather than using
a home-brewed combination of assertions that boiled down to the same
thing.
2004-11-24 02:56:17 +00:00
Peter Eisentraut 2663e0c2e9 New translations 2004-11-23 23:13:26 +00:00
Peter Eisentraut 98f5efe774 Translation updates 2004-11-23 22:16:04 +00:00
Tom Lane 28e9b26f4d Further plperl cleanup: be more paranoid about checking the type of
data returned from Perl.  Consolidate multiple bits of code to convert
a Perl hash to a tuple, and drive the conversion off the keys present
in the hash rather than the tuple column names, so we detect error if
the hash contains keys it shouldn't.  (This means keys not in the hash
will silently default to NULL, which seems ok to me.)  Fix a bunch of
reference-count leaks too.
2004-11-23 00:21:24 +00:00
Tom Lane 25fcfdf6f4 The beginnings of a regression test for plperl. Right now it only
covers return value processing, but that was the most broken stuff...
2004-11-22 20:32:59 +00:00
Tom Lane f5206262c8 Try to instill some sanity in plperl's function result processing.
Get rid of static variables for SETOF result, don't crash when called
from non-FROM context, eliminate dead code, etc.
2004-11-22 20:31:53 +00:00
Tom Lane 294c34bb9d Fix rounding problem in dynahash.c's decision about when the target
fill factor has been exceeded.  We usually run with ffactor == 1, but
the way the test was coded, it wouldn't split a bucket until the actual
fill factor reached 2.0, because of use of integer division.  Change
from > to >= so that it will split more aggressively when the table
starts to get full.
2004-11-21 22:57:00 +00:00
Tom Lane 7f1711f29d Reduce the default size of the PortalHashTable in order to save a
few cycles during transaction exit.  A typical session probably
wouldn't have as many as half a dozen portals open at once, so the
original value of 64 seems far larger than needed.
2004-11-21 22:48:01 +00:00
Tom Lane 183e8b911c While fixing plperl and pltcl, I realized plpgsql wasn't doing
subtransactions quite right either: the ReleaseCurrentSubTransaction
call should occur inside the PG_TRY, so that the proper path is taken
if an error occurs during subtransaction commit.  This assumes that
AbortSubTransaction can cope with the state left behind if
CommitSubTransaction fails partway through, but we were already
requiring that.
2004-11-21 22:27:34 +00:00
Tom Lane 32c97fd58f Suppress remaining compile warnings, and add a comment about why
it's not really broken.  Andrew Dunstan
2004-11-21 22:13:37 +00:00
Tom Lane 35f4994133 Fix plperl and pltcl error handling per my previous proposal. SPI
operations are now run as subtransactions, so that errors in them
can be reported as ordinary Perl or Tcl errors and caught by the
normal error handling convention of those languages.  Also do some
minor code cleanup in pltcl.c: extract a large chunk of duplicated
code in pltcl_SPI_execute and pltcl_SPI_execute_plan into a shared
subroutine.
2004-11-21 21:17:07 +00:00
Tom Lane c584103f56 Patch of 2004-03-30 corrected date_part(timestamp) for extracting
the year from a BC date, but failed to make the same fix in
date_part(timestamptz).
2004-11-20 22:12:44 +00:00
Tom Lane a34d76ef65 Fix up makefile dependencies for pg_config_paths.h. 2004-11-20 21:13:06 +00:00
Tom Lane 3e3f283e31 Avoid scanning the relcache during AtEOSubXact_RelationCache when there
is nothing to do, which is most of the time.  This is another simple
improvement to cut subtransaction entry/exit overhead.
2004-11-20 20:19:52 +00:00
Tom Lane 8ecbc46bdb Reduce the default size of the local lock hash table. There's usually
no need for it to be nearly as big as the global hash table, and since
it's not in shared memory it can grow if it does need to be bigger.
By reducing the size, we speed up hash_seq_search(), which saves a
significant fraction of subtransaction entry/exit overhead.
2004-11-20 20:16:54 +00:00
Tom Lane 193a97c2d3 Fix plperl's elog() function to convert elog(ERROR) into Perl croak(),
rather than longjmp'ing clear out of Perl and thereby leaving Perl in
a broken state.  Also some minor prettification of error messages.
Still need to do something with spi_exec_query() error handling.
2004-11-20 19:07:40 +00:00
Tom Lane d5013ab50f Fix one more place where we were expecting lcons() to be nondestructive
to the original List; per report from Sebastian BÎck.  I think this is
the last such bug --- I examined every lcons() call in the backend and
the rest seem OK --- but it's nervous-making that we're still finding
'em so many months after the List rewrite went in.
2004-11-20 17:59:31 +00:00
Tom Lane 0b5c72d9ba On some HPUX versions/hardware, it seems we need to include libgcc.a in
the regression test shared libraries.
2004-11-20 03:52:00 +00:00
Tom Lane 83fea34b5b Fix unportable isdigit() call --- must cast arg to unsigned char. 2004-11-20 02:09:47 +00:00
Tom Lane 8a7025f0bb Move pgstat_report_tabstat() call so that stats are not reported to the
collector until the transaction commits.  Per recent discussion, this
should avoid confusing autovacuum when an updating transaction runs for
a long time.
2004-11-20 00:48:58 +00:00
Tom Lane e719591ea3 Make sure we produce a useful error message for the case where the
postgresql.crt file simply isn't there, too.
2004-11-20 00:35:13 +00:00
Tom Lane 7506677b62 Improve error reporting for SSL connection failures. Remove redundant
free operations in client_cert_cb --- openssl will also attempt to free
these structures, resulting in core dumps.
2004-11-20 00:18:18 +00:00
Tom Lane 8e57975219 Clean up rpath handling for HPUX --- we can't use the cc-style rpath
switch syntax when calling ld directly.
2004-11-19 21:27:42 +00:00
Tom Lane 466fb06739 Set rpath for plperl and plpython to ensure we can find the .so files
for the languages even when not installed in a standard directory.
pltcl may need this treatment as well, but we don't have the right path
conveniently available, so I'll leave it alone as long as there aren't
actual reports of trouble.
2004-11-19 19:23:01 +00:00
Tom Lane a9ddd649df Modify the platform-specific makefiles so that macro 'rpath' is defined
in terms of macro 'rpathdir', as I proposed a few weeks ago.  In itself
this commit shouldn't change the behavior at all, but it opens the door
to using special rpaths for the PL shared libraries, as seems to be
needed for plperl in particular.
2004-11-19 00:41:39 +00:00
Tom Lane b6038484f8 Fix memory clobber problem reported by John Hansen: plperl_safe_init()
may expand the Perl stack, therefore we must SPAGAIN to reload the local
stack pointer after calling it.  Also a couple other marginal readability
improvements.
2004-11-18 21:35:42 +00:00
Tom Lane da1c19aa57 Whoops, missed converting the other sleep() call to pg_usleep(). 2004-11-18 17:13:38 +00:00
Peter Eisentraut 050a0074c2 Translation update 2004-11-18 10:09:59 +00:00
Tom Lane b2a2f4cef7 Force pg_database updates out to disk immediately after ALTER DATABASE;
this is to avoid scenarios where incoming backends find no live copies
of a database's row because the only live copy is in an as-yet-unwritten
shared buffer, which they can't see.  Also, use FlushRelationBuffers()
for forcing out pg_database, instead of the much more expensive BufferSync().
There's no need to write out pages belonging to other relations.
2004-11-18 01:14:26 +00:00