Commit Graph

388 Commits

Author SHA1 Message Date
Bruce Momjian 9322950aa4 Cleanup of source files where 'return' or 'var =' is alone on a line. 1999-02-03 21:18:02 +00:00
Bruce Momjian 4390b0bfbe Add TEMP tables/indexes. Add COPY pfree(). Other cleanups. 1999-02-02 03:45:56 +00:00
Bruce Momjian c91dbcc5c7 The following patch finishes primary key support. Previously, when
a field was labelled as a primary key, the system automatically
created a unique index on the field.  This patch extends it so
that the index has the indisprimary field set.  You can pull a list
of primary keys with the followiing select.

SELECT pg_class.relname, pg_attribute.attname
    FROM pg_class, pg_attribute, pg_index
    WHERE pg_class.oid = pg_attribute.attrelid AND
        pg_class.oid = pg_index.indrelid AND
        pg_index.indkey[0] = pg_attribute.attnum AND
        pg_index.indisunique = 't';

There is nothing in this patch that modifies the template database to
set the indisprimary attribute for system tables.  Should they be
changed or should we only be concerned with user tables?

D'Arcy
1999-01-21 22:48:20 +00:00
Tom Lane 740c9da76d fixes to lock debugging macros from Massimo Dal Zotto 1999-01-17 20:59:56 +00:00
Bruce Momjian 7a6b562fdf Apply Win32 patch from Horak Daniel. 1999-01-17 06:20:06 +00:00
Tom Lane 21badba151 Replace direct inclusions of c.h with inclusion of postgres.h,
to ensure that config.h is included as well.
1999-01-17 03:04:57 +00:00
Bruce Momjian 6059c5a141 Update for deadlock detection. 1998-12-29 19:32:08 +00:00
Bruce Momjian 06c120e67e Update for deadlock timer. 1998-12-29 18:36:29 +00:00
Bruce Momjian f659ec545f Fix for deadlock timer timeout. 1998-12-29 18:29:18 +00:00
Bruce Momjian 58e539e574 Long awaited port for NetBSD/m68k was finally done by Mr. Mutsuki
Nakajima. Since he is not subscribing the mailing list, I'm posting
his patches by his request.  According to him, he has successfully
compiled and passed the regression test on Mac SE/30 running
NetBSD/m68k. Also, another person has reported that with the patches
PostgreSQL is working on NetBSD/sun3 too.
--
Tatsuo Ishii
1998-12-26 18:15:53 +00:00
Bruce Momjian 3cd3be92ff Fix deadlock so it only checks once. 1998-12-18 19:45:38 +00:00
Bruce Momjian b8d5f02e4e I have ported PostgreSQL 6.4 to Cobalt Qube running Linux 2.0.33 with
MIPS cpu (I think it's R4000). I have tested the patches on LinuxPPC
and FreeBSD. I believe they do not harm other platforms.
--
Tatsuo Ishii
1998-12-18 17:25:41 +00:00
Vadim B. Mikheev 3498d878cb SET TRANSACTION ISOLATION LEVEL ...
LOCK TABLE IN ... MODE
...implemented
1998-12-18 09:10:39 +00:00
Vadim B. Mikheev c13a64d7fb Serialized mode works! 1998-12-16 11:53:55 +00:00
Vadim B. Mikheev 3f7fbf85dc Initial MVCC code.
New code for locking buffer' context.
1998-12-15 12:47:01 +00:00
Bruce Momjian afded8add3 Fix for lo_import crash. 1998-12-13 05:07:50 +00:00
Vadim B. Mikheev 6beba218d7 New HeapTuple structure/interface. 1998-11-27 19:52:36 +00:00
Tom Lane 3d87216ab9 Get rid of some minor compiler warnings.
(HP's cc doesn't like if you forward-declare a routine static,
and then don't make it static in the actual definition...)
1998-10-26 01:00:13 +00:00
Bruce Momjian 173c555948 Make functions static or ifdef NOT_USED. Prevent pg_version creation. 1998-10-08 18:30:52 +00:00
Bruce Momjian 237e0a6306 Fix for double free from Tatsuo Ishii 1998-10-06 03:55:43 +00:00
Bruce Momjian 4a9da7e5c4 NS32K lock patch reversed. 1998-09-18 17:18:41 +00:00
Bruce Momjian 33554989c0 Fix for NS32K machine. 1998-09-18 05:36:24 +00:00
Bruce Momjian 6921f364db >
> Open portability issues:
>
> /usr/local should be searched for lib and include for all ports if
present
> (currently not working, I have libreadline there)
>
> the stream functions on AIX need a size_t for addrlen's in
fe-connect.c and pqcomm.c.
>
> lock.c still has an incompatible TPRINTF(flags, args...) definition

Massimo
1998-09-09 18:32:05 +00:00
Bruce Momjian 4b814b1886 offsetof cleanup. 1998-09-04 18:21:11 +00:00
Bruce Momjian f93281a1a1 t_bits alignment fix from Tatsuo Ishii 1998-09-04 18:05:39 +00:00
Bruce Momjian 63e39ab9a9 O2. Seems tas() for PPC (storage/buffer/s_lock.c) never works if
compiled with -O0. Included are patches that should fix the problem
(of course I have confirmed -O2 works with this patch).

BTW, here is a platforms/regression test failure(serious one--backend
death) matrix.

Tatsuo Ishii
1998-09-03 02:14:39 +00:00
Bruce Momjian 58fdae0ddf Fix for indexing problems. 1998-09-02 23:05:37 +00:00
Bruce Momjian fa1a8d6a97 OK, folks, here is the pgindent output. 1998-09-01 04:40:42 +00:00
Bruce Momjian af74855a60 Renaming cleanup, no pgindent yet. 1998-09-01 03:29:17 +00:00
Marc G. Fournier b686927f4b From: Massimo Dal Zotto <dz@cs.unitn.it>
I have this small patch which fixes a typo in my previous lock patches.
Fortunately the bug affects only user locks.

-
1998-08-28 12:08:03 +00:00
Bruce Momjian 4166f73997 Fix 'd ' should be 'd'. 1998-08-27 01:04:23 +00:00
Marc G. Fournier 7414d61950 From: Massimo Dal Zotto <dz@cs.unitn.it>
> tprintf.patch
>
>       tprintf.patch
>
>       adds functions and macros which implement a conditional trace package
>       with the ability to change flags and numeric options of running
>       backends at runtime.
>       Options/flags can be specified in the command line and/or read from
>       the file pg_options in the data directory.
1998-08-25 21:34:10 +00:00
Marc G. Fournier 53d7d47302 From: Massimo Dal Zotto <dz@cs.unitn.it>
> sinval.patch
>
>       fixes a problem in SI cache which causes table overflow if some
>       backend is idle for a long time while other backends keep adding
>       entries.
>       It uses the new signal handling implemented in tprintf.patch.
>       I have also increacasesed the max number of backends from 32 to 64
>       and the table size from 1000 to 5000.
>       I don't know if anybody is working on SI, but until another
>       solution is found this patch fixes the problem. I have received
>       messages from other people reporting the same problem which I
>       fixed many months ago.
1998-08-25 21:31:20 +00:00
Marc G. Fournier 7dbcf31be2 From: Massimo Dal Zotto <dz@cs.unitn.it>
lock.patch

        I have rewritten lock.c cleaning up the code and adding better
        assert checking I have also added some fields to the lock and
        xid tags for better support of user locks. There is also a new
        function which returns an array of pids owning a lock.
        I'm using this code from over six months and it works fine.
1998-08-25 21:20:32 +00:00
Bruce Momjian c0b01461db o note that now pg_database has a new attribuite "encoding" even
if MULTIBYTE is not enabled. So be sure to run initdb.

o these patches are made against the latest source tree (after
Bruce's massive patch, I think) BTW, I noticed that after running
regression, the oid field of pg_type seems disappeared.

	regression=> select oid from pg_type; ERROR:  attribute
	'oid' not found

this happens after the constraints test. This occures with/without
my patches. strange...

o pg_database_mb.h, pg_class_mb.h, pg_attribute_mb.h are no longer
used, and shoud be removed.

o GetDatabaseInfo() in utils/misc/database.c removed (actually in
#ifdef 0). seems nobody uses.

t-ishii@sra.co.jp
1998-08-24 01:14:24 +00:00
Bruce Momjian 8ae24a7566 update fixes. 1998-08-20 22:24:11 +00:00
Bruce Momjian 7971539020 heap_fetch requires buffer pointer, must be released; heap_getnext
no longer returns buffer pointer, can be gotten from scan;
	descriptor; bootstrap can create multi-key indexes;
pg_procname index now is multi-key index; oidint2, oidint4, oidname
are gone (must be removed from regression tests); use System Cache
rather than sequential scan in many places; heap_modifytuple no
longer takes buffer parameter; remove unused buffer parameter in
a few other functions; oid8 is not index-able; remove some use of
single-character variable names; cleanup Buffer variables usage
and scan descriptor looping; cleaned up allocation and freeing of
tuples; 18k lines of diff;
1998-08-19 02:04:17 +00:00
Bruce Momjian 79c8d2e3a0 Change owner from oid to int4 type. 1998-08-11 18:28:49 +00:00
Bruce Momjian af5fde7491 Make large objects their own relkind type. Fix dups in pg_class_mb
files.  Fix sequence creation hack for relkind type.
1998-08-06 05:13:14 +00:00
Vadim B. Mikheev 0d78e8c112 Lmgr cleanup, new locking modes for LLL. 1998-08-01 15:26:38 +00:00
Vadim B. Mikheev be8300b18f Use Snapshot in heap access methods. 1998-07-27 19:38:40 +00:00
Marc G. Fournier 5979d73841 From: t-ishii@sra.co.jp
As Bruce mentioned, this is due to the conflict among changes we made.
Included patches should fix the problem(I changed all MB to
MULTIBYTE). Please let me know if you have further problem.

P.S. I did not include pathces to configure and gram.c to save the
file size(configure.in and gram.y modified).
1998-07-26 04:31:41 +00:00
Marc G. Fournier bf00bbb0c4 I really hope that I haven't missed anything in this one...
From: t-ishii@sra.co.jp

Attached are patches to enhance the multi-byte support.  (patches are
against 7/18 snapshot)

* determine encoding at initdb/createdb rather than compile time

Now initdb/createdb has an option to specify the encoding. Also, I
modified the syntax of CREATE DATABASE to accept encoding option. See
README.mb for more details.

For this purpose I have added new column "encoding" to pg_database.
Also pg_attribute and pg_class are changed to catch up the
modification to pg_database.  Actually I haved added pg_database_mb.h,
pg_attribute_mb.h and pg_class_mb.h. These are used only when MB is
enabled. The reason having separate files is I couldn't find a way to
use ifdef or whatever in those files. I have to admit it looks
ugly. No way.

* support for PGCLIENTENCODING when issuing COPY command

commands/copy.c modified.

* support for SQL92 syntax "SET NAMES"

See gram.y.

* support for LATIN2-5
* add UNICODE regression test case
* new test suite for MB

New directory test/mb added.

* clean up source files

Basic idea is to have MB's own subdirectory for easier maintenance.
These are include/mb and backend/utils/mb.
1998-07-24 03:32:46 +00:00
Vadim B. Mikheev 5afe171443 VariableCache (next XID generator) is placed in shmem. 1998-07-21 06:17:39 +00:00
Bruce Momjian e0058b6172 Theses buffer leaks are caused by indexes that are kept open between
calls. Outside a transaction, the backend detects them as buffer
leaks; it sends a NOTICE, and frees them. This sometimes cause a
segmentation fault (at least on Linux). These indexes are initialized
on the first lo_read/lo_write/lo_tell call, and (normally) closed
on a lo_close call.  Thus the buffer leaks appear when lo direct
access functions are used, and not with lo_import/lo_export functions
(libpq version calls lo_close before ending the command, and the
backend version uses another path).

The included patches (against recent snapshot, and against 6.3.2)
cause indexes to be closed on transaction end (that is on explicit
'END' statment, or on command termination outside trasaction blocks),
thus preventing the buffer leaks while increasing performance inside
transactions. Some (all?) 'classic' memory leaks are also removed.

I hope it will be ok.

--- Pascal ANDRE, graduated from Ecole Centrale Paris andre@via.ecp.fr
1998-07-21 04:17:30 +00:00
Bruce Momjian 0da6358f37 Cleanup use of 16 that should be NAMEDATALEN. 1998-07-20 16:57:18 +00:00
Bruce Momjian 34797d4225 Cleanup Name usage. 1998-07-20 16:14:18 +00:00
Bruce Momjian 5aea4062d6 Inline function, rename libpq variablees, change lrel to lockrel. 1998-07-13 16:35:04 +00:00
Bruce Momjian 76dd88f10b Reverse out unused patch. 1998-07-12 04:43:28 +00:00
Bruce Momjian 2a8996f631 Print relation name before vacuum, results after vacuum. 1998-07-12 04:37:55 +00:00
Bruce Momjian 824c6865fa Update lock manager README. 1998-07-06 18:16:07 +00:00
Bruce Momjian d5283ccd3e Rename shared memory area. 1998-06-30 19:09:57 +00:00
Bruce Momjian 2584029e31 Rename locking structure names to be clearer. Add narrative to
backend flowchart.
1998-06-30 02:33:34 +00:00
Bruce Momjian f21fa6a773 Rename lockt to locktype and rename LOCKT to LOCKTYPE. 1998-06-28 21:17:36 +00:00
Bruce Momjian 0cba552301 Update backend flowchart. 1998-06-28 06:17:14 +00:00
Bruce Momjian 54aabaa800 Rename BindingTable to ShmemIndex. 1998-06-27 15:47:48 +00:00
Bruce Momjian 7487a82667 More cleanups for compiler warnings. 1998-06-27 14:06:41 +00:00
Bruce Momjian 48a94aaf51 Rename proc_exit_clear to on_exit_reset. 1998-06-27 13:24:21 +00:00
Bruce Momjian e747c58718 Fix for hang after postmaster restart. Add new proc_exit and
shmem_exit to replace exitpg().
1998-06-27 04:53:49 +00:00
Bruce Momjian 8fa93b016a Rename Lockm to Locks. 1998-06-26 19:57:50 +00:00
Bruce Momjian ae6a658584 Rename LockTab to LockTable in function name. 1998-06-26 01:58:46 +00:00
Bruce Momjian eef15f555b Rename BindingTab to BindingTable. 1998-06-25 14:24:35 +00:00
Bruce Momjian 898b3e6f6c Back out some changes I made just for testing. 1998-06-23 17:59:54 +00:00
Bruce Momjian 9dde6b3de9 Add underscores in manual references. 1998-06-23 17:52:38 +00:00
Bruce Momjian cfef6ef4ff cleanups 1998-06-23 16:04:46 +00:00
Bruce Momjian cba0c6559a rename MAIN_MEMORY to STABLE_MEMORY_STORAGE 1998-06-23 15:35:48 +00:00
Bruce Momjian 8ed5918faa Solaris cleanup. 1998-06-19 02:55:19 +00:00
Bruce Momjian c711d41752 Add Assert(). 1998-06-18 04:20:34 +00:00
Bruce Momjian 6ab714e3e8 Cleanup UsePrivateMemory define. 1998-06-18 03:56:08 +00:00
Bruce Momjian 94cc3abe60 Cleanups. 1998-06-18 03:44:00 +00:00
Bruce Momjian 0d8e7f6381 Here is the long awaited optimized version of the S_LOCK patch.
This incorporates all the precedeing patches and emailed suggestions
and the results of the performance testing I posted last week. I
would like to get this tested on as many platforms as possible so
I can verify it went in correctly (as opposed to the horrorshow
last time I sent in a patch).

Once this is confirmed, I will make a tarball of files that can be
dropped into a 6.3.2 source tree as a few people have asked for
this in 6.3.2 as well.

David Gould
1998-06-16 07:18:16 +00:00
Bruce Momjian 6bd323c6b3 Remove un-needed braces around single statements. 1998-06-15 19:30:31 +00:00
Bruce Momjian 27db9ecd0b Fix macros that were not properly surrounded by parens or braces. 1998-06-15 18:40:05 +00:00
Bruce Momjian 212c905e2c Remove fork()/exec() and only do fork(). Small cleanups. 1998-05-29 17:00:34 +00:00
Bruce Momjian b1eb7b5927 Cleanup. 1998-05-26 17:29:07 +00:00
Marc G. Fournier f9322c66d3 Missed the __alpha__ to __alpha change...
From: David Gould <dg@illustra.com>
1998-05-04 23:49:17 +00:00
Marc G. Fournier c73e186948 Okay...this should fix the s_lock() patches from David to what he
currently has...

From: David Gould <dg@illustra.com>
1998-05-04 16:58:59 +00:00
Marc G. Fournier 1d36bdcfa6 Major screwed up s_lock patches...need to be fixed... 1998-05-04 15:45:03 +00:00
Marc G. Fournier 51a1741cfb From: Jeroen van Vianen <jeroenv@design.nl>
Attached patch will add a version() function to Postges, e.g.

template1=> select version();
version
------------------------------------------------------------
PostgreSQL 6.3.2 on i586-pc-linux-gnu, compiled by gcc 2.8.1
(1 row)
1998-04-29 12:41:29 +00:00
Marc G. Fournier 1af6b56427 From: Ryan Kirkpatrick <rkirkpat@nag.cs.colorado.edu>
Ok, I have finally gotten all of the defines for Dec/Alpha and
Linux/Alpha sorted out as Marc asked. There is no longer any need for
'-Dalpha' or '-Dlinuxalpha' in either the Dec/Alpha or the Linux/Alpha
template files (./src/template/{alpha,linuxalpha}). I have replaced every
instance of 'alpha' or '__alpha__' with '__alpha', as that appears to be
the common symbol between C compilers on both operating systems (RH4.2 &
DecUnix 4.0b) for alpha.
1998-04-27 14:46:51 +00:00
Bruce Momjian 09baa3cc81 This patch...
1. Removes the unnecessary "#define AbcRegProcedure 123"'s from
pg_proc.h.

2. Changes those #defines to use the names already defined in
fmgr.h.

3. Forces the make of fmgr.h in backend/Makefile instead of having
it
   made as a dependency in access/common/Makefile  *hack*hack*hack*

4. Rearranged the #includes to a less helter-skelter arrangement,
also
    changing <file.h> to "file.h" to signify a non-system header.

5. Removed "pg_proc.h" from files where its only purpose was for
the
   #defines removed in item #1.

6. Added "fmgr.h" to each file changed for completeness sake.

Turns out that #6 was not necessary for some files because fmgr.h
was being included in a roundabout way SIX levels deep by the first
include.

"access/genam.h"
 ->"access/relscan.h"
   ->"utils/rel.h"
     ->"access/strat.h"
       ->"access/skey.h"
	 ->"fmgr.h"

So adding fmgr.h really didn't add anything to the compile, hopefully
just made it clearer to the programmer.

S Darren.
1998-04-27 04:08:07 +00:00
Bruce Momjian 4cbfeef912 Inline some small functions called for every row. 1998-04-24 14:43:33 +00:00
Bruce Momjian 2ffd727531 ASSERT fixes. 1998-04-06 17:27:54 +00:00
Bruce Momjian 645146260e Cleanup of compiler warnings. 1998-04-06 02:38:26 +00:00
Bruce Momjian 1e801a8f16 Hi,
Attached you'll find a (big) patch that fixes make dep and make
depend in all Makefiles where I found it to be appropriate.

It also removes the dependency in Makefile.global for NAMEDATALEN
and OIDNAMELEN by making backend/catalog/genbki.sh and bin/initdb/initdb.sh
a little smarter.

This no longer requires initdb.sh that is turned into initdb with
a sed script when installing Postgres, hence initdb.sh should be
renamed to initdb (after the patch has been applied :-) )

This patch is against the 6.3 sources, as it took a while to
complete.

Please review and apply,

Cheers,

Jeroen van Vianen
1998-04-06 00:32:26 +00:00
Bruce Momjian 4b6fcc4459 Remove GetDatabaseName/Path and use globals. Make consts later. 1998-04-05 21:04:50 +00:00
Marc G. Fournier 896a42a5a7 From: Maurice Gittens <mgittens@david.gits.nl>
After applying the following patch there remain two
probable buffer overruns detected by Electric Fence during
the regression test.
I'll try find out what causes the remain two ones.

This patch also corrects a typo in smgr.c.
1998-04-01 15:35:33 +00:00
Bruce Momjian 9a0dd4fb18 There's a patch attached to fix gcc 2.8.x warnings, except for the
yyerror ones from bison. It also includes a few 'enhancements' to
the C programming style (which are, of course, personal).

The other patch removes the compilation of backend/lib/qsort.c, as
qsort() is a standard function in stdlib.h and can be used any
where else (and it is). It was only used in
backend/optimizer/geqo/geqo_pool.c, backend/optimizer/path/predmig.c,
and backend/storage/page/bufpage.c

> > Some or all of these changes might not be appropriate for v6.3,
since we > > are in beta testing and since they do not affect the
current functionality.  > > For those cases, how about submitting
patches based on the final v6.3 > > release?

There's more to come. Please review these patches. I ran the
regression tests and they only failed where this was expected
(random, geo, etc).

Cheers,

Jeroen
1998-03-30 16:47:35 +00:00
Bruce Momjian 922c83fe62 OK...here is a patch that will cause the magnetic disk storage
manager to not try to split files in 2 gig chunks.  It will just
try to get another block.

If applied, everything is just as before. But if LET_OS_MANAGE_FILESIZE
is defined, the chaining disappears and the file just keeps on
going, and going, and going, til the OS barfs.

Darren King
1998-03-20 04:22:54 +00:00
Marc G. Fournier 6a9627e792 Last minute clean up for SunOS...
From: t-ishii@sra.co.jp
1998-03-02 05:42:15 +00:00
Bruce Momjian a32450a585 pgindent run before 6.3 release, with Thomas' requested changes. 1998-02-26 04:46:47 +00:00
Bruce Momjian d067f83b27 pgindent changes for Thomas proc/lock cleanup 1998-02-25 00:31:23 +00:00
Bruce Momjian 19ba229299 Fix for locking problems an dpriority. 1998-02-24 19:58:26 +00:00
Vadim B. Mikheev 3ae4edb245 Fix relation path constraction in mdblindwrt(). 1998-02-23 13:58:04 +00:00
Bruce Momjian 9540d9786e FIFO lock wait queue, with readers grouped together. 1998-02-19 15:04:45 +00:00
Bruce Momjian 24cab6bd0d Goodbye register keyword. Compiler knows better. 1998-02-11 19:14:04 +00:00
Bruce Momjian 2c482cdbf2 Pass attypmod through to executor by adding to Var and Resdom. 1998-02-10 04:02:59 +00:00
Marc G. Fournier 4e9dd95296 From: Peter T Mount <patches@maidast.demon.co.uk>
[This is a repost - it supercedes the previous one. It fixes the patch so
it doesn't bread aix port, plus there's a file missing out of the
original post because difforig doesn't pick up new files. It's now
attached. peter]

This patch brings the JDBC driver up to the current protocol spec.
Basically, the backend now tells the driver what authentication scheme to
use.

The patch also fixes a performance problem with large objects. In the
buffer manager, each fastpath call was sending multiple Notifications to
the backend (sometimes more data in the form of notifications were being
sent than blob data!).
1998-02-02 13:17:01 +00:00
Bruce Momjian 726c3854cb Inline fastgetattr and others so data access does not use function
calls.
1998-01-31 04:39:26 +00:00
Bruce Momjian 0ff43badd5 Lock cleanup 1998-01-28 06:52:58 +00:00
Bruce Momjian 8abd424369 More deadlock code to check for escallation locks.
offsetof() addition to local socket size.
1998-01-28 02:29:40 +00:00
Bruce Momjian b4564a98fa Deadlock ceallnup.
(void) change for aix and hp compilers.

protocol cleanup.
1998-01-27 15:35:30 +00:00
Bruce Momjian 862927f443 Real deadlock detection. 1998-01-27 03:00:43 +00:00
Bruce Momjian c16ebb0f67 getpid/pid cleanup 1998-01-25 05:15:15 +00:00
Bruce Momjian 0e8ac82c63 Fix a variety of locking problems like newer lock waiters getting
lock before older waiters, and having readlock people not share
locks if a writer is waiting for a lock, and waiting writers not
getting priority over waiting readers.
1998-01-23 22:16:48 +00:00
Marc G. Fournier 1de8926bbe LOCK_LEVEL is defined in an i386_solaris system file, causing the compile
to break.  renaming to PG_LOCK_LEVEL
1998-01-23 19:53:44 +00:00
Bruce Momjian 661bb38812 Cleanup deadlock message. 1998-01-23 06:01:36 +00:00
Marc G. Fournier 374bb5d261 Some *very* major changes by darrenk@insightdist.com (Darren King)
==========================================
What follows is a set of diffs that cleans up the usage of BLCKSZ.

As a side effect, the person compiling the code can change the
value of BLCKSZ _at_their_own_risk_.  By that, I mean that I've
tried it here at 4096 and 16384 with no ill-effects.  A value
of 4096 _shouldn't_ affect much as far as the kernel/file system
goes, but making it bigger than 8192 can have severe consequences
if you don't know what you're doing.  16394 worked for me, _BUT_
when I went to 32768 and did an initdb, the SCSI driver broke and
the partition that I was running under went to hell in a hand
basket. Had to reboot and do a good bit of fsck'ing to fix things up.

The patch can be safely applied though.  Just leave BLCKSZ = 8192
and everything is as before.  It basically only cleans up all of the
references to BLCKSZ in the code.

If this patch is applied, a comment in the config.h file though above
the BLCKSZ define with warning about monkeying around with it would
be a good idea.

Darren  darrenk@insightdist.com

(Also cleans up some of the #includes in files referencing BLCKSZ.)
==========================================
1998-01-13 04:05:12 +00:00
Bruce Momjian 679d39b9c8 Goodbye ABORT. Hello ERROR for all errors. 1998-01-07 21:07:04 +00:00
Marc G. Fournier 7a2a7d436d Wrap the function in and #ifdef, not the header files
Should fix an AIX compiler problem
1998-01-07 17:02:52 +00:00
Bruce Momjian 0d9fc5afd6 Change elog(WARN) to elog(ERROR) and elog(ABORT). 1998-01-05 03:35:55 +00:00
Marc G. Fournier 42a3c46b4e Oops, missed adding a file
From: Ryan Kirkpatrick <rkirkpat@nag.cs.colorado.edu>
1997-12-30 04:03:01 +00:00
Marc G. Fournier 8a0967a3b1 bring in alpha/linux s_lock changes
From: Ryan Kirkpatrick <rkirkpat@nag.cs.colorado.edu>
1997-12-30 04:01:28 +00:00
Marc G. Fournier 6e337eef45 Major cleanout of PORTNAME variables from Makefiles...bound to screw up
some of the ports...
1997-12-20 00:29:35 +00:00
Marc G. Fournier 5379b84eff More cleanups. I can now compile without PORTNAME being defined n
Makefile.global.

End result, if all goes well, should allow for much easier porting, since
there will no longer be a concept of a "port".  Most, if not everything,
*should* be determined by configure, or by the compiler itself.  Still
work to be done though :)
1997-12-19 02:09:10 +00:00
Bruce Momjian 002796b5ca Rename heap_destroyr to heap_destroy, heap_destroy to heap_destroy_with_catalog. 1997-11-28 17:28:02 +00:00
Bruce Momjian c445ba331b Rename heap_create to heap_create_and_catatlog, rename heap_creatr to heap_create(). 1997-11-28 04:40:40 +00:00
Bruce Momjian f7f2e18f8e Remove tqual.h includes not needed. 1997-11-24 05:09:50 +00:00
Bruce Momjian 043cebce2b More archive cleanup. 1997-11-21 19:02:59 +00:00
Bruce Momjian 3fa2bb316c Remove archive stuff. 1997-11-21 18:12:58 +00:00
Bruce Momjian e9e1ff226f Remove all time travel stuff. Small parser cleanup. 1997-11-20 23:24:03 +00:00
Thomas G. Lockhart 7d1f2f8a27 Support alternate database locations. 1997-11-07 06:38:51 +00:00
Vadim B. Mikheev 32cd09ac6d Good Bye, Time Travel! 1997-11-02 15:27:14 +00:00
Bruce Momjian 9f133d23ff Remove duplocate lock_timeout value. 1997-10-30 17:23:59 +00:00
Bruce Momjian f3af1368bd Rename strNcpy to StrNCpy, and change third parameter. 1997-10-25 01:10:58 +00:00
Vadim B. Mikheev eca199d7b0 Debug stuff added to BlowawayRelationBuffers(). 1997-10-22 19:04:43 +00:00
Vadim B. Mikheev 14f81d8d34 Decrement relation reference count incremented in
RelationIdCacheGetRelation() to flush relations from cache
in commit time.
1997-10-12 07:12:03 +00:00
Vadim B. Mikheev 5fb82eb4c7 Blowaway relation buffers from buffer pool before truncation:
+ BlowawayRelationBuffers(relation, blocknumber)
1997-09-22 07:13:56 +00:00
Vadim B. Mikheev 90d490059d Have to PROC_INCR_SLOCK before return. 1997-09-22 04:20:53 +00:00
Bruce Momjian 3f365ba0fc Inline memset() as MemSet(). 1997-09-18 20:22:58 +00:00
Bruce Momjian 8cb4154492 Inline frequently called functions. 1997-09-18 14:21:02 +00:00
Bruce Momjian 1ea01720d5 heapattr functions now return a Datum, not char *. 1997-09-12 04:09:08 +00:00
Bruce Momjian 59f6a57e59 Used modified version of indent that understands over 100 typedefs. 1997-09-08 21:56:23 +00:00
Bruce Momjian 075cede748 Add typdefs to pgindent run. 1997-09-08 20:59:27 +00:00
Bruce Momjian 319dbfa736 Another PGINDENT run that changes variable indenting and case label indenting. Also static variable indenting. 1997-09-08 02:41:22 +00:00
Bruce Momjian 1ccd423235 Massive commit to run PGINDENT on all *.c and *.h files. 1997-09-07 05:04:48 +00:00
Bruce Momjian a1635450b3 Cleanups needed for indent. Remove }; 1997-09-05 18:13:45 +00:00
Bruce Momjian c4cb617504 Major patch to speed up backend startup after profiling analysis. 1997-08-24 23:08:01 +00:00
Bruce Momjian 671c4ea6f5 Remove unused spin function when no spinlocks. 1997-08-21 13:43:46 +00:00
Marc G. Fournier bb951c6cb4 Changes for Digital Unix 1997-08-20 00:50:11 +00:00
Bruce Momjian 1d8bbfd2e7 Make functions static where possible, enclose unused functions in #ifdef NOT_USED. 1997-08-19 21:40:56 +00:00
Bruce Momjian b99c63cfc0 Now that names are null terminated, no need to do all that NAMEDATALEN stuff. 1997-08-18 20:53:48 +00:00
Bruce Momjian 022903f22e Reduce open() calls. Replace fopen() calls with calls to fd.c functions. 1997-08-18 02:15:04 +00:00
Marc G. Fournier eaae21fb4d Fixes for alphalinux port by abrams@philos.umass.edu 1997-08-17 02:40:00 +00:00
Bruce Momjian ea5b5357cd Remove more (void) and fix -Wall warnings. 1997-08-12 22:55:25 +00:00
Bruce Momjian edb58721b8 Fix pgproc names over 15 chars in output. Add strNcpy() function. remove some (void) casts that are unnecessary. 1997-08-12 20:16:25 +00:00
Bruce Momjian 6ed1715b1f Cleanup for NAMEDATALEN use. 1997-08-03 02:38:47 +00:00
Bruce Momjian 8d25436d70 mkLinux patches from Tatsuo Ishii. 1997-07-29 14:09:11 +00:00
Bruce Momjian 79e78f0b80 Added SCO support, from Daniel Harris. 1997-07-28 00:57:08 +00:00
Bruce Momjian 3ac9d2fff3 Various compile errors concerning overflow due to shifts, unsigned, and bad prototypes, from Solaris, from Diab Jerius 1997-07-24 20:19:10 +00:00
Marc G. Fournier 90d0cf0000 From: Robert Bruccoleri <bruc@bms.com>
Subject: [PORTS] Patches for Irix 6.4

I have worked out how to compile PostgreSQL on Irix 6.4 using the -n32 compiler
mode and version 7.1 of the C compiler. (The n32 compiler use 32 bits
addressing,
but allows access to all the instructions in the MIPS4 instruction set.)
There were several problems:

1) The ld command is not referenced as a macro in all the Makefiles. On
this platform, you have to include -n32 on all the ld commands. Makefiles
were changed as needed.

3) Lots of warnings are generated from the compiler. Since the regression
tests worked OK, I didn't attempt to fix them. If anyone wants the compilation
log, please let me know, and I'll email it to you.

The version of postgresql was 970602. Here is Makefile.custom:

CUSTOM_COPT = -O2 -n32
MK_NO_LORDER = 1
LD = ld -n32
CC += -n32
1997-06-11 01:13:10 +00:00
Marc G. Fournier e318022e1a From: "D'Arcy J.M. Cain" <darcy@druid.net>
Subject: [PATCHES] backend/storage/ipc/shmem.c

  - strname is only used if assert checking is on
1997-06-06 22:04:04 +00:00
Marc G. Fournier 15da18508f From: Phil Nelson <phil@cs.wwu.edu>
Subject: [PATCHES] Added support for NetBSD/pc532.
1997-06-06 01:37:23 +00:00
Bruce Momjian a668b7ac2d Fix for large objects and case sensitivity, from Raymond Toy. 1997-06-05 22:59:45 +00:00
Vadim B. Mikheev d865228807 AllocateFile():
fdleft = pg_nofile() - allocatedFiles - nfile;
looks more realistic, but too noisy -
   fdleft = pg_nofile() - allocatedFiles;
restored.
1997-05-23 02:56:48 +00:00
Vadim B. Mikheev 19269069dc 1. Fix md memory leak:
mdunlink() and mdclose() (too !!!) now free MdfdVec for relation
   and add it to free list, so it may be re-used for another relation
   later.
2. Fix VFD-manager memory leak (found by Massimo ... and me):
   mdunlink() has to call FileUnlink() to free allocation for fileName
   and add the Vfd slot to the free list.
1997-05-22 17:08:35 +00:00
Vadim B. Mikheev ff8ce5230d 1. Cleanup (no more FreeFd - unuseful; others).
2. FreeFile() has to do nothing with nfile (# of files opened
   by VFD manager).
1997-05-22 16:51:19 +00:00
Vadim B. Mikheev e7f7cf4a1c 1. LocalBufferSync(): set nextFreeLocalBuf to 0 - we're freeing
all local buffers @ xact commit, so accordingly nextFreeLocalBuf
   is first local buffer now.
   It helps to avoid unnecessary local buffer allocations in LocalBufferAlloc()
   latter ("memmory leaks" in 'order by').
2. ResetLocalBufferPool() lost allocated local buffers:

   memset(LocalBufferDescriptors, 0, sizeof(BufferDesc) * NLocBuffer);

   (local buffers leak @ xact aborts).
1997-05-20 11:30:32 +00:00
Vadim B. Mikheev 13f41aa90b mdcreate():
fd = FileNameOpenFile(path, O_RDWR|O_CREAT|O_EXCL, 0600);

    /*
     *  If the file already exists and is empty, we pretend that the
     *  create succeeded.  During bootstrap processing, we skip that check,
     *  because pg_time, pg_variable, and pg_log get created before their
     *  .bki file entries are processed.
     *
>    *  As the result of this pretence it was possible to have in
>    *  pg_class > 1 records with the same relname. Actually, it
>    *  should be fixed in upper levels, too, but... -  vadim 05/06/97
>    */
1997-05-06 02:03:20 +00:00
Marc G. Fournier 08a5901ba1 Various patches not commited, plus a linux/sparc patch from
Satoshi Ishikawa <power@sekine.densi.gifu-u.ac.jp>
1997-04-24 02:35:39 +00:00
Vadim B. Mikheev d6b8f637f9 CommitInfoNeedsSave[buffer - 1] = 0
added to WriteBuffer(), FlushBuffer(), WriteNoReleaseBuffer().
1997-04-18 08:30:08 +00:00
Vadim B. Mikheev d3dfc664d0 PrintBufferUsage() changed to report about shared, local and direct
blocks transfferes.
1997-04-18 02:53:37 +00:00
Marc G. Fournier 159f8c63ad From: Dan McGuirk <mcguirk@indirect.com>
Reply-To: hackers@hub.org, Dan McGuirk <mcguirk@indirect.com>
To: hackers@hub.org
Subject: [HACKERS] tmin writeback optimization

I was doing some profiling of the backend, and noticed that during a certain
benchmark I was running somewhere between 30% and 75% of the backend's CPU
time was being spent in calls to TransactionIdDidCommit() from
HeapTupleSatisfiesNow() or HeapTupleSatisfiesItself() to determine that
changed rows' transactions had in fact been committed even though the rows'
tmin values had not yet been set.

When a query looks at a given row, it needs to figure out whether the
transaction that changed the row has been committed and hence it should pay
attention to the row, or whether on the other hand the transaction is still
in progress or has been aborted and hence the row should be ignored.  If
a tmin value is set, it is known definitively that the row's transaction
has been committed.  However, if tmin is not set, the transaction
referred to in xmin must be looked up in pg_log, and this is what the
backend was spending a lot of time doing during my benchmark.

So, implementing a method suggested by Vadim, I created the following
patch that, the first time a query finds a committed row whose tmin value
is not set, sets it, and marks the buffer where the row is stored as
dirty.  (It works for tmax, too.)  This doesn't result in the boost in
real time performance I was hoping for, however it does decrease backend
CPU usage by up to two-thirds in certain situations, so it could be
rather beneficial in high-concurrency settings.
1997-03-28 07:06:53 +00:00
Marc G. Fournier 064466ad55 From: Massimo Dal Zotto <dz@cs.unitn.it>
Subject: [HACKERS] lock debug trace

This is an update to my previous patches for lock debugging, already applied
to the current sources. It adds some improvements in the output messages and
some more output in WaitOnLock(). I have used with success to trace a nasty
deadlock condition on pg_listener.
1997-03-15 01:23:58 +00:00
Marc G. Fournier 5dde558ce6 From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] linux/alpha patches

These patches lay the groundwork for a Linux/Alpha port.  The port doesn't
actually work unless you tweak the linker to put all the pointers in the
first 32 bits of the address space, but it's at least a start.  It
implements the test-and-set instruction in Alpha assembly, and also fixes
a lot of pointer-to-integer conversions, which is probably good anyway.
1997-03-12 21:13:19 +00:00
Marc G. Fournier 2280e62d39 Make the error message output by AllocateFile() if failes to
open Nulldev a *bit* more user friendly...or, at least, admin
friendly...have it print strerror(errno) as well
1997-02-20 22:54:18 +00:00
Bruce Momjian 3eba7651f3 Remove hardcoded 20000 and change to BootstrapObjectIdData. 1997-02-14 04:52:59 +00:00
Bruce Momjian 31c8e94b34 Remove WIN32 defines. They never worked. 1997-02-14 04:19:07 +00:00
Bruce Momjian aaaba5a048 Fix naming from proc to prio to fix previous patch. 1997-02-13 15:55:01 +00:00
Marc G. Fournier fb70587c1d Patch from Massimo Dal Zotto <dz@cs.unitn.it>
The following patches add to the backend a new debugging flag -K which prints
a debug trace of all locking operations on user relations (those with oid
greater than 20000). The code is compiled only if LOCK_MGR_DEBUG is defined,
so the patch should be harmless if not explicitly enabled.
I'm using the code to trace deadlock conditions caused by application queries
using the command "$POSTMASTER -D $PGDATA -o '-d 1 -K 1'.
The patches are for version 6.0 dated 970126.
1997-02-12 05:25:13 +00:00
Bruce Momjian d5a3f52d62 Assign priorities when creating jobs in lock queue. 1997-02-11 23:05:38 +00:00
Marc G. Fournier a246e87d12 Convert MISSING_SYSCONF to !HAVE_SYSCONF for autoconf
From: Keith Parks
1997-01-27 00:09:47 +00:00
Bruce Momjian 1836ce2c81 Change next to nextstep where missed. 1997-01-26 20:15:26 +00:00
Bruce Momjian ac3c926c42 Fix typo in struct name. 1997-01-26 00:45:25 +00:00
Bruce Momjian 4eadf2d6cd More autosize structure error checks. 1997-01-25 21:01:16 +00:00
Marc G. Fournier 37a8bdba43 The second patch adds a more explicative error message to BufferPoolCheckLeak.
It should be completely harmless.

Submitted by: Massimo Dal Zotto <dz@cs.unitn.it>
1997-01-23 19:43:23 +00:00
Bruce Momjian fa937b5e6b Remove SB_PAD. Compute padding at compile time. 1997-01-23 18:15:29 +00:00
Vadim B. Mikheev 9ff69034b2 Fixing possible losing data changes:
1. New flag - BM_JUST_DIRTIED - added for BufferDesc;
2. All data "dirtiers" (WriteBuffer and WriteNoReleaseBuffer)
   set this flag (and BM_DIRTY too);
3. All data "flushers" (FlushBuffer, BufferSync and BufferReplace)
   turn this flag off just before calling smgr[blind]write/smgrflush
   and check this flag after flushing buffer: if it turned ON then
   BM_DIRTY will stay ON.
1997-01-20 04:36:48 +00:00
Bruce Momjian 5fefb9f8e7 Add include files needed for stat(). 1997-01-18 16:14:04 +00:00
Vadim B. Mikheev b00c2c1d3f FlushLocalBuffer () releases buffer only if required
by caller.
1997-01-16 08:13:14 +00:00
Vadim B. Mikheev eb08b3ce4f No more LateWrite, but there is WriteMode;
SetBufferWriteMode () added;
FlushBuffer () fixed: now directly calls smgrflush () and
	releases buffer only if required by caller.
1997-01-16 08:11:41 +00:00
Vadim B. Mikheev 1c297d429e No more LateWrite. 1997-01-16 08:04:30 +00:00
Vadim B. Mikheev 2ca05fe45d ReleaseTmpRelBuffers is ReleaseRelationBuffers now. 1997-01-14 05:40:45 +00:00
Bruce Momjian e3c4ac15d3 Another compilation error has surfaced on Ultrix. In spin.c, sem.h must be
included after storage/ipc.h like other similar cases that were changed
recently.

This one has popped up during the last few days.

My sources are sup'ed today, 13. jan 1996.

regards
Erik Bertelsen.
1997-01-14 01:53:11 +00:00
Marc G. Fournier ef228cb170 From: Keith Parks <emkxp01@mtcc.demon.co.uk>
OK, The votes are in for the NOFILES limit.

With the exception of Next, for which I've not yet heard, all supported platforms
seem to have the sysconf() call.


port           supported	default	Source.
aix            yes		2000	darrenk@insightdist.com
alpha          yes		4096	mjl@wwx.vip.at
BSD44_derived  yes		64	scrappy@hub.org
bsdi           yes		???	maillist@candle.pha.pa.us
dgux           yes		???	geek@andrew.cmu.edu
hpux           yes		60	emkxp01@mtcc.demon.co.uk
i386_solaris   yes		64	emkxp01@mtcc.demon.co.uk
irix5          yes		200	martin@biochem.uc.ac.uk
linux          yes		256	emkxp01@mtcc.demon.co.uk
next           ????		???
sparc_solaris  yes		64	emkxp01@mtcc.demon.co.uk
sunos4         yes		64	emkxp01@mtcc.demon.co.uk
svr4           yes		64	chicks@chicks.net
ultrix4        yes		64	erik@sockdev.uni-c.dk

So here's a patch that I think will do the job.
(I assume Next will have sysconf() but if not just add MISSING_SYSCONF to
 the config.h file )

Thanks,
Keith.
1997-01-13 01:25:29 +00:00
Bruce Momjian a5dd06f763 include sem.h added, include string.h neede, from Erik Bertelsen for Ultrix 1997-01-10 20:19:49 +00:00
Vadim B. Mikheev c6a605705c index_insert has now HeapRelation as last param (for unique index
implementation).
1997-01-10 10:00:39 +00:00
Bryan Henderson 5e98c40129 Change the way ipc.h is included because sys/ipc.h on Ultrix is broken. 1997-01-08 08:33:07 +00:00
Vadim B. Mikheev ae753b86b5 ReleaseTmpRelBuffers () releases buffers in LOCAL buffer pool now
(if rd_islocal is true).
1996-12-31 06:47:30 +00:00
Bruce Momjian fd12c8f85e Fixed Assert check where ! should be !=. 1996-12-28 22:44:14 +00:00
Bryan Henderson 634b38aa86 Add asserts to check for file descriptor ring corruption. 1996-12-27 22:57:51 +00:00
Bruce Momjian e8f43854ac pq/signal() portability patch. Also psql copy prompt fix. 1996-12-26 22:08:34 +00:00
Bruce Momjian 89b2807170 Added include files needed for getpid prototype.
Bruce Momjian
1996-12-26 17:50:26 +00:00
Bryan Henderson 9005a38bdb Change portname "sparc" to "sunos4" and change some portname dependencies to
feature dependencies.  Thanks Kurt J. Lidl.
1996-12-04 03:06:33 +00:00
Bryan Henderson 9c0afeabb7 More stuff to make it compile on various ports. 1996-11-27 08:16:44 +00:00
Vadim B. Mikheev 3385497228 New smgrtruncate smgr' interface func. 1996-11-27 07:25:52 +00:00
Vadim B. Mikheev a2a33e1344 New mdtruncate() func for single segment relations (< 2Gb). 1996-11-27 07:24:02 +00:00
Vadim B. Mikheev 3643248ae2 TransactionIdIsInProgress is here now and gives quality answer
by scanning PROC structures of all running backend.
1996-11-27 07:20:07 +00:00
Vadim B. Mikheev 47312ec134 Setting MyProc->xid to InvalidTransactionId while creating
PROC structure (it's for new TransactionIdIsInProgress func).
1996-11-27 07:17:48 +00:00
Bryan Henderson 46c4e6f626 Include fcntl.h, which is not automatically included by sys/file.h on all systems. 1996-11-25 06:33:51 +00:00