summaryrefslogtreecommitdiff
path: root/src/backend/utils
Commit message (Collapse)AuthorAgeFilesLines
* Repair usage of the OVERLAPS operator.Thomas G. Lockhart2000-12-031-3/+111
| | | | | | | | Allow some operator-like tokens to be used as function names. Flesh out support for time, timetz, and interval operators and interactions. Regression tests pass, but non-reference-platform horology test results will need to be updated.
* Final(?) GUC clean-up. Update psql tab completion.Peter Eisentraut2000-12-031-4/+4
|
* Disable elog(ERROR|FATAL) in signal handlers inVadim B. Mikheev2000-12-031-2/+3
| | | | critical sections of code.
* Make elog() switch to ErrorContext while invoking libpq output routines,Tom Lane2000-12-011-10/+27
| | | | | | since those routines may do palloc's. We want to be fairly sure we can send the error message to the client even under low-memory conditions. That's what we stashed away 8K in ErrorContext for, after all ...
* Pursuant to a pghackers discussion back around 11-Jul-00, get rid of aset.c'sTom Lane2000-12-011-167/+204
| | | | | | | not-very-good handling of mid-size allocation requests. Do everything via either the "small" case (chunk size rounded up to power of 2) or the "large" case (pass it straight off to malloc()). Increase the number of freelists a little to set the breakpoint between these behaviors at 8K.
* It seems appropriate that the extended MEMORY_CONTEXT_CHECKING codeTom Lane2000-12-011-16/+27
| | | | | immediately uncovered three of Karel's own bugs, including a routine that scribbled on its input (naughty naughty!)
* Clean up MEMORY_CONTEXT_CHECKING code, and apply it more thoroughly. Also,Tom Lane2000-12-011-170/+202
| | | | | apply Karel Zak's patch to recycle residual space in an exhausted allocation block. (Bet you thought I'd forgot about that, Karel?)
* Make all commands that link a program look likePeter Eisentraut2000-11-301-4/+4
| | | | | | | $(CC) $(CFLAGS) $(LDFLAGS) <object files> <extra-libraries> $(LIBS) -o $@ This form seemed to be the most portable, readable, and logical, but in any case it's better than having a dozen different ones in the tree.
* Remove VARLENA_FIXED_SIZE hack, which is irreversibly broken now thatTom Lane2000-11-301-1/+49
| | | | | | | | 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.
* No more #ifdef XLOG.Vadim B. Mikheev2000-11-302-21/+3
|
* XLOG stuff for sequences.Vadim B. Mikheev2000-11-301-4/+9
| | | | CommitDelay in guc.c
* Get rid of not-very-portable fcntl(F_SETLK) mechanism for locking the UnixTom Lane2000-11-292-188/+214
| | | | | | | | | socket file, in favor of having an ordinary lockfile beside the socket file. Clean up a few robustness problems in the lockfile code. If postmaster is going to reject a connection request based on database state, it will now tell you so before authentication exchange not after. (Of course, a failure after is still possible if conditions change meanwhile, but this makes life easier for a yet-to-be-written pg_ping utility.)
* aclitemout() shouldn't coredump when it finds an ACL itemTom Lane2000-11-281-10/+21
| | | | | for a now-vanished group. Instead, display the numeric group ID, same as it does for vanished users.
* Significant cleanups in SysV IPC handling (shared mem and semaphores).Tom Lane2000-11-281-24/+8
| | | | | | | | | | | IPC key assignment will now work correctly even when multiple postmasters are using same logical port number (which is possible given -k switch). There is only one shared-mem segment per postmaster now, not 3. Rip out broken code for non-TAS case in bufmgr and xlog, substitute a complete S_LOCK emulation using semaphores in spin.c. TAS and non-TAS logic is now exactly the same. When deadlock is detected, "Deadlock detected" is now the elog(ERROR) message, rather than a NOTICE that comes out before an unhelpful ERROR.
* Fix for inserting/copying longer multibyte strings into bpchar dataTatsuo Ishii2000-11-261-2/+20
| | | | types.
* Unicode conversion fix suggested by Jan Varga...Tatsuo Ishii2000-11-269-11/+565
| | | | | | | | | | | | | | | | | | | | -------------------------------------------------- Subject: Bug in unicode conversion ... From: Jan Varga <varga@utcru.sk> To: t-ishii@sra.co.jp Date: Sat, 18 Nov 2000 17:41:20 +0100 (CET) Hi, I tried this new feature in PostgreSQL. I found one bug. Script UCS_to_8859.pl skips input lines which 1. code <0x80 or 2. ucs <0x100 I think second one is not good idea because some codes in ISO8859-2 have ucs <0x100 (e.g. 0xE9 - 0x00E9) --------------------------------------------------
* Make PGLC_setlocale() static, and document that it can't be used safelyTom Lane2000-11-252-45/+57
| | | | | | | | | | | for any other purpose than PGLC_localeconv()'s internal save/restore of locale settings. Fix cash.c to call PGLC_localeconv() rather than making a direct call to localeconv() --- the old way, if PGLC_localeconv() had already cached a locale result, it would be overwritten by the first cash_in or cash_out operation, leading to wrong-locale results later. Probably no demonstrable bug today, since we only appear to be looking at the LC_MONETARY results which should be the same anyway, but definitely a gotcha waiting to strike.
* Fix some portability bugs I'd introduced into inet/cidr code ---Tom Lane2000-11-251-6/+36
| | | | shifting by the word width is not defined by ANSI C...
* Store current LC_COLLATE and LC_CTYPE settings in pg_control during initdb;Tom Lane2000-11-252-9/+54
| | | | | | | | | | re-adopt these settings at every postmaster or standalone-backend startup. This should fix problems with indexes becoming corrupt due to failure to provide consistent locale environment for postmaster at all times. Also, refuse to start up a non-locale-enabled compilation in a database originally initdb'd with a non-C locale. Suppress LIKE index optimization if locale is not "C" or "POSIX" (are there any other locales where it's safe?). Issue NOTICE during initdb if selected locale disables LIKE optimization.
* Fix elog logic so that error messages displayed during initdb (orTom Lane2000-11-251-37/+26
| | | | | other standalone-backend situations) are not duplicated. Remove some dead code, add some comments, too.
* here is a patch for formatting.c (to_char/timestampt()), for 7.1Bruce Momjian2000-11-251-95/+179
| | | | | | | | | | | | it fixing Y,YY,YYY,YYYY conversion, the docs and regress tests update are included too. During the patch testing I found small bug in miscadmin.h in convertstr() declaration. Here it's fixed too. Thanks Karel
* > > Looking some more, I found some other places that need a space (IBruce Momjian2000-11-251-2/+11
| | | | | | | | | | | | | | > > suspect...), so here is an updated patch. > > This seems like the wrong way to go about it, because anytime anyone > changes any elog output anywhere, we'll risk another failure. If > syslog can't cope with empty lines, I think the right fix is for the > output-to-syslog routine to change the data just before sending --- > then there is only one place to fix. See the syslog output routine in > src/backend/utils/error/elog.c. Makes sense. Here's a new patch, now the output even looks better: Larry Rosenman
* Rename GUC name from unixsocket to unix_socket_directoryBruce Momjian2000-11-251-2/+2
|
* A catalog cache that never caches isn't much of a cache :-(. Mea culpa.Tom Lane2000-11-241-13/+15
| | | | Thanks to Brian Hirt for pointing out the performance lossage.
* Fix for bitsubstr when third argument is missing (i.e., -1).Peter Eisentraut2000-11-221-1/+4
| | | | From Adriaan Joubert <a.joubert@albourne.com>
* Put external declarations into header files.Peter Eisentraut2000-11-212-11/+2
|
* Add missing #include <errno.h>.Tom Lane2000-11-211-3/+4
|
* keep relations open until they are no longer needed.Hiroshi Inoue2000-11-211-5/+9
|
* Make oidin/oidout produce and consume unsigned representation of Oid,Tom Lane2000-11-211-27/+68
| | | | | | | | | | | | rather than just being aliases for int4in/int4out. Give type Oid a full set of comparison operators that do proper unsigned comparison, instead of reusing the int4 comparators. Since pg_dump is now doing unsigned comparisons of OIDs, it is now *necessary* that we play by the rules here. In fact, given that btoidcmp() has been doing unsigned comparison for quite some time, it seems likely that we have index- corruption problems in 7.0 and before once the Oid counter goes past 2G. Fixing these operators is a necessary step before we can think about 8-byte Oid, too.
* Revise handling of oldstyle/newstyle functions per recent discussionsTom Lane2000-11-204-150/+250
| | | | | | | | | in pghackers list. Support for oldstyle internal functions is gone (no longer needed, since conversion is complete) and pg_language entry 'internal' now implies newstyle call convention. pg_language entry 'newC' is gone; both old and newstyle dynamically loaded C functions are now called language 'C'. A newstyle function must be identified by an associated info routine. See src/backend/utils/fmgr/README.
* Compile WAL by default.Vadim B. Mikheev2000-11-201-2/+2
|
* Fix typo.Tom Lane2000-11-191-1/+1
|
* Update README with proposed new method for determining calling conventionTom Lane2000-11-191-83/+173
| | | | | | of user-defined functions (forget 'C' vs 'newC', instead require an info function to be present for new-style functions). Also update some other out-of-date commentary.
* Modify input and output routines to print plain binary strings without anyPeter Eisentraut2000-11-181-17/+32
| | | | 'b' prefixes.
* Suppress 'comparison-is-always-true' warning on machinesTom Lane2000-11-181-2/+2
| | | | where char is signed by default.
* Modify locale code to defend against possibility that it was compiledTom Lane2000-11-181-18/+32
| | | | | | | | | | with an -fsigned-char/-funsigned-char setting opposite to that of libc, thus breaking the convention that 'undefined' values returned by localeconv() are represented by CHAR_MAX. It is sheer stupidity that gcc even has such a switch --- it's just as bad as the structure-packing control switches offered by the more brain-dead PC compilers --- and as for the behavior of Linux distribution vendors who set RPM_OPT_FLAGS differently from the way they built libc, well, words fail me...
* Fix bugs in EUC_TW support. This fix includes patches contributedTatsuo Ishii2000-11-171-4/+11
| | | | | by Chih-Chang Hsi. See "A Patch for MIC to EUC_TW code converting in mb support" posting in pgsql-patches list dated 09 Nov 2000.
* Fix spelling errors in error message.Tom Lane2000-11-171-3/+3
|
* Change SearchSysCache coding conventions so that a reference count isTom Lane2000-11-1618-559/+738
| | | | | | | maintained for each cache entry. A cache entry will not be freed until the matching ReleaseSysCache call has been executed. This eliminates worries about cache entries getting dropped while still in use. See my posting to pg-hackers of even date for more info.
* Print bit values as binary strings (not hex)Peter Eisentraut2000-11-161-1/+8
|
* Make pgsql compile on FreeBSD-alpha.Bruce Momjian2000-11-161-7/+7
| | | | | | | | | | | | | | | | | | Context diff this time. Remove -m486 compile args for FreeBSD-i386, compile -O2 on i386. Compile with only -O on alpha for codegen safety. Make the port use the TEST_AND_SET for alpha and i386 on FreeBSD. Fix a lot of bogus string formats for outputting pointers (cast to int and %u/%x replaced with no cast and %p), and 'Size'(size_t) are now cast to 'unsigned long' and output with %lu/ Remove an unused variable. Alfred Perlstein
* Syslog Facility PatchBruce Momjian2000-11-161-15/+111
| | | | | | Here is one with a stray character removed. Larry Rosenman
* Rename parameter "hostname" to "virtual_host". Seemed very ambiguous...Peter Eisentraut2000-11-151-2/+2
|
* Clean up array-dimensions parser a bit.Tom Lane2000-11-141-41/+57
| | | | This code still needs a lot of love, however ...
* Small polishing of syslog facility and ident settings. Only allow settingPeter Eisentraut2000-11-142-15/+19
| | | | | at postmaster start, rename syslog_progid to syslog_ident, since syslog itself uses that term, fix doc markup.
* Extend CREATE DATABASE to allow selection of a template database to beTom Lane2000-11-143-32/+26
| | | | | | | | | | cloned, rather than always cloning template1. Modify initdb to generate two identical databases rather than one, template0 and template1. Connections to template0 are disallowed, so that it will always remain in its virgin as-initdb'd state. pg_dumpall now dumps databases with restore commands that say CREATE DATABASE foo WITH TEMPLATE = template0. This allows proper behavior when there is user-added data in template1. initdb forced!
* Rename PortName to PortNumber.Bruce Momjian2000-11-141-3/+3
|
* Ok, You guys are probably tired of me, BUT, here is another one, thatBruce Momjian2000-11-132-3/+48
| | | | | | | | | | | | | adds the facility to set the program name used in syslog. (this includes the other ones). One gotcha, the parser doesn't like special characters in strings. For example, i tried to use pg-test, and if failed the parse coming from the postgresql.conf file. I don't think it's a showstopper.. Larry Rosenman
* UUNET is looking into offering PostgreSQL as a part of a managed webBruce Momjian2000-11-131-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hosting product, on both shared and dedicated machines. We currently offer Oracle and MySQL, and it would be a nice middle-ground. However, as shipped, PostgreSQL lacks the following features we need that MySQL has: 1. The ability to listen only on a particular IP address. Each hosting customer has their own IP address, on which all of their servers (http, ftp, real media, etc.) run. 2. The ability to place the Unix-domain socket in a mode 700 directory. This allows us to automatically create an empty database, with an empty DBA password, for new or upgrading customers without having to interactively set a DBA password and communicate it to (or from) the customer. This in turn cuts down our install and upgrade times. 3. The ability to connect to the Unix-domain socket from within a change-rooted environment. We run CGI programs chrooted to the user's home directory, which is another reason why we need to be able to specify where the Unix-domain socket is, instead of /tmp. 4. The ability to, if run as root, open a pid file in /var/run as root, and then setuid to the desired user. (mysqld -u can almost do this; I had to patch it, too). The patch below fixes problem 1-3. I plan to address #4, also, but haven't done so yet. These diffs are big enough that they should give the PG development team something to think about in the meantime :-) Also, I'm about to leave for 2 weeks' vacation, so I thought I'd get out what I have, which works (for the problems it tackles), now. With these changes, we can set up and run PostgreSQL with scripts the same way we can with apache or proftpd or mysql. In summary, this patch makes the following enhancements: 1. Adds an environment variable PGUNIXSOCKET, analogous to MYSQL_UNIX_PORT, and command line options -k --unix-socket to the relevant programs. 2. Adds a -h option to postmaster to set the hostname or IP address to listen on instead of the default INADDR_ANY. 3. Extends some library interfaces to support the above. 4. Fixes a few memory leaks in PQconnectdb(). The default behavior is unchanged from stock 7.0.2; if you don't use any of these new features, they don't change the operation. David J. MacKenzie
* Keep track of the last active slot in the shared ProcState array, soTom Lane2000-11-122-64/+23
| | | | | | | | | that search loops only have to scan that far and not through all maxBackends entries. This eliminates a performance penalty for setting maxBackends much higher than the average number of active backends. Also, eliminate no-longer-used 'backend tag' concept. Remove setting of environment variables at backend start (except for CYR_RECODE), since none of them are being examined by the backend any longer.