Commit Graph

19959 Commits

Author SHA1 Message Date
Bruce Momjian 8269ad4ffe Force PG client applications to link to non-shared libpgport before
linking to libpq.  This insulates applications from changes in libpq's
usage of libpgport functions.

Backpatched to 8.0.X.
2005-03-24 19:33:32 +00:00
Tom Lane 208ec47ba3 Tweak planner to use a minimum size estimate of 10 pages for a
never-yet-vacuumed relation.  This restores the pre-8.0 behavior of
avoiding seqscans during initial data loading, while still allowing
reasonable optimization after a table has been vacuumed.  Several
regression test cases revert to 7.4-like behavior, which is probably
a good sign.  Per gripes from Keith Browne and others.
2005-03-24 19:14:49 +00:00
Bruce Momjian 7604267de8 Set socket timer to 58 instead of 60 minutes for hour-old cleaners:
* Touch the socket and lock file at least every hour, to
         * ensure that they are not removed by overzealous /tmp-cleaning
         * tasks.  Set to 58 minutes so a cleaner never sees the
         * file as an hour old.
2005-03-24 18:16:17 +00:00
Tom Lane 7e1c6f177e Fix python regression testing script to bail out early if language
creation fails ... no point in running the tests.
2005-03-24 17:23:34 +00:00
Tom Lane 00aa8ed47a Adjust plpython to convert \r\n and \r to \n in Python scripts,
per recent discussion concluding that this is the Right Thing.  Add
regression test check for this behavior.  Michael Fuhr
2005-03-24 17:22:34 +00:00
Bruce Momjian 218705958a Touch postmaster log file every hour, rather than every 10 minutes, to
prevent complaints from laptop users who don't like their hard drives
starting up every 10 minutes.
2005-03-24 05:19:05 +00:00
Bruce Momjian 2104f9af87 Add:
<
> * Add GUC to issue notice about queries that use unjoined tables
2005-03-24 05:15:59 +00:00
Bruce Momjian b1f57d88f5 Change Win32 O_SYNC method to O_DSYNC because that is what the method
currently does.  This is now the default Win32 wal sync method because
we perfer o_datasync to fsync.

Also, change Win32 fsync to a new wal sync method called
fsync_writethrough because that is the behavior of _commit, which is
what is used for fsync on Win32.

Backpatch to 8.0.X.
2005-03-24 04:36:20 +00:00
Bruce Momjian 0275b3f783 Update INTERVAL items. 2005-03-24 03:50:24 +00:00
Tom Lane 0ca91482fa Add missing error checking in readdir() loops. 2005-03-24 02:11:20 +00:00
Bruce Momjian c58071a5d1 Change ANSI to ISO standard:
< * Add ANSI INTERVAL handling
> * Add ISo INTERVAL handling
< 	o Interpret syntax that isn't uniquely ANSI or PG, like '1:30' or
< 	  '1' as ANSI syntax, e.g. interpret '1:30' MINUTE TO SECOND as
> 	o Interpret syntax that isn't uniquely ISO or PG, like '1:30' or
> 	  '1' as ISO syntax, e.g. interpret '1:30' MINUTE TO SECOND as
649c649
< * Add pre-parsing phase that converts non-ANSI syntax to supported
> * Add pre-parsing phase that converts non-ISO syntax to supported
2005-03-24 02:11:06 +00:00
Neil Conway 50ce8ab9fc Revert changes to CREATE TRIGGER and ALTER TABLE ADD FOREIGN KEY locking,
per request from Tom.
2005-03-24 00:03:26 +00:00
Bruce Momjian 8abba63859 Update wording:
< 	o Process mixed ANSI/PG syntax, and round value to requested
< 	  precision or generate an error
< 	o Interpret INTERVAL '1 year' MONTH as CAST (INTERVAL '1 year' AS
< 	  INTERVAL MONTH), and this should return '12 months'
194a191,194
> 	o Interpret INTERVAL '1 year' MONTH as CAST (INTERVAL '1 year' AS
> 	  INTERVAL MONTH), and this should return '12 months'
> 	o Round or truncate values to the requested precision, e.g.
> 	  INTERVAL '11 months' AS YEAR should return one or zero
2005-03-23 22:57:02 +00:00
Bruce Momjian d5dd9dbbfe Update item on ambiguous INTERVAL syntax:
< 	o Add support for day-time syntax, INTERVAL '1 2:03:04'
> 	o Add support for day-time syntax, INTERVAL '1 2:03:04'
192c192,194
< 	o Interpret INTERVAL '1:30' MINUTE TO SECOND as '1 minute 30 seconds'
> 	o Interpret syntax that isn't uniquely ANSI or PG, like '1:30' or
> 	  '1' as ANSI syntax, e.g. interpret '1:30' MINUTE TO SECOND as
> 	  '1 minute 30 seconds'
2005-03-23 21:49:52 +00:00
Bruce Momjian a15699b9e0 Update ANSI INTERVAL section:
< * Add support for ANSI time INTERVAL syntax, INTERVAL '1 2:03:04' DAY TO SECOND
< * Add support for ANSI date INTERVAL syntax, INTERVAL '20-6' YEAR TO MONTH
< * Process mixed ANSI/PG INTERVAL syntax, and round value to requested precision
<
<   Interpret INTERVAL '1 year' MONTH as CAST (INTERVAL '1 year' AS INTERVAL
<   MONTH), and this should return '12 months'
<
< * Interpret INTERVAL '1:30' MINUTE TO SECOND as '1 minute 30 seconds'
> * Add ANSI INTERVAL handling
> 	o Add support for day-time syntax, INTERVAL '1 2:03:04'
> 	  DAY TO SECOND
> 	o Add support for year-month syntax, INTERVAL '50-6' YEAR TO MONTH
> 	o Process mixed ANSI/PG syntax, and round value to requested
> 	  precision or generate an error
> 	o Interpret INTERVAL '1 year' MONTH as CAST (INTERVAL '1 year' AS
> 	  INTERVAL MONTH), and this should return '12 months'
> 	o Interpret INTERVAL '1:30' MINUTE TO SECOND as '1 minute 30 seconds'
> 	o Support precision, CREATE TABLE foo (a INTERVAL MONTH(3))
2005-03-23 21:10:02 +00:00
Tom Lane 87ba04eeaf Add note about risks involved in replaying CREATE TABLESPACE commands
from WAL.  A couple other grammatical improvements too.
2005-03-23 19:38:53 +00:00
Bruce Momjian d27061a3ab Update numbers in example:
< * Add support for ANSI date INTERVAL syntax, INTERVAL '9-3' YEAR TO MONTH
> * Add support for ANSI date INTERVAL syntax, INTERVAL '20-6' YEAR TO MONTH
2005-03-23 17:05:22 +00:00
Bruce Momjian 70d782e64c Update:
< * Add support for ANSI date INTERVAL syntax, INTERVAL '1-2' YEAR TO MONTH
> * Add support for ANSI date INTERVAL syntax, INTERVAL '9-3' YEAR TO MONTH
2005-03-23 16:38:55 +00:00
Neil Conway f30c76ce8d Adjust CREATE TRIGGER and ALTER TABLE ... ADD FOREIGN KEY to acquire
ExclusiveLock rather than AccessExclusiveLock. This will allow concurrent
SELECT queries to proceed on the table. Per discussion with Andrew at
SuperNews.
2005-03-23 07:44:57 +00:00
Bruce Momjian ac323044cf Add:
> 	o Add MOVE to PL/pgSQL
2005-03-23 06:11:57 +00:00
Bruce Momjian f6c1f990ab Assign:
> 	o Update pg_dump and psql to use the new COPY libpq API (Christopher)
2005-03-23 05:50:58 +00:00
Bruce Momjian 9be9c1fb0c Add:
>
> * Interpret INTERVAL '1:30' MINUTE TO SECOND as '1 minute 30 seconds'
2005-03-23 05:49:22 +00:00
Bruce Momjian 3113d38bec Add INTERVAL items:
> * Add support for ANSI time INTERVAL syntax, INTERVAL '1 2:03:04' DAY TO SECOND
> * Add support for ANSI date INTERVAL syntax, INTERVAL '1-2' YEAR TO MONTH
> * Process mixed ANSI/PG INTERVAL syntax, and round value to requested precision
184a188,189
>   Interpret INTERVAL '1 year' MONTH as CAST (INTERVAL '1 year' AS INTERVAL
>   MONTH), and this should return '12 months'
2005-03-23 05:42:40 +00:00
Bruce Momjian e96ab26277 Remove duplicate:
< * Allow a warm standby system to also allow read-only queries
2005-03-23 02:50:56 +00:00
Bruce Momjian b7c2258833 Add:
> * Allow WAL replay of CREATE TABLESPACE to work when the directory
>   structure on the recovery computer is different from the original
2005-03-23 02:49:42 +00:00
Bruce Momjian 0b2adc1e5f Add:
> 	o Update pg_dump and psql to use the new COPY libpq API
2005-03-23 02:41:29 +00:00
Bruce Momjian 09c165e41e Remove:
< 	o Update to use the newer COPY syntax
2005-03-23 02:21:01 +00:00
Bruce Momjian ee10720834 Add for pg_dump:
> 	o Update to use the newer COPY syntax
2005-03-23 02:14:11 +00:00
Bruce Momjian aab0159cfb Add:
>
> * Support table partitioning that allows a single table to be stored
>   in subtables that are partitioned based on the primary key or a WHERE
>   clause
2005-03-23 01:25:07 +00:00
Bruce Momjian 4201ba2459 Remove:
<
< 	o Prevent conflicting SET options from being set
<
< 	  This requires a checking function to be called after the server
< 	  configuration file is read.
2005-03-23 00:36:14 +00:00
Tom Lane cad86e253b WAL must log CREATE and DROP DATABASE operations *without* using any
explicit paths, so that the log can be replayed in a data directory
with a different absolute path than the original had.  To avoid forcing
initdb in the 8.0 branch, continue to accept the old WAL log record
types; they will never again be generated however, and the code can be
dropped after the next forced initdb.  Per report from Oleg Bartunov.
We still need to think about what it really means to WAL-log CREATE
TABLESPACE commands: we more or less have to put the absolute path
into those, but how to replay in a different context??
2005-03-23 00:03:37 +00:00
Tom Lane bd9b4a9d46 Use InitFunctionCallInfoData() macro instead of MemSet in performance
critical places in execQual.  By Atsushi Ogawa; some minor cleanup by moi.
2005-03-22 20:13:09 +00:00
Tom Lane 94e03330cb Create a routine PageIndexMultiDelete() that replaces a loop around
PageIndexTupleDelete() with a single pass of compactification ---
logic mostly lifted from PageRepairFragmentation.  I noticed while
profiling that a VACUUM that's cleaning up a whole lot of deleted
tuples would spend as much as a third of its CPU time in
PageIndexTupleDelete; not too surprising considering the loop method
was roughly O(N^2) in the number of tuples involved.
2005-03-22 06:17:03 +00:00
Tom Lane 775d28302c Fix quote_ident to use quote_identifier rather than its own, not quite
up-to-speed logic; in particular this will cause it to quote names that
match keywords.  Remove unnecessary multibyte cruft from quote_literal
(all backend-internal encodings are 8-bit-safe).
2005-03-21 16:29:20 +00:00
Neil Conway 6a8eb1a7b6 pgcrypto update:
* test error handling
* add tests for des, 3des, cast5
* add some tests to blowfish, rijndael
* Makefile: ability to specify different tests for different crypto
  libraries, so we can skip des, 3des and cast5 for builtin.

Marko Kreen
2005-03-21 05:24:52 +00:00
Neil Conway 19b676869a pgcrypto update:
Reserve px_get_random_bytes() for strong randomness,
add new function px_get_pseudo_random_bytes() for
weak randomness and use it in gen_salt().

On openssl case, use RAND_pseudo_bytes() for
px_get_pseudo_random_bytes().

Final result is that is user has not configured random
souce but kept the 'silly' one, gen_salt() keeps
working, but pgp_encrypt() will throw error.

Marko Kreen
2005-03-21 05:22:14 +00:00
Neil Conway 1ea9169b42 pgcrypto update:
* openssl.c: Add 3des and AES support
* README.pgcrypto: list only supported ciphers for openssl

OpenSSL has pre-processor symbol OPENSSL_NO_AES, which
isn't that helpful for detecting if it _does_ exist.
Thus the hack with AES_ENCRYPT.

Marko Kreen
2005-03-21 05:21:04 +00:00
Neil Conway b160d6b9dc pgcrypto update:
* Use error codes instead of -1
* px_strerror for new error codes
* calling convention change for px_gen_salt - return error code
* use px_strerror in pgcrypto.c

Marko Kreen
2005-03-21 05:19:55 +00:00
Neil Conway fa332a06ec * construct "struct {} list [] = {}" confuses pgindent - split those.
It was a bad style to begin with, and now several loops can be clearer.
* pgcrypto.c: Fix function comments
* crypt-gensalt.c, crypt-blowfish.c: stop messing with errno
* openssl.c: use px_free instead pfree
* px.h: make redefining px_alloc/px_realloc/px_free easier

Marko Kreen
2005-03-21 05:18:46 +00:00
Neil Conway 3cc8661232 Remove support for libmhash/libmcrypt.
libmcrypt seems to dead, maintainer address bounces,
and cast-128 fails on 2 of the 3 test vectors from RFC2144.

So I see no reason to keep around stuff I don't trust
anymore.

Support for several crypto libraries is probably only
confusing to users, although it was good for initial
developing - it helped to find hidden assumptions and
forced me to create regression tests for all functionality.

Marko Kreen
2005-03-21 05:17:16 +00:00
Tom Lane ee4ddac137 Convert index-related tuple handling routines from char 'n'/' ' to bool
convention for isnull flags.  Also, remove the useless InsertIndexResult
return struct from index AM aminsert calls --- there is no reason for
the caller to know where in the index the tuple was inserted, and we
were wasting a palloc cycle per insert to deliver this uninteresting
value (plus nontrivial complexity in some AMs).
I forced initdb because of the change in the signature of the aminsert
routines, even though nothing really looks at those pg_proc entries...
2005-03-21 01:24:04 +00:00
Neil Conway fe7015f5e8 Change the return value of HeapTupleSatisfiesUpdate() to be an enum,
rather than an integer, and fix the associated fallout. From Alvaro
Herrera.
2005-03-20 23:40:34 +00:00
Tom Lane 9e0dd84596 On Windows, use QueryPerformanceCounter instead of gettimeofday for
EXPLAIN ANALYZE instrumentation.  Magnus Hagander
2005-03-20 22:27:52 +00:00
Tom Lane 354049c709 Remove unnecessary calls of FlushRelationBuffers: there is no need
to write out data that we are about to tell the filesystem to drop.
smgr_internal_unlink already had a DropRelFileNodeBuffers call to
get rid of dead buffers without a write after it's no longer possible
to roll back the deleting transaction.  Adding a similar call in
smgrtruncate simplifies callers and makes the overall division of
labor clearer.  This patch removes the former behavior that VACUUM
would write all dirty buffers of a relation unconditionally.
2005-03-20 22:00:54 +00:00
Bruce Momjian 683f60da3d Add mention of why malloc() has to be used in snprintf.c. 2005-03-20 13:54:53 +00:00
Bruce Momjian 8c72526fe9 Department of second thoughts. Remove FRONTEND from snprintf.c because
snprintf is called before the memory system is started.  We have to just
malloc/free.  There are no elogs in the code so we should be fine.
2005-03-20 03:53:39 +00:00
Bruce Momjian 169adfcf74 Fix typo in Makefile. 2005-03-20 02:44:45 +00:00
Bruce Momjian 83ebbfac75 Another change for FRONTEND snprintf.c. 2005-03-20 02:40:28 +00:00
Bruce Momjian 614fcbeba7 Mark snprintf.c as a file that uses FRONTEND and needs to a version in
the server-side port library.  Somehow I missed that change when I added
memory allocation to snprintf.c.
2005-03-20 02:39:33 +00:00
Bruce Momjian 1c14db5a77 Done:
> * -Allow the size of the buffer cache used by temporary objects to be
2005-03-20 01:57:11 +00:00