summaryrefslogtreecommitdiff
path: root/src/backend/commands/copy.c
AgeCommit message (Collapse)Author
1999-11-27COPY to a relation should keep write lock till transaction commit.Tom Lane
Thanks to Hiroshi for spotting the problem.
1999-11-22Add system indexes to match all caches.Bruce Momjian
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-21Change backend-side COPY to write files with permissions 644 not 666Tom Lane
(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-09-27Cancel query support from MassimoBruce Momjian
1999-09-18Mega-commit to make heap_open/heap_openr/heap_close take anTom Lane
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.
1999-09-11Eliminate query length limitation imposed by pg_client_to_serverTom Lane
and pg_server_to_client. Eliminate copy.c's restriction on the length of a single attribute.
1999-07-22Plug several holes in backend's ability to cope withTom Lane
unexpected loss of connection to frontend.
1999-07-17 Move some system includes into c.h, and remove duplicates.Bruce Momjian
1999-07-16Final cleanup.Bruce Momjian
1999-07-15Change #include's to use <> and "" as appropriate.Bruce Momjian
1999-07-15Remove unused #includes in *.c files.Bruce Momjian
1999-07-03Fix to prevent too large tuple from being created.Bruce Momjian
1999-06-12Fix critical error noticed by Massimo: copy.c used to have aTom Lane
special hack to ensure it would close its output file even after failure due to elog(ERROR) partway through the copy. This is now unnecessary because fd.c takes care of cleaning up open files at transaction abort; worse, after fd.c closed the file copy.c would try to do so *again* at the start of the next COPY command. This would result in havoc in most implementations of stdio library.
1999-05-291. Run all pg_dump queries in single serializable transaction.Vadim B. Mikheev
2. Get rid of locking when updating statistics in vacuum. 3. Use QuerySnapshot in COPY TO and call SetQuerySnashot in main tcop loop before FETCH and COPY TO.
1999-05-26Make functions static or NOT_USED as appropriate.Bruce Momjian
1999-05-25pgindent run over code.Bruce Momjian
1999-05-10Change error messages to oids come out as %u and not %d. Change has noBruce Momjian
real affect now.
1999-05-03here are some patches for 6.5.0 which I already submitted but have neverBruce Momjian
been applied. The patches are in the .tar.gz attachment at the end: varchar-array.patch this patch adds support for arrays of bpchar() and varchar(), which where always missing from postgres. These datatypes can be used to replace the _char4, _char8, etc., which were dropped some time ago. block-size.patch this patch fixes many errors in the parser and other program which happen with very large query statements (> 8K) when using a page size larger than 8192. This patch is needed if you want to submit queries larger than 8K. Postgres supports tuples up to 32K but you can't insert them because you can't submit queries larger than 8K. My patch fixes this problem. The patch also replaces all the occurrences of `8192' and `1<<13' in the sources with the proper constants defined in include files. You should now never find 8192 hardwired in C code, just to make code clearer. -- Massimo Dal Zotto
1999-04-25Revise backend libpq interfaces so that messages to the frontendTom Lane
can be generated in a buffer and then sent to the frontend in a single libpq call. This solves problems with NOTICE and ERROR messages generated in the middle of a data message or COPY OUT operation.
1999-02-13Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian
1999-02-07Changed ExecConstraints() and ExecRelCheck() to cache the constraintsJan Wieck
qualification expression trees in the execution state. Prevents from memory exhaustion on INSERT, UPDATE or COPY to tables that have CHECK constraints. Speedup against the variant using freeObject() is more than factor 2. Jan
1999-02-03Cleanup of source files where 'return' or 'var =' is alone on a line.Bruce Momjian
1999-02-02Add TEMP tables/indexes. Add COPY pfree(). Other cleanups.Bruce Momjian
1999-02-01Fixed growing of backend due to not pfree()'d data on COPY FROMJan Wieck
Fixed growing of backend if BEFORE DELETE trigger returns heap tuple different from trigtuple. Jan
1999-01-23Add explicit buffering in backend libpq, to compensate forTom Lane
buffering lost by not going through stdio anymore for client I/O.
1999-01-17Apply Win32 patch from Horak Daniel.Bruce Momjian
1999-01-11From: Magnus Hagander <mha@sollentuna.net>Marc G. Fournier
Here is a first patch to cleanup the backend side of libpq. This patch removes all external dependencies on the "Pfin" and "Pfout" that are declared in pqcomm.h. These variables are also changed to "static" to make sure. Almost all the change is in the handler of the "copy" command - most other areas of the backend already used the correct functions. This change will make the way for cleanup of the internal stuff there - now that all the functions accessing the file descriptors are confined to a single directory.
1998-12-15Initial MVCC code.Vadim B. Mikheev
New code for locking buffer' context.
1998-11-27New HeapTuple structure/interface.Vadim B. Mikheev
1998-10-26Get rid of some minor compiler warnings.Tom Lane
(HP's cc doesn't like if you forward-declare a routine static, and then don't make it static in the actual definition...)
1998-09-23Allow 8-key indexes.Bruce Momjian
1998-09-08AIX align fix.Bruce Momjian
1998-09-07Alignment cleanup so no more massive switch statements for alignment,Bruce Momjian
just two macros.
1998-09-01OK, folks, here is the pgindent output.Bruce Momjian
1998-09-01Renaming cleanup, no pgindent yet.Bruce Momjian
1998-08-29Prevent file descriptor leak from failed COPY.Bruce Momjian
1998-08-29Fix scanner name length trimming.Bruce Momjian
1998-08-29This is the first (of hopefully few) AIX port patches. This patchBruce Momjian
was tested with Linux/GCC. I still have some issues with with the snprintf() function. David Hartwig
1998-08-24o note that now pg_database has a new attribuite "encoding" evenBruce Momjian
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
1998-08-19heap_fetch requires buffer pointer, must be released; heap_getnextBruce Momjian
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;
1998-07-27Use Snapshot in heap access methods.Vadim B. Mikheev
1998-07-26From: t-ishii@sra.co.jpMarc G. Fournier
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).
1998-07-24I really hope that I haven't missed anything in this one...Marc G. Fournier
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.
1998-07-15Fix for COPY problem and atttypmod.Bruce Momjian
1998-07-12Change atttypmod from int16 to int32, for Thomas.Bruce Momjian
1998-06-19From: t-ishii@sra.co.jpMarc G. Fournier
As mentioned around line 1153 in backend/commands/copy.c, the method of array checking is not perfect. test=> create table t1 (i text); test=> insert into t1 values('{\\.}'); INSERT 2645600 1 test=> select * from t1; i ----- {\\.} (2 rows) test=> copy t1 to '/tmp/aaa'; test=> copy t1 from '/tmp/aaa'; ERROR: CopyReadAttribute - end of record marker corrupted Copy cannot read data produced by itself!
1998-06-15Remove un-needed braces around single statements.Bruce Momjian
1998-03-30There's a patch attached to fix gcc 2.8.x warnings, except for theBruce Momjian
yyerror ones from bison. It also includes a few 'enhancements' to the C programming style (which are, of course, personal). The other patch removes the compilation of backend/lib/qsort.c, as qsort() is a standard function in stdlib.h and can be used any where else (and it is). It was only used in backend/optimizer/geqo/geqo_pool.c, backend/optimizer/path/predmig.c, and backend/storage/page/bufpage.c > > Some or all of these changes might not be appropriate for v6.3, since we > > are in beta testing and since they do not affect the current functionality. > > For those cases, how about submitting patches based on the final v6.3 > > release? There's more to come. Please review these patches. I ran the regression tests and they only failed where this was expected (random, geo, etc). Cheers, Jeroen
1998-02-26pgindent run before 6.3 release, with Thomas' requested changes.Bruce Momjian
1998-02-25From: Jan Wieck <jwieck@debis.com>Marc G. Fournier
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.