1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00
Commit Graph

308 Commits

Author SHA1 Message Date
efd6cade83 Tweak heap_update/delete so that we do not hold the buffer context lock
on the old tuple's page while we are doing TOAST pushups.
2001-01-15 05:29:19 +00:00
6162432de9 Add more critical-section calls: all code sections that hold spinlocks
are now critical sections, so as to ensure die() won't interrupt us while
we are munging shared-memory data structures.  Avoid insecure intermediate
states in some code that proc_exit will call, like palloc/pfree.  Rename
START/END_CRIT_CODE to START/END_CRIT_SECTION, since that seems to be
what people tend to call them anyway, and make them be called with () like
a function call, in hopes of not confusing pg_indent.
I doubt that this is sufficient to make SIGTERM safe anywhere; there's
just too much code that could get invoked during proc_exit().
2001-01-12 21:54:01 +00:00
a4ddbbd1a4 Correct nasty error in heap_update: it was releasing the buffer refcount
before calling RelationInvalidateHeapTuple(), which is bad because the
latter needs to look at the tuple data, which is in the shared disk
buffer.  If another backend manages to recycle the buffer while this
is going on, we will compute the wrong hashindex for the tuple or
maybe even crash outright.  Must hold buffer refcount until afterwards.
(This bug is not in 7.0.*; seems to be have introduced during WAL changes.)
2001-01-07 22:14:31 +00:00
3e059b3802 1. WAL needs in zero-ed content of newly initialized page.
2. Log record for PageRepaireFragmentation now keeps array
   of !LP_USED offnums to redo cleanup properly.
2000-12-30 15:19:57 +00:00
c193f19a39 Fixed misprint in heap update WALoging. 2000-12-30 06:52:34 +00:00
7ceeeb662f New WAL version - CRC and data blocks backup. 2000-12-28 13:00:29 +00:00
8609d4abf2 Fix portability problems recently exposed by regression tests on Alphas.
1. Distinguish cases where a Datum representing a tuple datatype is an OID
from cases where it is a pointer to TupleTableSlot, and make sure we use
the right typlen in each case.
2. Make fetchatt() and related code support 8-byte by-value datatypes on
machines where Datum is 8 bytes.  Centralize knowledge of the available
by-value datatype sizes in two macros in tupmacs.h, so that this will be
easier if we ever have to do it again.
2000-12-27 23:59:14 +00:00
6ef0219c34 Resolve complie error(was my fault). 2000-12-11 09:14:03 +00:00
a8824ff257 *redo: Heap move* neglects to set t_cmin for MOVED_IN tuples. 2000-12-11 05:25:23 +00:00
65b362fae1 Disable elog(ERROR|FATAL) in signal handlers in
critical sections of code.
2000-12-03 10:27:29 +00:00
1f5cc8c78a Remove VARLENA_FIXED_SIZE hack, which is irreversibly broken now that
both MULTIBYTE and TOAST prevent char(n) from being truly fixed-size.
Simplify and speed up fastgetattr() and index_getattr() macros by
eliminating special cases for attnum=1.  It's just as fast to handle
the first attribute by presetting its attcacheoff to zero; so do that
instead when loading the tupledesc in relcache.c.
2000-11-30 18:38:47 +00:00
81c8c244b2 No more #ifdef XLOG. 2000-11-30 08:46:26 +00:00
a70e74b060 Put external declarations into header files. 2000-11-21 21:16:06 +00:00
3568cf50e5 Silence gcc warnings. 2000-11-20 21:14:13 +00:00
21e1e6643c Minor cleanup of tableOid-related coding. 2000-11-14 21:04:32 +00:00
3908473c80 Make DROP TABLE rollback-able: postpone physical file delete until commit.
(WAL logging for this is not done yet, however.)  Clean up a number of really
crufty things that are no longer needed now that DROP behaves nicely.  Make
temp table mapper do the right things when drop or rename affecting a temp
table is rolled back.  Also, remove "relation modified while in use" error
check, in favor of locking tables at first reference and holding that lock
throughout the statement.
2000-11-08 22:10:03 +00:00
e3ba543525 WAL fixes. 2000-10-29 18:33:41 +00:00
db2faa943a WAL misc 2000-10-24 09:56:23 +00:00
a7fcadd10a WAL 2000-10-21 15:43:36 +00:00
b58c0411ba redo/undo support functions and cleanups. 2000-10-20 11:01:21 +00:00
deee783052 WAL 2000-10-13 12:05:22 +00:00
25a26a7ab8 WAL 2000-10-13 02:03:02 +00:00
5800c6b9aa Btree WAL logging. 2000-10-04 00:04:43 +00:00
f2bfe8a24c Heap redo/undo (except for tuple moving used by vacuum). 2000-09-07 09:58:38 +00:00
dd8ad64118 Fix tuptoaster bugs induced by making bytea toastable. Durn thing was
trying to toast tuples inserted into toast tables!  Fix is two-pronged:
first, ensure all columns of a toast table are marked attstorage='p',
and second, alter the target chunk size so that it's less than the
threshold for trying to toast a tuple.  (Code tried to do that but the
expression was wrong.)  A few cosmetic cleanups in tuptoaster too.
NOTE: initdb forced due to change in toaster chunk-size.
2000-08-04 04:16:17 +00:00
61aca818c4 Modify heap_open()/heap_openr() API per pghackers discussion of 11 July.
These two routines will now ALWAYS elog() on failure, whether you ask for
a lock or not.  If you really want to get a NULL return on failure, call
the new routines heap_open_nofail()/heap_openr_nofail().  By my count there
are only about three places that actually want that behavior.  There were
rather more than three places that were missing the check they needed to
make under the old convention :-(.
2000-08-03 19:19:38 +00:00
f67e79045d 2nd try for the index tuple toast hack. This time as suggested
by Tom.

Jan
2000-07-22 11:18:47 +00:00
0143d391c6 Need to switch to tuples memory context when replacing the toasted
one with the plain one.

Jan
2000-07-21 11:18:51 +00:00
82f3945a67 Temporary fix to make TOAST vacuum-safe. All values are forced to be
in memory (plain or compressed) in the tuple returned from the heap-am.
So no index will ever contain an external reference.

Jan
2000-07-21 10:31:31 +00:00
d819f5fe83 Moving toaster out of NO ELOG area in heap_update().
Jan
2000-07-04 17:11:40 +00:00
e1a118e5e6 unlock buffer before releasing in heap_insert
+unlock buffer in heap_fetch under !ItemIdIsUsed().
2000-07-04 01:39:24 +00:00
e81fe1e8a0 Add missing #include for TOAST. 2000-07-03 23:58:32 +00:00
57d8080a40 TOAST
WARNING: This is actually broken - we have self-deadlocks
	         due to concurrent changes in buffer management.
			 Vadim and me are working on it.

Jan
2000-07-03 23:10:14 +00:00
1b67fe17b8 heap' logging 2000-07-03 02:54:21 +00:00
80c646958a Attached is a new patch which addresses this problem. (oids in
regression tests).

Chris Bitmead
2000-07-02 22:01:27 +00:00
385470f8c6 Fixes for Solaris/cc suggested by <pgsql-hackers@thewrittenword.com>
Don't use DISABLE_COMPLEX_MACRO on Solaris. Don't define the
replacement function in the header file. Use -KPIC, not -K PIC.
Use CC to link C++ libraries, not ld/ar.

Eliminate file not found warnings in tcl build code.
2000-06-30 16:11:02 +00:00
1aebc3618a First phase of memory management rewrite (see backend/utils/mmgr/README
for details).  It doesn't really do that much yet, since there are no
short-term memory contexts in the executor, but the infrastructure is
in place and long-term contexts are handled reasonably.  A few long-
standing bugs have been fixed, such as 'VACUUM; anything' in a single
query string crashing.  Also, out-of-memory is now considered a
recoverable ERROR, not FATAL.
Eliminate a large amount of crufty, now-dead code in and around
memory management.
Fix problem with holding off SIGTRAP, SIGSEGV, etc in postmaster and
backend startup.
2000-06-28 03:33:33 +00:00
946e80c435 Final #include cleanup. 2000-06-15 04:10:30 +00:00
bf1c8f2b3b heap' xlog records 2000-06-02 10:20:27 +00:00
a12a23f0d0 Remove unused include files. Do not touch /port or includes used by defines. 2000-05-30 00:49:57 +00:00
9dab9ab5e4 Repair memory leaks that caused CacheCxt to grow without bound. We
really ought to fix relcache entry construction so that it does not
do so much with CurrentMemoryContext = CacheCxt.  As is, relatively
harmless leaks in either sequential or index scanning translate to
permanent leaks if they occur when called from relcache build.
For the moment, however, the path of least resistance is to repair
all such leaks...
2000-05-21 02:28:55 +00:00
52f77df613 Ye-old pgindent run. Same 4-space tabs. 2000-04-12 17:17:23 +00:00
3dec14197b Enable backward sequential scan even after reaching EOF. 2000-02-09 03:49:47 +00:00
5c25d60244 Add:
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc

to all files copyright Regents of Berkeley.  Man, that's a lot of files.
2000-01-26 05:58:53 +00:00
fa5400c0a4 added ALTER TABLE DROP COLUMN, early version 2000-01-22 14:20:56 +00:00
0f2e7948e2 Improve cache invalidation handling. Eespecially
this would fix TODO
* elog() flushes cache, try invalidating just entries from
  current xact, perhaps using invalidation cache
2000-01-10 06:30:56 +00:00
e2aef49694 Added empty TOASTER files and corrected some minor glitches
in regression tests.

Jan
1999-12-21 00:06:44 +00:00
397e9b32a3 Some changes to prepare for LONG attributes.
Jan
1999-12-16 22:20:03 +00:00
bb10bf319e Rename heap_replace to heap_update. 1999-11-24 00:44:37 +00:00
6f9ff92cc0 Tid access method feature from Hiroshi Inoue, Inoue@tpf.co.jp 1999-11-23 20:07:06 +00:00