Commit Graph

17876 Commits

Author SHA1 Message Date
Tom Lane e674707968 Minor code rationalization: FlushRelationBuffers just returns void,
rather than an error code, and does elog(ERROR) not elog(WARNING)
when it detects a problem.  All callers were simply elog(ERROR)'ing on
failure return anyway, and I find it hard to envision a caller that would
not, so we may as well simplify the callers and produce the more useful
error message directly.
2004-05-31 19:24:05 +00:00
Tom Lane a843053e2e Suppress compile warnings on machines where the INT64CONST() decoration
is actually needed.  Per Oliver Elphick.
2004-05-31 18:53:18 +00:00
Tom Lane 8b1ae8fa3f Too few parens for my taste in this macro. 2004-05-31 18:42:40 +00:00
Tom Lane 87de80e95a I think I've finally identified the cause of the off-by-one-second
issue in timestamp conversion that we hacked around for so long by
ignoring the seconds field from localtime().  It's simple: you have
to watch out for platform-specific roundoff error when reducing a
possibly-fractional timestamp to integral time_t form.  In particular
we should subtract off the already-determined fractional fsec field.
This should be enough to get an exact answer with int64 timestamps;
with float timestamps, throw in a rint() call just to be sure.
2004-05-31 18:31:51 +00:00
Bruce Momjian d534b9ee9e Have pg_ctl print pid and error on signal failure, per suggestion from Tom. 2004-05-31 17:57:31 +00:00
Teodor Sigaev cbfa4092bb trgm - Trigram matching for PostgreSQL
--------------------------------------

	The pg_trgm contrib module provides functions and index classes
	for determining the similarity of text based on trigram
	matching.
2004-05-31 17:18:12 +00:00
Teodor Sigaev 553bc41633 1 add namespaces as Tom suggest http://www.pgsql.ru/db/mw/msg.html?mid=1987703
2 remove select qeury in inserts
2004-05-31 16:51:56 +00:00
Teodor Sigaev 7cb55d21ed Fix memory leak with pg_regexec 2004-05-31 13:55:19 +00:00
Teodor Sigaev d222bb4d5e Fix memory leak with pg_regcomp 2004-05-31 13:52:57 +00:00
Bruce Momjian a1bd1d70d6 Update pg_dump -v comments to mention additional comments in dump file. 2004-05-31 13:37:52 +00:00
Teodor Sigaev 11864ab657 Win32 related patch by Darko Prenosil. Small correct by teodor 2004-05-31 13:29:43 +00:00
Tom Lane 9b178555fc Per previous discussions, get rid of use of sync(2) in favor of
explicitly fsync'ing every (non-temp) file we have written since the
last checkpoint.  In the vast majority of cases, the burden of the
fsyncs should fall on the bgwriter process not on backends.  (To this
end, we assume that an fsync issued by the bgwriter will force out
blocks written to the same file by other processes using other file
descriptors.  Anyone have a problem with that?)  This makes the world
safe for WIN32, which ain't even got sync(2), and really makes the world
safe for Unixen as well, because sync(2) never had the semantics we need:
it offers no way to wait for the requested I/O to finish.

Along the way, fix a bug I recently introduced in xlog recovery:
file truncation replay failed to clear bufmgr buffers for the dropped
blocks, which could result in 'PANIC:  heap_delete_redo: no block'
later on in xlog replay.
2004-05-31 03:48:10 +00:00
Bruce Momjian f024086db3 Done:
> 	o -Allow Java server-side programming
2004-05-31 02:58:43 +00:00
Bruce Momjian 95cdafd333 Remove pljava todo info. 2004-05-31 02:58:09 +00:00
Neil Conway 72b6ad6313 Use the new List API function names throughout the backend, and disable the
list compatibility API by default. While doing this, I decided to keep
the llast() macro around and introduce llast_int() and llast_oid() variants.
2004-05-30 23:40:41 +00:00
Tom Lane ec0b1f2716 Paranoia: ensure MyBackendId is InvalidBackendId in a process that has
never executed SIBackendInit().
2004-05-30 17:58:12 +00:00
Bruce Momjian bf65d730de Add thread library to libpgport creation. 2004-05-30 14:07:47 +00:00
Tom Lane c6719a2784 Implement new PostmasterIsAlive() check for WIN32, per Claudio Natoli.
In passing, align a few error messages with the style guide.
2004-05-30 03:50:15 +00:00
Tom Lane 076a055acf Separate out bgwriter code into a logically separate module, rather
than being random pieces of other files.  Give bgwriter responsibility
for all checkpoint activity (other than a post-recovery checkpoint);
so this child process absorbs the functionality of the former transient
checkpoint and shutdown subprocesses.  While at it, create an actual
include file for postmaster.c, which for some reason never had its own
file before.
2004-05-29 22:48:23 +00:00
Peter Eisentraut d531fd2cdc Translation update 2004-05-29 06:28:58 +00:00
Peter Eisentraut c1010381ea Translation updates 2004-05-29 06:26:14 +00:00
Peter Eisentraut 55216724b2 Translation update 2004-05-29 06:22:56 +00:00
Tom Lane 41accb0e1a Fix another place that assumed 'x = lcons(y, z)' would not have any
side-effect on the original list z.  I fear we have a few more of these
to track down yet :-(.
2004-05-29 05:55:13 +00:00
Bruce Momjian f54b95655e Remove quotes around $CONFIG_LINKS. Caused improper expansion. 2004-05-28 20:52:42 +00:00
Bruce Momjian 0163983330 When checking for thread safety with src/tools/thread/thread_test.c, the
mktemp function wants an argument that contains 6 X, while the current
version only supplies 5 X which will fail on my SuSE 8.1.

Andreas Pflug
2004-05-28 18:37:10 +00:00
Tom Lane 0f3f34f098 Fix minor error in comment. 2004-05-28 16:37:11 +00:00
Tom Lane d707495452 Fix thinko in recent patch to change temp-table permissions behavior:
this is an aclmask function and does not have the same return convention
as aclcheck functions.  Also adjust the behavior so that users without
CREATE TEMP permission still have USAGE permission on their session's
temp schema.  This allows privileged code to create a temp table and
make it accessible to code that's not got the same privilege.  (Since
the default permissions on a table are no-access, an explicit grant on
the table will still be needed; but I see no reason that the temp schema
itself should prohibit such access.)
2004-05-28 16:17:14 +00:00
Teodor Sigaev a6ea6457fa Stat function now can show statistics per weight of lexemes 2004-05-28 15:36:49 +00:00
Tom Lane 1b9ef0025d Fix some typos I introduced in WIN32-only code late last night.
Thanks to Thomas Hallgren.
2004-05-28 15:14:03 +00:00
Teodor Sigaev 42d069886f New version. Add support for int2, int8, float4, float8, timestamp with/without time zone, time with/without time zone, date, interval, oid, money and macaddr, char, varchar/text, bytea, numeric, bit, varbit, inet/cidr types for GiST 2004-05-28 10:43:32 +00:00
Tom Lane 1a321f26d8 Code review for EXEC_BACKEND changes. Reduce the number of #ifdefs by
about a third, make it work on non-Windows platforms again.  (But perhaps
I broke the WIN32 code, since I have no way to test that.)  Fold all the
paths that fork postmaster child processes to go through the single
routine SubPostmasterMain, which takes care of resurrecting the state that
would normally be inherited from the postmaster (including GUC variables).
Clean up some places where there's no particularly good reason for the
EXEC and non-EXEC cases to work differently.  Take care of one or two
FIXMEs that remained in the code.
2004-05-28 05:13:32 +00:00
Tom Lane 37da0ba0e0 Seems we forgot the installdirs target in this makefile. 2004-05-28 03:53:33 +00:00
Tom Lane 2ac8c96ecb Make sure elog behaves sanely if invoked before GUC initializes. 2004-05-28 03:11:15 +00:00
Tom Lane d7013b0f15 On WIN32, don't choke when setlocale(LC_MESSAGES, "") returns NULL.
Per report from Magnus.
2004-05-27 19:19:05 +00:00
Tom Lane 16974ee910 Get rid of the former rather baroque mechanism for propagating the values
of ThisStartUpID and RedoRecPtr into new backends.  It's a lot easier just
to make them all grab the values out of shared memory during startup.
This helps to decouple the postmaster from checkpoint execution, which I
need since I'm intending to let the bgwriter do it instead, and it also
fixes a bug in the Win32 port: ThisStartUpID wasn't getting propagated at
all AFAICS.  (Doesn't give me a lot of faith in the amount of testing that
port has gotten.)
2004-05-27 17:12:57 +00:00
Bruce Momjian bb44a7c525 pgindent files for Tom. 2004-05-27 15:07:41 +00:00
Bruce Momjian 83526ccf06 Cleanup for Win32 pgkill. 2004-05-27 14:39:33 +00:00
Bruce Momjian 6f21f4adaa Move pgkill out into /port so pg_ctl can use it on Win32. 2004-05-27 13:08:57 +00:00
Bruce Momjian d157b7bbc7 Document new pg_ctl 'kill' command, specificially for Win32. 2004-05-27 03:50:25 +00:00
Bruce Momjian f3d6d948c7 Change pg_ctl to be in C. This was the final shell script and is
helpful for the Win32 port.

Andrew Dunstan, with additions by Bruce.
2004-05-27 03:37:55 +00:00
Tom Lane c792cbcc26 Recommend ALTER TABLE ... TYPE as the best way to reclaim space occupied by deleted columns. The old method involving UPDATE and VACUUM FULL will be considerably less efficient. 2004-05-27 03:30:11 +00:00
Neil Conway 92b0b080eb Add an index entry for "Performance Tips". Patch from Alvaro Herrera. 2004-05-27 01:00:40 +00:00
Tom Lane 4646a8f32f Reduce the minimum allocable chunk size to 8 bytes (from 16). Now that
ListCells are only 8 bytes instead of 12 (on 4-byte-pointer machines
anyway), it's worth maintaining a separate freelist for 8-byte objects.
Remembering that alloc chunks carry 8 bytes of overhead, this should
reduce the net storage requirement for a long List by about a third.
2004-05-26 19:44:15 +00:00
Tom Lane 0858ed20d2 A couple other cosmetic cleanups in new List stuff. 2004-05-26 19:30:17 +00:00
Bruce Momjian 437063bdc4 Move setlocale() outside of NLS-only defines. 2004-05-26 19:00:31 +00:00
Tom Lane d96c374648 Use new forboth() macro to make loop coding a bit clearer. 2004-05-26 18:54:08 +00:00
Bruce Momjian ffef9b8c50 AIX doc addition:
> FWIW, the section on configuring kernel resources under various
> Unixen[1] doesn't have any documentation for AIX. If someone out there
> knows which knobs need to be tweaked, would they mind sending in a doc
> patch? (Or just specifying what needs to be done, and I'll add the
> SGML.)

After verifying that nobody wound up messing with the kernel
parameters, here's a docs patch...

 Chris Browne
2004-05-26 18:51:43 +00:00
Bruce Momjian b5cf1b6a21 Fix problems in pg_autovacuum:
1) temp table crash

2) Check send_query() function call return value.

Backpatch to 7.4.X.
2004-05-26 18:48:25 +00:00
Bruce Momjian 1cf9d7bd24 Renumber to prevent duplicate oids. Update catalog version. 2004-05-26 18:37:33 +00:00
Bruce Momjian 97d625dd1c *) inet_(client|server)_(addr|port)() and necessary documentation for
the four functions.


> Also, please justify the temp-related changes.  I was not aware that we
> had any breakage there.

patch-tmp-schema.txt contains the following bits:

*) Changes pg_namespace_aclmask() so that the superuser is always able
to create objects in the temp namespace.
*) Changes pg_namespace_aclmask() so that if this is a temp namespace,
objects are only allowed to be created in the temp namespace if the
user has TEMP privs on the database.  This encompasses all object
creation, not just TEMP tables.
*) InitTempTableNamespace() checks to see if the current user, not the
session user, has access to create a temp namespace.

The first two changes are necessary to support the third change.  Now
it's possible to revoke all temp table privs from non-super users and
limiting all creation of temp tables/schemas via a function that's
executed with elevated privs (security definer).  Before this change,
it was not possible to have a setuid function to create a temp
table/schema if the session user had no TEMP privs.

patch-area-path.txt contains:

*) Can now determine the area of a closed path.


patch-dfmgr.txt contains:

*) Small tweak to add the library path that's being expanded.

I was using $lib/foo.so and couldn't easily figure out what the error
message, "invalid macro name in dynamic library path" meant without
looking through the source code.  With the path in there, at least I
know where to start looking in my config file.

Sean Chittenden
2004-05-26 18:35:51 +00:00