summaryrefslogtreecommitdiff
path: root/src/backend/commands/copy.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix performance problems with pg_index lookups (see, for example,Tom Lane2000-06-171-58/+24
| | | | | | | | | | 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 up #include's.Bruce Momjian2000-06-151-1/+2
|
* Big warnings cleanup for Solaris/GCC. Down to about 40 now, butPeter Eisentraut2000-06-141-3/+3
| | | | | | | | | | | 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.
* Update for 7.0.2.Bruce Momjian2000-06-051-2/+2
|
* Latest round of fmgr updates. All functions with bool,char, or int2Tom Lane2000-06-051-3/+6
| | | | | | | 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.
* Remove NT-specific file open defines by defining our own open macros forBruce Momjian2000-06-021-12/+3
| | | | "rb" and "wb".
* Third round of fmgr updates: eliminate calls using fmgr() andTom Lane2000-05-301-14/+9
| | | | | 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-301-3/+1
|
* First round of changes for new fmgr interface. fmgr itself and theTom Lane2000-05-281-2/+2
| | | | | | | 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 COPY IN lock from AccessExclusive to a more reasonableTom Lane2000-05-181-6/+8
| | | | | | | RowExclusive (my fault). Also, install a check to prevent people from trying COPY BINARY to stdout/from stdin. No way that will work unless we redesign the frontend COPY protocol ... which is not worth the trouble in the near future ...
* Allow COPY WITH OIDS to system OID values --- rely on unique indexes toTom Lane2000-04-161-15/+17
| | | | | prevent duplicate OIDs from being added. Clean up redundant error messages.
* Ye-old pgindent run. Same 4-space tabs.Bruce Momjian2000-04-121-43/+52
|
* Hmm, absolute pathnames for the copy makes sense. I'll whip up thatBruce Momjian2000-03-231-1/+6
| | | | | | | patch in a second. Should be sufficent to just make sure the first character is a '/', right? Ross J. Reedstrom
* Trial implementation of ALTER DROP COLUMN.Hiroshi Inoue2000-03-091-1/+43
| | | | | | They are #ifdef'd. Add -D_DROP_COLUMN_HACK__ compile option to evaluate it.
* contrib-array.patchBruce Momjian2000-02-131-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this is an old patch which I have already submitted and never seen in the sources. It corrects the datatype oids used in some iterator functions. This bug has been reported to me by many other people. contrib-datetime.patch some code contributed by Reiner Dassing <dassing@wettzell.ifag.de> contrib-makefiles.patch fixes all my contrib makefiles which don't work with some compilers, as reported to me by another user. contrib-miscutil.patch an old patch for one of my old contribs. contrib-string.patch a small change to the c-like text output functions. Now the '{' is escaped only at the beginning of the string to distinguish it from arrays, and the '}' is no more escaped. elog-lineno.patch adds the current lineno of CopyFrom to elog messages. This is very useful when you load a 1 million tuples table from an external file and there is a bad value somehere. Currently you get an error message but you can't know where is the bad data. The patch uses a variable which was declared static in copy.c. The variable is now exported and initialized to 0. It is always cleared at the end of the copy or at the first elog message or when the copy is canceled. I know this is very ugly but I can't find any better way of knowing where the copy fails and I have this problem quite often. plperl-makefile.patch fixes a typo in a makefile, but the error must be elsewhere because it is a file generated automatically. Please have a look. tprintf-timestamp.patch restores the original 2-digit year format, assuming that the two century digits don't carry much information and that '000202' is easier to read than 20000202. Being only a log file it shouldn't break anything. Please apply the patches before the next scheduled code freeze. I also noticed that some of the contribs don't compile correcly. Should we ask people to fix their code or rename their makefiles so that they are ignored by the top makefile? -- Massimo Dal Zotto
* Ooops ... 'char c' can hold a char, but it can't hold EOF ...Tom Lane2000-02-091-2/+2
|
* Add:Bruce Momjian2000-01-261-2/+3
| | | | | | * Portions Copyright (c) 1996-2000, PostgreSQL, Inc to all files copyright Regents of Berkeley. Man, that's a lot of files.
* Change a few routines into macros to improve speed of COPY IN inner loop.Tom Lane2000-01-221-33/+20
|
* Fix handling of NULL constraint conditions: per SQL92 spec, a NULL resultTom Lane2000-01-191-2/+2
| | | | | | | | | from a constraint condition does not violate the constraint (cf. discussion on pghackers 12/9/99). Implemented by adding a parameter to ExecQual, specifying whether to return TRUE or FALSE when the qual result is really NULL in three-valued boolean logic. Currently, ExecRelCheck is the only caller that asks for TRUE, but if we find any other places that have the wrong response to NULL, it'll be easy to fix them.
* Rearrange coding in COPY so that expansible string buffer for data beingTom Lane2000-01-161-73/+95
| | | | | | | | | read is reused for successive attributes, instead of being deleted and recreated from scratch for each value read in. This reduces palloc/pfree overhead a lot. COPY IN still seems to be noticeably slower than it was in 6.5 --- we need to figure out why. This change takes care of the only major performance loss I can see in copy.c itself, so the performance problem is at a lower level somewhere.
* * User management commands no longer user pg_exec_query_dest -> more robustPeter Eisentraut2000-01-141-12/+9
| | | | | | | | | | | | * Let unprivileged users change their own passwords. * The password is now an Sconst in the parser, which better reflects its text datatype and also forces users to quote them. * If your password is NULL you won't be written to the password file, meaning you can't connect until you have a password set up (if you use password authentication). * When you drop a user that owns a database you get an error. The database is not gone.
* Some changes to prepare for LONG attributes.Jan Wieck1999-12-161-3/+3
| | | | Jan
* Depending on my interpreting (and programming) skills, this might solveBruce Momjian1999-12-141-17/+26
| | | | | | | | | | | | | | | | | | | | | | | | | anywhere from zero to two TODO items. * Allow flag to control COPY input/output of NULLs I got this: COPY table .... [ WITH NULL AS 'string' ] which does what you'd expect. The default is \N, otherwise you can use empty strings, etc. On Copy In this acts like a filter: every data item that looks like 'string' becomes a NULL. Pretty straightforward. This also seems to be related to * Make postgres user have a password by default If I recall this discussion correctly, the problem was actually that the default password for the postgres (or any) user is in fact "\N", because of the way copy is used. With this change, the file pg_pwd is copied out with nulls as empty strings, so if someone doesn't have a password, the password is just '', which one would expect from a new account. I don't think anyone really wants a hard-coded default password. Peter Eisentraut Sernanders väg 10:115
* COPY to a relation should keep write lock till transaction commit.Tom Lane1999-11-271-8/+15
| | | | Thanks to Hiroshi for spotting the problem.
* Add system indexes to match all caches.Bruce Momjian1999-11-221-5/+5
| | | | | | | 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.
* Change backend-side COPY to write files with permissions 644 not 666Tom Lane1999-11-211-4/+9
| | | | | | | | | (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.
* Cancel query support from MassimoBruce Momjian1999-09-271-1/+7
|
* Mega-commit to make heap_open/heap_openr/heap_close take anTom Lane1999-09-181-16/+15
| | | | | | | | | | | | | | | | | 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 query length limitation imposed by pg_client_to_serverTom Lane1999-09-111-109/+65
| | | | | and pg_server_to_client. Eliminate copy.c's restriction on the length of a single attribute.
* Plug several holes in backend's ability to cope withTom Lane1999-07-221-12/+28
| | | | unexpected loss of connection to frontend.
* Move some system includes into c.h, and remove duplicates.Bruce Momjian1999-07-171-2/+1
|
* Final cleanup.Bruce Momjian1999-07-161-11/+12
|
* Change #include's to use <> and "" as appropriate.Bruce Momjian1999-07-151-16/+16
|
* Remove unused #includes in *.c files.Bruce Momjian1999-07-151-7/+1
|
* Fix to prevent too large tuple from being created.Bruce Momjian1999-07-031-2/+2
|
* Fix critical error noticed by Massimo: copy.c used to have aTom Lane1999-06-121-17/+2
| | | | | | | | | 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.
* 1. Run all pg_dump queries in single serializable transaction.Vadim B. Mikheev1999-05-291-3/+3
| | | | | | 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.
* Make functions static or NOT_USED as appropriate.Bruce Momjian1999-05-261-17/+17
|
* pgindent run over code.Bruce Momjian1999-05-251-84/+114
|
* Change error messages to oids come out as %u and not %d. Change has noBruce Momjian1999-05-101-4/+4
| | | | real affect now.
* here are some patches for 6.5.0 which I already submitted but have neverBruce Momjian1999-05-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revise backend libpq interfaces so that messages to the frontendTom Lane1999-04-251-9/+25
| | | | | | 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.
* Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian1999-02-131-2/+2
|
* Changed ExecConstraints() and ExecRelCheck() to cache the constraintsJan Wieck1999-02-071-2/+3
| | | | | | | | | 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
* Cleanup of source files where 'return' or 'var =' is alone on a line.Bruce Momjian1999-02-031-13/+7
|
* Add TEMP tables/indexes. Add COPY pfree(). Other cleanups.Bruce Momjian1999-02-021-3/+5
|
* Fixed growing of backend due to not pfree()'d data on COPY FROMJan Wieck1999-02-011-2/+1
| | | | | | | Fixed growing of backend if BEFORE DELETE trigger returns heap tuple different from trigtuple. Jan
* Add explicit buffering in backend libpq, to compensate forTom Lane1999-01-231-4/+2
| | | | buffering lost by not going through stdio anymore for client I/O.
* Apply Win32 patch from Horak Daniel.Bruce Momjian1999-01-171-1/+9
|
* From: Magnus Hagander <mha@sollentuna.net>Marc G. Fournier1999-01-111-51/+154
| | | | | | | | | | | | 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.