summaryrefslogtreecommitdiff
path: root/src/backend/utils/misc
Commit message (Collapse)AuthorAgeFilesLines
* Standardize on MAXPGPATH as the size of a file pathname buffer,Tom Lane1999-10-251-22/+28
| | | | | | | eliminating some wildly inconsistent coding in various parts of the system. I set MAXPGPATH = 1024 in config.h.in. If anyone is really convinced that there ought to be a configure-time test to set the value, go right ahead ... but I think it's a waste of time.
* Massimo's SET FSYNC and SHOW PG_OPTIONS changes, without SET QUERY_LIMIT.Bruce Momjian1999-09-271-0/+11
|
* Several changes here, not very related but touching some of the same files.Tom Lane1999-09-241-48/+23
| | | | | | | | | | | | | | | | | | | | | * Buffer refcount cleanup (per my "progress report" to pghackers, 9/22). * Add links to backend PROC structs to sinval's array of per-backend info, and use these links for routines that need to check the state of all backends (rather than the slow, complicated search of the ShmemIndex hashtable that was used before). Add databaseOID to PROC structs. * Use this to implement an interlock that prevents DESTROY DATABASE of a database containing running backends. (It's a little tricky to prevent a concurrently-starting backend from getting in there, since the new backend is not able to lock anything at the time it tries to look up its database in pg_database. My solution is to recheck that the DB is OK at the end of InitPostgres. It may not be a 100% solution, but it's a lot better than no interlock at all...) * In ALTER TABLE RENAME, flush buffers for the relation before doing the rename of the physical files, to ensure we don't get failures later from mdblindwrt(). * Update TRUNCATE patch so that it actually compiles against current sources :-(. You should do "make clean all" after pulling these changes.
* Mega-commit to make heap_open/heap_openr/heap_close take anTom Lane1999-09-181-6/+4
| | | | | | | | | | | | | | | | | additional argument specifying the kind of lock to acquire/release (or 'NoLock' to do no lock processing). Ensure that all relations are locked with some appropriate lock level before being examined --- this ensures that relevant shared-inval messages have been processed and should prevent problems caused by concurrent VACUUM. Fix several bugs having to do with mismatched increment/decrement of relation ref count and mismatched heap_open/close (which amounts to the same thing). A bogus ref count on a relation doesn't matter much *unless* a SI Inval message happens to arrive at the wrong time, which is probably why we got away with this sloppiness for so long. Repair missing grab of AccessExclusiveLock in DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi. Recommend 'make clean all' after pulling this update; I modified the Relation struct layout slightly. Will post further discussion to pghackers list shortly.
* Eliminate elog()'s hardwired limit on length of an error message.Tom Lane1999-09-111-15/+20
| | | | | | | | | This change seems necessary in conjunction with long queries, and it cleans up some bogosity in connection with long EXPLAIN texts anyway. Note that current libpq will accept any length error message (at least until it runs out of memory); prior versions have a limit of 8K, but will cleanly discard excess error text, so there shouldn't be any big compatibility problems with old clients.
* Move some system includes into c.h, and remove duplicates.Bruce Momjian1999-07-172-7/+1
|
* Final cleanupBruce Momjian1999-07-163-4/+6
|
* Change #include's to use <> and "" as appropriate.Bruce Momjian1999-07-151-4/+4
|
* Remove unused #includes in *.c files.Bruce Momjian1999-07-152-10/+1
|
* Clean up #include in /include directory. Add scripts for checking includes.Bruce Momjian1999-07-151-1/+2
|
* Reversed out Massimo patch.Bruce Momjian1999-06-121-7/+4
|
* I don't like last minute patches before the final freeze, but I believe thatBruce Momjian1999-06-121-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this one could be useful for people experiencing out-of-memory crashes while executing queries which retrieve or use a very large number of tuples. The problem happens when storage is allocated for functions results used in a large query, for example: select upper(name) from big_table; select big_table.array[1] from big_table; select count(upper(name)) from big_table; This patch is a dirty hack that fixes the out-of-memory problem for the most common cases, like the above ones. It is not the final solution for the problem but it can work for some people, so I'm posting it. The patch should be safe because all changes are under #ifdef. Furthermore the feature can be enabled or disabled at runtime by the `free_tuple_memory' options in the pg_options file. The option is disabled by default and must be explicitly enabled at runtime to have any effect. To enable the patch add the follwing line to Makefile.custom: CUSTOM_COPT += -DFREE_TUPLE_MEMORY To enable the option at runtime add the following line to pg_option: free_tuple_memory=1 Massimo
* trace.patch (compilation error)Marc G. Fournier1999-06-051-7/+7
| | | | | | | | the gettimeofday doesn't compile under Linux with glibc2 because the DST_NONE constant is no more defined. It seems that this code (written by me) has always be wrong but for some reason working. From: Massimo Dal Zotto <dz@cs.unitn.it>
* Make functions static or NOT_USED as appropriate.Bruce Momjian1999-05-261-1/+5
|
* pgindent run over code.Bruce Momjian1999-05-252-10/+12
|
* Modify backend switch parsing to prevent 'insecure' switchesTom Lane1999-05-221-2/+6
| | | | | from being accepted when they are passed from client connection request. Get rid of a couple that no longer do anything (like -P).
* Changed debug options:Jan Wieck1999-05-111-0/+3
| | | | | | | | | -d4 now prints compressed trees from nodeToString() -d5 prints pretty trees via nodeDisplay() new pg_options: pretty_plan, pretty_parse, pretty_rewritten Jan
* Fix snprintf with strings, and nextval('"Aa"');Bruce Momjian1999-03-161-1/+1
|
* Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian1999-02-133-5/+5
|
* Add missing variable, per Massimo.Tom Lane1999-01-171-0/+2
|
* Apply Win32 patch from Horak Daniel.Bruce Momjian1999-01-172-1/+9
|
* Some security, since we now have vsnprintf, I remade an old patchBruce Momjian1999-01-011-4/+4
| | | | | | | with some extra ugly sprintfs fixed. More work in this area is needed still. Göran Thyni
* New HeapTuple structure/interface.Vadim B. Mikheev1998-11-271-6/+6
|
* Reverse out addition of snprintf.Bruce Momjian1998-10-281-8/+4
|
* Fix for tprintf overruns from Göran Thyni.Bruce Momjian1998-10-271-4/+8
|
* The problem is that read_pg_options needs DataDir to read its file butBruce Momjian1998-10-161-0/+5
| | | | | | | | | | DataDir is set after read_pg_options if postgres is called interactively. If postgres is forked by postgres DataDir is read from the PGDATA enviromnent variable set by the postmaster and this explains while the bug disappears. I have written this patch but I don't like it. Any better idea? Massimo Dal Zotto
* Substantial rewrite of async.c to avoid problems with non-reentrant stdioTom Lane1998-10-061-4/+0
| | | | | and possibly other problems. Minor changes in xact.c and postgres.c's main loop to support new handling of async NOTIFY.
* Fix ifdef.Bruce Momjian1998-09-031-2/+2
|
* > Yikes, that is certainly not standard C. I have never seen thatBruce Momjian1998-09-031-0/+28
| | | | | | | | | | before. > Looks like a GNU-ism. I nice one, but still a GNU-ism. Sorry, I didn't know it is a GNU extension. I have written this patch which should fix the problem. Let me know if you still have problems. Massimo Dal Zotto
* Fix for indexing problems.Bruce Momjian1998-09-021-2/+0
|
* OK, folks, here is the pgindent output.Bruce Momjian1998-09-013-92/+108
|
* Renaming cleanup, no pgindent yet.Bruce Momjian1998-09-011-3/+3
|
* cvs add'd two files for the tprintf() patch...Marc G. Fournier1998-08-251-0/+350
|
* From: Massimo Dal Zotto <dz@cs.unitn.it>Marc G. Fournier1998-08-251-2/+2
| | | | | | | | | | | | > 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.
* o note that now pg_database has a new attribuite "encoding" evenBruce Momjian1998-08-241-3/+20
| | | | | | | | | | | | | | | | | | | | | | 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
* heap_fetch requires buffer pointer, must be released; heap_getnextBruce Momjian1998-08-192-9/+6
| | | | | | | | | | | | | 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;
* Change owner from oid to int4 type.Bruce Momjian1998-08-111-3/+3
|
* Use Snapshot in heap access methods.Vadim B. Mikheev1998-07-271-24/+4
|
* From: t-ishii@sra.co.jpMarc G. Fournier1998-07-262-8/+17
| | | | | | | | | 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).
* I really hope that I haven't missed anything in this one...Marc G. Fournier1998-07-242-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Cleanup Name usage.Bruce Momjian1998-07-201-4/+2
|
* Remove un-needed braces around single statements.Bruce Momjian1998-06-151-3/+1
|
* Require #define variable ALLOW_ABSOLUTE_DBPATHS if absolute paths areThomas G. Lockhart1998-05-291-1/+5
| | | | | | | | allowed to be used for alternate database locations. Probably best to default to not allowed, as now, since there are security and integrity issues which should be considered carefully before opening things up. Will update docs to discuss this issue.
* This patch...Bruce Momjian1998-04-271-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Hi,Bruce Momjian1998-04-061-5/+3
| | | | | | | | | | | | | | | | | | | | | | 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
* pgindent run before 6.3 release, with Thomas' requested changes.Bruce Momjian1998-02-261-34/+38
|
* From: Jan Wieck <jwieck@debis.com>Marc G. Fournier1998-02-251-3/+3
| | | | | | | | | | seems that my last post didn't make it through. That's good since the diff itself didn't covered the renaming of pg_user.h to pg_shadow.h and it's new content. Here it's again. The complete regression test passwd with only some float diffs. createuser and destroyuser work. pg_shadow cannot be read by ordinary user.
* Inline fastgetattr and others so data access does not use functionBruce Momjian1998-01-311-3/+3
| | | | calls.
* Goodbye ABORT. Hello ERROR for all errors.Bruce Momjian1998-01-071-2/+2
|
* Change elog(WARN) to elog(ERROR) and elog(ABORT).Bruce Momjian1998-01-051-2/+2
|