Commit Graph

19826 Commits

Author SHA1 Message Date
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
Tom Lane 91728fa26c Add temp_buffers GUC variable to allow users to determine the size
of the local buffer arena for temporary table access.
2005-03-19 23:27:11 +00:00
Tom Lane d65522aeb6 Upgrade localbuf.c to use a hash table instead of linear search to
find already-allocated local buffers.  This is the last obstacle
in the way of setting NLocBuffer to something reasonably large.
2005-03-19 17:39:43 +00:00
Tom Lane 2e629080f7 Put 'dump complete' message in the right place, so it comes out where
it's supposed to when --file option is used.
2005-03-18 17:32:55 +00:00
Tom Lane 88164799ce Need to reset local buffer pin counts, not only shared buffer pins,
before we attempt any file deletions in ShutdownPostgres.  Per Tatsuo.
2005-03-18 16:16:09 +00:00
Michael Meskes 1f418555cf Added patch by Christof Petig <christof@petig-baender.de> to work around gcc bug on powerpc and amd64. 2005-03-18 10:00:43 +00:00
Tom Lane cef01c3355 Avoid infinite loop in InvalidateBuffer if we ourselves are holding
a pin on the victim buffer.
2005-03-18 05:25:23 +00:00
Tom Lane afb66ad8dd Need to release buffer pins before attempting to drop files during
backend exit.  Per report from Bruce.
2005-03-18 05:24:13 +00:00
Tom Lane 7a969cad2e Treat EPERM as a non-error case when checking to see if old postmaster
is still alive.  This improves our odds of not getting fooled by an
unrelated process when checking a stale lock file.  Other checks already
in place, plus one newly added in checkDataDir(), ensure that we cannot
attempt to usurp the place of a postmaster belonging to a different userid,
so there is no need to error out.  Add comments indicating the importance
of these other checks.
2005-03-18 03:48:49 +00:00
Neil Conway d344505d1b This patch moves some code for preprocessing FOR UPDATE from
grouping_planner() to preprocess_targetlist(), according to a comment
in grouping_planner(). I think the refactoring makes sense, and moves
some extraneous details out of grouping_planner().
2005-03-17 23:45:09 +00:00
Bruce Momjian 5955ebe334 Add link to INSERT in docs.
Robert Treat
2005-03-17 20:24:34 +00:00
Bruce Momjian 28d150d8e9 Update file system snapshot docs. 2005-03-17 15:38:46 +00:00
Tom Lane 57fdb2b0d8 Update obsolete comment. 2005-03-17 15:25:51 +00:00
Neil Conway 72cbc5982d Trivial comment tweak. 2005-03-17 05:47:01 +00:00
Bruce Momjian 118bf5bc22 Mention tablespaces as a problem for using file system snapshots. 2005-03-17 05:10:11 +00:00
Bruce Momjian ca2d08579e Document use of rsync for file system backups.
Tino Wildenhain
2005-03-17 05:03:37 +00:00
Bruce Momjian 82c46e5a70 Add mention of compatibility problem with turning off backslash escapes:
<   SQL-spec compliant, so allow such handling to be disabled.
>   SQL-spec compliant, so allow such handling to be disabled.  However,
>   disabling backslashes could break many third-party applications and tools.
2005-03-17 04:42:15 +00:00
Bruce Momjian 7111a14fba Factor duplicate snprintf code into functions. 2005-03-17 03:18:14 +00:00
Neil Conway 957f51ea6b Add a reference to the documentation on alternate index operator classes in
the locale docs. Patch from Chris KL, editorialization by Neil Conway.
2005-03-17 00:22:24 +00:00
Neil Conway d663d3ba3a This patch makes \d on tables and views sort fk constraints, triggers
and rules alphabetically in the output.  This makes it the same as
for indexes and stops the irritating random or reverse ordering it
currently has.

Chris KL
2005-03-16 23:52:18 +00:00
Bruce Momjian f402125926 Force initdb cause of encoding additions. 2005-03-16 22:59:42 +00:00
Tom Lane f97aebd162 Revise TupleTableSlot code to avoid unnecessary construction and disassembly
of tuples when passing data up through multiple plan nodes.  A slot can now
hold either a normal "physical" HeapTuple, or a "virtual" tuple consisting
of Datum/isnull arrays.  Upper plan levels can usually just copy the Datum
arrays, avoiding heap_formtuple() and possible subsequent nocachegetattr()
calls to extract the data again.  This work extends Atsushi Ogawa's earlier
patch, which provided the key idea of adding Datum arrays to TupleTableSlots.
(I believe however that something like this was foreseen way back in Berkeley
days --- see the old comment on ExecProject.)  A test case involving many
levels of join of fairly wide tables (about 80 columns altogether) showed
about 3x overall speedup, though simple queries will probably not be
helped very much.

I have also duplicated some code in heaptuple.c in order to provide versions
of heap_formtuple and friends that use "bool" arrays to indicate null
attributes, instead of the old convention of "char" arrays containing either
'n' or ' '.  This provides a better match to the convention used by
ExecEvalExpr.  While I have not made a concerted effort to get rid of uses
of the old routines, I think they should be deprecated and eventually removed.
2005-03-16 21:38:10 +00:00
Bruce Momjian 712f053587 Add sprintf support, that were were missing.
Add support for snprintf '+', 'h', and %* length settings.
2005-03-16 21:27:23 +00:00
Bruce Momjian ca66797308 pgindent snprintf.c for consistency. 2005-03-16 15:12:18 +00:00
Bruce Momjian 2306f63dea Fix snprintf for %*$. 2005-03-16 15:11:43 +00:00
Bruce Momjian fb7d212fbe Add CVS \r\n regression tests.
Andrew Dunstan
2005-03-16 06:05:53 +00:00
Bruce Momjian 888271ed15 Fix snprintf to handle %$ properly by storing and reordering the
arguments.

Nicolai Tufar
2005-03-16 06:00:58 +00:00
Bruce Momjian 83e87e6f2e Add missing include for new lc_ctype_is_c() function.
Per Neil.
2005-03-16 01:49:10 +00:00
Bruce Momjian 494f30c953 Prevent locale-aware handling of upper, lower, and initcap when the
locale is C.

Backpatch to 8.0.X because some operating systems were throwing errors
for such operations, rather than ignoring the locale when it was C.
2005-03-16 00:02:49 +00:00
Neil Conway 963ffe4cc4 Wrap the implementation of fork_process() inside #ifndef WIN32 -- this
should hopefully unbreak the Win32 build. Apologies for breaking it in
the first place.
2005-03-16 00:02:39 +00:00
Bruce Momjian 86ad33cd48 Update to 8.0.1. 2005-03-15 22:38:23 +00:00
Bruce Momjian 05be5cc4e0 Add:
> * Allow sequential scans to take advantage of other concurrent
>   sequentiqal scans, also called "Synchronised Scanning"
2005-03-15 05:31:27 +00:00
Bruce Momjian d5bc23878a Update Win32 item:
<         o Disallow encodings like UTF8 which PostgreSQL supports
<           but the operating system does not (already disallowed by
< 	  pginstaller)
>         o Add support for Unicode
< 	  To fix UTF8, the data needs to be converted to UTF16 and then
< 	  the Win32 wcscoll() can be used, and perhaps other functions
> 	  To fix this, the data needs to be converted to/from UTF16/UTF8
>           so the Win32 wcscoll() can be used, and perhaps other functions
< 	  locales but provides no ordering.
<
> 	  locales but provides no ordering or character set classes.
2005-03-15 04:01:21 +00:00
Bruce Momjian 17c8276d24 Clean up win1252 documentation. Mention how we determine the number of
bytes/character for each encoding.
2005-03-15 02:30:33 +00:00