summaryrefslogtreecommitdiff
path: root/src/backend/utils
Commit message (Collapse)AuthorAgeFilesLines
* Second pass over run-time configuration system. Adjust priorities on somePeter Eisentraut2000-06-221-50/+82
| | | | | | | | | | | | | | | | | | | option settings. Sort out SIGHUP vs BACKEND -- there is no total ordering here, so make explicit checks. Add comments explaining all of this. Removed permissions check on SHOW command. Add examine_subclass to the game, rename to SQL_inheritance to fit the official data model better. Adjust documentation. Standalone backend needs to reset all options before it starts. To facilitate that, have IsUnderPostmaster be set by the postmaster itself, don't wait for the magic -p switch. Also make sure that all environment variables and argv's survive init_ps_display(). Use strdup where necessary. Have initdb make configuration files (postgresql.conf, pg_hba.conf) mode 0600 -- having configuration files is no fun if you can't edit them.
* Make renaming a temp table behave sensibly. We don't need to touchTom Lane2000-06-201-25/+109
| | | | | the underlying table at all, just change the mapping entry ... but that logic was missing.
* Fix handling of type tuple associated with a temp relation. We haveTom Lane2000-06-201-6/+12
| | | | | | | | | to apply the tempname->realname mapping to type name lookup as well as relation name lookup, else the type tuple will not be found when wanted. This fixes bugs like this one: create temp table foo (f1 int); select foo.f2 from foo; ERROR: Unable to locate type name 'foo' in catalog
* Modify index-opening code to guarantee that the indexes of a relationTom Lane2000-06-191-6/+56
| | | | | | | are opened in a consistent order by different backends (I ordered them by index OID because that's easy, but any other consistent order would do as well). This avoids potential deadlock for index types that we acquire exclusive locks on ... ie, rtree.
* Clean up bogosities in pg_opclass, pg_amop, pg_amproc. There are amprocTom Lane2000-06-194-93/+56
| | | | | | | entries now for int8 and network hash indexes. int24_ops and int42_ops are gone. pg_opclass no longer contains multiple entries claiming to be the default opclass for the same datatype. opr_sanity regress test extended to catch errors like these in the future.
* Reimplement nodeMaterial to use a temporary BufFile (or even memory, if theTom Lane2000-06-184-14/+692
| | | | | | | | | | materialized tupleset is small enough) instead of a temporary relation. This was something I was thinking of doing anyway for performance, and Jan says he needs it for TOAST because he doesn't want to cope with toasting noname relations. With this change, the 'noname table' support in heap.c is dead code, and I have accordingly removed it. Also clean up 'noname' plan handling in planner --- nonames are either sort or materialize plans, and it seems less confusing to handle them separately under those names.
* Fix performance problems with pg_index lookups (see, for example,Tom Lane2000-06-171-8/+126
| | | | | | | | | | discussion of 5/19/00). pg_index is now searched for indexes of a relation using an indexscan. Moreover, this is done once and cached in the relcache entry for the relation, in the form of a list of OIDs for the indexes. This list is used by the parser and executor to drive lookups in the pg_index syscache when they want to know the properties of the indexes. Net result: index information will be fully cached for repetitive operations such as inserts.
* Clean out another pocket of functions called via nonspecific functionTom Lane2000-06-173-181/+159
| | | | | | | pointers, namely the catcache tuple fetch routines. Also get rid of the unused and possibly confusing 'size' field in struct cachedesc. Since it doesn't allow for variable-length fields, anyone who actually trusted it would likely be making a mistake...
* Remove fmgrstamp-h business -- not needed and confusingPeter Eisentraut2000-06-171-15/+3
| | | | | Add options to configure to automatically build for Kerberos support; no more editing of make files.
* Final #include cleanup.Bruce Momjian2000-06-153-12/+4
|
* Clean up #include's.Bruce Momjian2000-06-157-9/+21
|
* Add () around define -1.Bruce Momjian2000-06-141-2/+2
|
* Big warnings cleanup for Solaris/GCC. Down to about 40 now, butPeter Eisentraut2000-06-1415-96/+101
| | | | | | | | | | | we'll get there one day. Use `cat' to create aclocal.m4, not `aclocal'. Some people don't have automake installed. Only run the autoconf rule in the top-level GNUmakefile if the invoker specified `make configure', don't run it automatically because of CVS timestamp skew.
* I had overlooked the fact that some fmgr-callable functions return voidTom Lane2000-06-142-9/+5
| | | | | | --- ie, they're only called for side-effects. Add a PG_RETURN_VOID() macro and use it where appropriate. This probably doesn't change the machine code by a single bit ... it's just for documentation.
* Another batch of fmgr updates. I think I have gotten all old-styleTom Lane2000-06-1315-983/+860
| | | | | functions that take pass-by-value datatypes. Should be ready for port testing ...
* Rename rule CURRENT to OLD in source tree. Add mapping for backwardBruce Momjian2000-06-121-8/+8
| | | | compatiblity with old rules.
* Update rule dumper for the brave new world of ONLY.Tom Lane2000-06-101-8/+8
|
* The enclosed patch changes the behaviour of the "ordinal" ('TH') format forBruce Momjian2000-06-091-4/+7
| | | | | | | | | | | | | | | | | | | | | | to_char. I don't know about the rest of the world, but the "standard" in Australia is the following: 1st, 2nd, 3rd, 4th - 9th 10th - 19th 21st, 22nd, 23rd, 24th - 29th (similarly for 30s - 90s) 110th - 119th (and for all "teens") 121st, 122nd, 123rd, 124th - 129th I think you see the trend. The current code works fine except that it produces: 111st, 112nd, 113rd, 114th - 119th 211st, 212nd, 213rd, 214th - 219th ... and so on. Without knowing anything about what's supported (and what isn't) in the usual I18N libraries, should this type of behaviour be defined within the locales? Daniel Baldoni
* Cleanup to ensure good state of derived files in tarballs.Tom Lane2000-06-092-6/+13
|
* Another round of updates for new fmgr, mostly in the datetime code.Tom Lane2000-06-0911-1382/+1456
|
* Mark functions as static and ifdef NOT_USED as appropriate.Bruce Momjian2000-06-087-30/+52
|
* Mark ImmediateSharedRelationCacheInvalidate as NOT_USED.Bruce Momjian2000-06-081-1/+3
|
* Gen_fmgrtab.sh is strange: it is a platform dependent way (because it usesPeter Eisentraut2000-06-072-48/+135
| | | | | | | | | | | | | | | | | | | | | CPP) to create platform independent files. Unfortunately, that means that every config.status (or configure) run invariably causes a relink of the postmaster and also that we can't put these files in the distribution (usefully). So we make it a little smarter: when the output files already exist and it notices that it would recreate them in identical form, it doesn't touch them. In order to avoid re-running the make rule all the time we update a timestamp file instead. Update release_prep accordingly. Also make Gen_fmgrtab.sh use the awk that is detected at configure time, not necessarily named `awk' and have it check for exit statuses a little better. In other news... Remove USE_LOCALE from the templates, it was set to `no' everywhere anyway. Also remove YACC and YFLAGS from the templates, configure is smart enough to find bison or yacc itself. Use AC_PROG_YACC for that instead of the hand-crafted code. Do not set YFLAGS to `-d'. The make rules that need this flag should explicitly invoke it. YFLAGS should be a user variable. Update the makefiles to that effect.
* Re-order pg_listener index so it can later be used in an index scan.Bruce Momjian2000-06-071-4/+4
|
* Add index on pg_index.indrelid for Tom Lane.Bruce Momjian2000-06-071-2/+2
|
* init_fcache was being careless about using SearchSysCacheTuple resultTom Lane2000-06-061-4/+9
| | | | | | over multiple lookups --- it should use SearchSysCacheTupleCopy instead. This accounts for rare failures like 'init_fcache: null probin for procedure 481' when running concurrently with a VACUUM.
* Improve comments for SearchSysCacheTuple and SearchSysCacheTupleCopy.Tom Lane2000-06-061-4/+10
|
* Latest round of fmgr updates. All functions with bool,char, or int2Tom Lane2000-06-0516-1188/+1287
| | | | | | | inputs have been converted to newstyle. This should go a long way towards fixing our portability problems with platforms where char and short parameters are passed differently from int-width parameters. Still more to do for the Alpha port however.
* Removed ELOG_TIMESTAMPS #define in favor of two run-timePeter Eisentraut2000-06-042-49/+70
| | | | configuration options `Log_timestamp' and `Log_pid'.
* New ps display code, works on more platforms.Peter Eisentraut2000-06-044-10/+288
| | | | | | Install a default configuration file. Clean up some funny business in the config file code.
* Remove NT-specific file open defines by defining our own open macros forBruce Momjian2000-06-024-29/+9
| | | | "rb" and "wb".
* Correct portability problem introduced by yours truly --- I used aTom Lane2000-06-021-10/+18
| | | | | conditional expression x?y:z in an awk program. Seems old versions of awk don't have that ...
* Keep CVS quiet about derived file guc-file.c.Tom Lane2000-06-021-0/+1
|
* The definition for "ProcessConfigFile()" in guc-file.l does not matchBruce Momjian2000-06-011-2/+2
| | | | | | the prototype in guc.h. The following patch corrects that. Billy G. Allie
* Simplify overly-clever Make rule, which evidently confuses at leastTom Lane2000-06-011-12/+11
| | | | some versions of gmake (mine didn't do the right thing, anyway).
* The heralded `Grand Unified Configuration scheme' (GUC)Peter Eisentraut2000-05-317-558/+1177
| | | | | | | | | | | | | That means you can now set your options in either or all of $PGDATA/configuration, some postmaster option (--enable-fsync=off), or set a SET command. The list of options is in backend/utils/misc/guc.c, documentation will be written post haste. pg_options is gone, so is that pq_geqo config file. Also removed were backend -K, -Q, and -T options (no longer applicable, although -d0 does the same as -Q). Added to configure an --enable-syslog option. changed all callers from TPRINTF to elog(DEBUG)
* Third round of fmgr updates: eliminate calls using fmgr() andTom Lane2000-05-305-44/+74
| | | | | fmgr_faddr() in favor of new-style calls. Lots of cleanup of sloppy casts to use XXXGetDatum and DatumGetXXX ...
* Remove unused include files. Do not touch /port or includes used by defines.Bruce Momjian2000-05-3014-41/+14
|
* Convert array_map to use new fmgr interface.Tom Lane2000-05-292-57/+95
|
* Tweak fmgrtab generation so that the F_XXX macros that give OIDs forTom Lane2000-05-291-8/+13
| | | | | | | | | | built-in procedures are named after the prosrc field of pg_proc (ie, the actual C function name), not the proname field. This did not use to make a difference back when the two were always the same, but in the presence of overloaded proname values we'd best try to use the C name instead. AFAICT this change affects no existing code, but it is necessary to be able to get at some built-in functions that no macro was being generated for before.
* Repair problems with overrun of timezone name length. Increase MAXTZLENTom Lane2000-05-292-12/+9
| | | | | | to 10, and be consistent about whether it counts the trailing null (it does not). Also increase MAXDATELEN to be sure no buffer overflows are caused by the longer MAXTZLEN.
* Generated header files parse.h and fmgroids.h are now copied intoTom Lane2000-05-2912-38/+12
| | | | | the src/include tree, so that -I backend is no longer necessary anywhere. Also, clean up some bit rot in contrib tree.
* Second round of fmgr changes: triggers are now invoked in new style,Tom Lane2000-05-294-163/+140
| | | | CurrentTriggerData is history.
* Install fmgr rewrite doc as README file.Tom Lane2000-05-281-0/+409
| | | | Need to update user docs still ...
* First round of changes for new fmgr interface. fmgr itself and theTom Lane2000-05-2812-995/+1383
| | | | | | | key call sites are changed, but most called functions are still oldstyle. An exception is that the PL managers are updated (so, for example, NULL handling now behaves as expected in plperl and plpgsql functions). NOTE initdb is forced due to added column in pg_proc.
* Reduce eqsel()'s fudge-factor for estimating the frequency of valuesTom Lane2000-05-261-3/+6
| | | | | | | other than the most common value in a column. We had had 0.5, make it 0.1 to make it more likely that an indexscan will be chosen. Really need better statistics instead, but this should stem the bleeding meanwhile ...
* Fix too long syslog message problemTatsuo Ishii2000-05-261-1/+81
|
* I am attempting to integrate postgres (v 7.0) with an open sourceBruce Momjian2000-05-222-5/+6
| | | | | | | | | | | | | | | | | | | | project I am working on (Recall - a distributed, fault-tolerant, replicated, storage framework @ http://www.fault-tolerant.org). Recall is written in C++. I need to include the postgres headers and there are some problems when including the headers w/C++. Attached is a patch generated from postgres/src that fixes my problems. I was hoping to get this into the main source. It's very small (2k) and 3 files are changed: backend/utils/fmgr/fmgr.c, backend/utils/Gen_fmgrtab.sh.in, and include/access/tupdesc.h. In C++, you get a multiply defined symbol because the variable (FmgrInfo *fmgr_pl_finfo) is defined in the header (the patch moves it to the .c file). The other problem in tupdesc.h is the use of typeid is a problem in c++ (I renamed it to oidtypeid). Thanks, Neal Norwitz
* Repair memory leaks that caused CacheCxt to grow without bound. WeTom Lane2000-05-211-22/+23
| | | | | | | | | 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...
* Add debug code to aid in memory-leak tracking: if SHOW_MEMORY_STATS isTom Lane2000-05-212-5/+60
| | | | | defined then statistics about memory usage of all the global memory contexts are printed after each commit.