Commit Graph

2722 Commits

Author SHA1 Message Date
Jan Wieck 62c42a05a2 Added global variable to have RI triggers override
time qualification of HeapTupleSatisfiesSnapshot()

Jan
1999-12-10 12:34:15 +00:00
Tatsuo Ishii d31ff14ed8 Fix memory overrun while setting ps status 1999-12-10 10:29:01 +00:00
Tom Lane 18c3000286 Teach grammar and parser about aggregate(DISTINCT ...). No implementation
yet, but at least we can give a better error message:
regression=> select count(distinct f1) from int4_tbl;
ERROR:  aggregate(DISTINCT ...) is not implemented yet
instead of 'parser: parse error at or near distinct'.
1999-12-10 07:37:35 +00:00
Bruce Momjian ecba5d308c Remove unneeded action. 1999-12-10 05:17:13 +00:00
Bruce Momjian 97dec77fab Rename several destroy* functions/tags to drop*. 1999-12-10 03:56:14 +00:00
Tom Lane f6baabcd0b Correct coredump in ALTER TABLE foo ADD(). Accept explicit NULL in
typecasts, eg 'NULL::text'.  Later parts of the parser don't like this
yet, but I'll work on that next.
1999-12-10 03:01:05 +00:00
Bruce Momjian 3ffd3d82db Make LD -r as macros that can be changed for QNX. 1999-12-09 19:15:45 +00:00
Bruce Momjian cb0032cdcf Update for QNX from Kardos, Dr. Andrea 1999-12-09 15:56:16 +00:00
Tom Lane f7f41c7c8c Replace generic 'Illegal use of aggregates' error message with one that
shows the specific ungrouped variable being complained of.  Perhaps this
will reduce user confusion...
1999-12-09 05:58:56 +00:00
Bruce Momjian d65a27f950 Hi,
I was able to crash postgres 6.5.3 when I did an 'alter user' command.
After I started a debugger I found the problem in the timezone handling
of
datetime (my Linux box lost its timezone information, that's how the
problem occurred).

Only 7 bytes are reserved for the timezone, without checking for
boundaries.

Attached is a patch that fixes this problem and emits a NOTICE if a
timezone is encountered that is longer than MAXTZLEN bytes, like this:

Jeroen van Vianen
1999-12-09 05:02:24 +00:00
Jan Wieck 0882951b0c Fixed concurrent visibility bug.
Jan
1999-12-08 20:41:22 +00:00
Tom Lane 04fa5ca544 Clean up memory leakage in find_inheritors() by using pg_list lists
(which are palloc'd) instead of DLLists (which are malloc'd).  Not very
significant, since this routine seldom has anything useful to do, but
a leak is a leak...
1999-12-07 04:09:39 +00:00
Jan Wieck 5ad4034a4c Again updated INSIDE TODO
Jan
1999-12-07 00:13:41 +00:00
Jan Wieck 70dd9e81af Added SET DEFAULT action for ON DELETE/UPDATE
Jan
1999-12-07 00:11:35 +00:00
Jan Wieck 3327730bbd Corrected TODO in source
Jan
1999-12-06 19:52:36 +00:00
Jan Wieck 2eb53e684c Added ON DELETE/UPDATE SET NULL
Jan
1999-12-06 19:50:49 +00:00
Jan Wieck b8ef7e7f82 Completed FOREIGN KEY syntax.
Added functionality for automatic trigger creation during CREATE TABLE.

Added ON DELETE RESTRICT and some others.

Jan
1999-12-06 18:02:47 +00:00
Tatsuo Ishii 169051afc9 Fix bugs regarding pid file. 1999-12-06 07:21:12 +00:00
Tom Lane 53311358c2 Rule deparser needs to quote identifiers that are spelled the same as
SQL keywords.
1999-12-06 02:37:17 +00:00
Tatsuo Ishii d9f61cfa15 Unlink the pid file if it's bogus (no associated process exists) 1999-12-04 08:23:43 +00:00
Tatsuo Ishii dde36bfb7c Create postmaster.pid and postmaster.opts under $PGDATA 1999-12-03 06:26:34 +00:00
Bruce Momjian 4901ff77bd Mention index name when reporting corruption. 1999-12-01 00:29:54 +00:00
Bruce Momjian 1f64926953 Fix compile error on older patch. 1999-11-30 04:29:57 +00:00
Bruce Momjian eebfb9baa5 create/alter user extension
This one should work much better than the one I sent in previously. The
functionality is the same, but the patch was missing one file resulting
in
the compilation failing. The docs also received a minor fix.

Peter Eisentraut                  Sernanders väg 10:115
1999-11-30 03:57:29 +00:00
Tom Lane d367f626f4 Add permissions check: now one must be the Postgres superuser or the
table owner in order to vacuum a table.  This is mainly to prevent
denial-of-service attacks via repeated vacuums.  Allow VACUUM to gather
statistics about system relations, except for pg_statistic itself ---
not clear that it's worth the trouble to make that case work cleanly.
Cope with possible tuple size overflow in pg_statistic tuples; I'm
surprised we never realized that could happen.  Hold a couple of locks
a little longer to try to prevent deadlocks between concurrent VACUUMs.
There still seem to be some problems in that last area though :-(
1999-11-29 04:43:15 +00:00
Tom Lane 8a7f31a7d8 Try to detect oversize tuple before corrupting relation, instead of
after...
1999-11-29 04:34:55 +00:00
Tom Lane aa903cf07c Remove pg_vlock locking from VACUUM, allowing multiple VACUUMs to run in
parallel --- and, not incidentally, removing a common reason for needing
manual cleanup by the DB admin after a crash.  Remove initial global
delete of pg_statistics rows in VACUUM ANALYZE; this was not only bad
for performance of other backends that had to run without stats for a
while, but it was fundamentally broken because it was done outside any
transaction.  Surprising we didn't see more consequences of that.
Detect attempt to run VACUUM inside a transaction block.  Check for
query cancel request before starting vacuum of each table.  Clean up
vacuum's private portal storage if vacuum is aborted.
1999-11-28 02:10:01 +00:00
Tom Lane d2914c38b6 Delete pg_statistics rows for a relation during heap_destroy_with_catalog.
By dropping stats rows here, we eliminate the need for VACUUM to do a
wholesale remove of stats rows.  Before, pg_statistics was wiped clean
at the start of VACUUM, ensuring poor planning results for any backends
running in parallel until VACUUM got around to rebuilding the stats for
the relations they are accessing.
1999-11-28 02:03:04 +00:00
Tom Lane 0ffe17aec6 lmgr.c didn't check for failure return from LockAcquire(). Boo hiss. 1999-11-28 01:58:08 +00:00
Tom Lane b982c3b683 Add missing SpinRelease() to a couple of error exits --- bug found while
testing concurrent VACUUMs.
1999-11-28 01:56:48 +00:00
Tom Lane 4dded12faa COPY to a relation should keep write lock till transaction commit.
Thanks to Hiroshi for spotting the problem.
1999-11-27 21:52:53 +00:00
Bruce Momjian c83b4d1cd8 Fix for bool casting. 1999-11-25 19:15:20 +00:00
Jan Wieck 4069d48aa7 Added another single byte oriented decompressor, useful for
comparision functions.

Added all lztext comparision functions, operators and a default
operator class for nbtree on lztext.

Jan
1999-11-25 01:28:07 +00:00
Bruce Momjian 4ae43c84c3 Add opid to selectivity function call. 1999-11-25 00:21:34 +00:00
Bruce Momjian 922e53e6ea Enable pg_statistic cache use. 1999-11-25 00:15:57 +00:00
Bruce Momjian 8f401e8042 Cleanup for pg_statistic commit. 1999-11-24 17:09:28 +00:00
Bruce Momjian 74f418eb9a Add pg_statistic index, add missing Hiroshi file. 1999-11-24 16:52:50 +00:00
Tatsuo Ishii 61a93ed2da Add multi-byte support to lztextlen() 1999-11-24 03:45:12 +00:00
Bruce Momjian 95997e159b Rename heap_replace to heap_update. 1999-11-24 00:58:48 +00:00
Bruce Momjian bb10bf319e Rename heap_replace to heap_update. 1999-11-24 00:44:37 +00:00
Bruce Momjian 6f9ff92cc0 Tid access method feature from Hiroshi Inoue, Inoue@tpf.co.jp 1999-11-23 20:07:06 +00:00
Tom Lane b04bdf1290 Reduce ReleaseLruFile failure from FATAL to ERROR grade; offhand I don't
see that this should be a worse way to fail to open a file than any other.
1999-11-23 01:08:36 +00:00
Tom Lane d831990167 verify_password() leaked a file descriptor if it failed to find the given
userid in the flat password file.  Do it enough times and the postmaster
panicked :-(
1999-11-23 01:04:38 +00:00
Bruce Momjian fc955b14ea Add system indexes to match all caches.
Make all system indexes unique.
Make all cache loads use system indexes.
Rename *rel to *relid in inheritance tables.
Rename cache names to be clearer.
1999-11-22 17:56:41 +00:00
Tom Lane 316c4c57e2 Clean up some problems in error recovery --- elog() was pretty broken
for the case of errors in backend startup, and proc_exit's method for
coping with errors during proc_exit was *completely* busted.  Fixed per
discussions on pghackers around 11/6/99.
1999-11-22 02:06:31 +00:00
Tom Lane bb203c75a9 Come to think of it, DropBuffers() could have the same problem as
ReleaseRelationBuffers --- need to wait if anyone is trying to flush
out that buffer.
1999-11-22 02:03:21 +00:00
Tom Lane 6b5d8e14b4 ReleaseRelationBuffers() failed to check for I/O in progress on a buffer
it wants to release.  This leads to a race condition: does the backend
that's trying to flush the buffer do so before the one that's deleting the
relation does so?  Usually no problem, I expect, but on occasion this could
lead to hard-to-reproduce complaints from md.c, especially mdblindwrt.
1999-11-22 01:19:42 +00:00
Tom Lane 610dfa6d55 Combine index_info and find_secondary_indexes into a single routine that
returns a list of RelOptInfos, eliminating the need for static state
in index_info.  That static state was a direct cause of coredumps; if
anything decided to elog(ERROR) partway through an index_info search of
pg_index, the next query would try to close a scan pointer that was
pointing at no-longer-valid memory.  Another example of the reasons to
avoid static state variables...
1999-11-21 23:25:47 +00:00
Tom Lane 40d3e92541 index_destroy() must grab exclusive access to the parent table
of the index it wants to destroy.  This ensures that no other backend is
actively scanning or updating that index.  Getting exclusive access on
the index alone is NOT sufficient, because the executor is rather
cavalier about getting locks on indexes --- see ExecOpenIndices().
It might be better to grab index locks in the executor, but I'm not
sure the extra lockmanager traffic is really worth it just to make
index_destroy cleaner.
1999-11-21 20:01:10 +00:00
Tom Lane d8ba3dfb0b Change backend-side COPY to write files with permissions 644 not 666
(whoever thought world-writable files were a good default????).  Modify
the pg_pwd code so that pg_pwd is created with 600 permissions.  Modify
initdb so that permissions on a pre-existing PGDATA directory are not
blindly accepted: if the dir is already there, it does chmod go-rwx
to be sure that the permissions are OK and the dir actually is owned
by postgres.
1999-11-21 04:16:17 +00:00