summaryrefslogtreecommitdiff
path: root/src/backend/utils
Commit message (Collapse)AuthorAgeFilesLines
* Add missing files from Karel, tip from Jan.Bruce Momjian2000-08-041-0/+159
|
* to_ascii( text )Bruce Momjian2000-08-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - encode 'text' from database encoding to ASCII to_ascii('\256\341k') to_ascii( text, int4 ) - encode 'text' from 'int4' encoding to ASCII to_ascii('\256\341k', 8) to_ascii( text, name ) - encode 'text' from 'name' encoding to ASCII to_ascii('\256\341k', 'LATIN2') Now is supported LATIN1, LATIN2, WIN1250. For other character sets I haven't good resources. Add new encoding is easy... If encoding is not supported returns ERROR. Note --- not exists total corect conversion to ASCII, this function try convert chars those is _probably_ interpret-able in ASCII for others use ' '. But for example for all Czech characters it is sufficient ... hmm Chinese / JAP and other complicated langs have bad luck here :-( Karel
* Convert inet-related functions to new fmgr style. I have also taken itTom Lane2000-08-032-214/+204
| | | | | | | | on myself to do something about the non-self-consistency of the inet comparison functions. The results are probably still semantically wrong (inet and cidr should have different comparison semantics, I think) but at least the boolean operators now agree with each other and with the sort order of indexes on inet/cidr.
* More functions updated to new fmgr style --- money, name, tid datatypes.Tom Lane2000-08-035-203/+182
| | | | | We're reaching the mopup stage here (good thing too, this is getting tedious).
* Repair bug noted by Paul Caskey: neqsel() has been generating a bogusTom Lane2000-08-031-5/+58
| | | | | | | | | result, in fact nearly the opposite of what it should, because it was passing the not-equal operator to eqsel() which would use it to compare the value against the most common value in the column, and of course obtain the wrong result therefrom. Must pass the equality operator to eqsel() instead. Fortunately that's easy to get from the oprnegate link.
* Convert all remaining float4 and float8 functions to new fmgr style.Tom Lane2000-08-016-937/+700
| | | | | | At this point I think it'd be possible to make float4 be pass-by-value without too much work --- and float8 too on machines where Datum is 8 bytes. Something to try when the mood strikes, anyway.
* Make acl-related functions safe for TOAST. Mark pg_class.relacl asTom Lane2000-07-311-83/+66
| | | | | compressible but not externally storable (since we're not sure about whether creating a toast relation for pg_class would work).
* Type lztext is toast.Tom Lane2000-07-304-497/+10
| | | | | | | (Sorry, couldn't help it...) Removed type filename as well, since it's unused and probably useless. INITDB FORCED, because pg_rewrite columns are now plain text again.
* Convert all remaining geometric operators to new fmgr style. ThisTom Lane2000-07-301-1139/+1285
| | | | | | | | allows fixing problems with operators that expected to be able to return a NULL, such as the '#' line-segment-intersection operator that tried to return NULL when the two segments don't intersect. (See, eg, bug report from 1-Nov-99 on pghackers.) Fix some other bugs in passing, such as backwards comparison in path_distance().
* PATH and POLYGON datatypes are now TOASTable. Associated functionsTom Lane2000-07-292-566/+341
| | | | | updated to new fmgr style. Deleted hoary old functions for compatibility with pre-6.1 representations of these datatypes.
* bpchar, varchar, bytea, numeric are toastable --- if you initdb, whichTom Lane2000-07-295-625/+596
| | | | | | I did not force. I marked numeric as compressable-but-not-move-off-able, partly to test that storage mode and partly because I've got doubts that numerics are large enough to need external storage.
* Add int2-vs-int8 comparison operators. These are now necessary becauseTom Lane2000-07-281-2/+116
| | | | | | | the planner may try to generate them as a result of transitivity of the existing int2-vs-int4 and int4-vs-int8 operators. In fact, it is now necessary that mergejoinable cross-datatype operators form closed sets. Add an opr_sanity regress test to detect missing operators.
* Remove <values.h> inclusions, no-longer-needed MAXINT definitions.Tom Lane2000-07-283-14/+3
|
* Some pedantic compile syntax errors to fix with the following patchBruce Momjian2000-07-271-2/+2
| | | | | | for today's snapshot Andreas
* Ensure that values stored within arrays are not toasted, perTom Lane2000-07-271-6/+29
| | | | discussion on pghackers a few days ago.
* Clean up some sloppy casts --- Oid vs. Datum, that sort of thing.Tom Lane2000-07-231-50/+28
|
* Further cleanup of array behavior. Slice assignments to arrays withTom Lane2000-07-231-215/+519
| | | | | | | | | | | varlena elements work now. Allow assignment to previously-nonexistent subscript position to extend array, but only for 1-D arrays and only if adjacent to existing positions (could do more if we had a way to represent nulls in arrays, but I don't want to tackle that now). Arrange for assignment of NULL to an array element in UPDATE to be a no-op, rather than setting the entire array to NULL as it used to. (Throwing an error would be a reasonable alternative, but it's never done that...) Update regress test accordingly.
* Arrays are toastable. (At least if you initdb, which I didn't force.)Tom Lane2000-07-224-1553/+330
| | | | | | | Remove a bunch of crufty code for large-object-based arrays, which is superseded by TOAST and likely hasn't worked in a long time anyway. Clean up array code a little, and in particular eliminate its habit of scribbling on the input array (ie, modifying the input tuple :-().
* Fixed memory allocation problems when compressing multi-MBJan Wieck2000-07-201-28/+35
| | | | | | | items. Lookup history is now a double linked list, used in a wrap-around style. Jan
* Revise aggregate functions per earlier discussions in pghackers.Tom Lane2000-07-175-323/+1005
| | | | | | | | | | | There's now only one transition value and transition function. NULL handling in aggregates is a lot cleaner. Also, use Numeric accumulators instead of integer accumulators for sum/avg on integer datatypes --- this avoids overflow at the cost of being a little slower. Implement VARIANCE() and STDDEV() aggregates in the standard backend. Also, enable new LIKE selectivity estimators by default. Unrelated change, but as long as I had to force initdb anyway...
* Update implementation notes for new memory management logic.Tom Lane2000-07-151-41/+52
|
* Cleanup of code for creating index entries. Functional indexes withTom Lane2000-07-141-1/+2
| | | | | | | | | | | | | pass-by-ref data types --- eg, an index on lower(textfield) --- no longer leak memory during index creation or update. Clean up a lot of redundant code ... did you know that copy, vacuum, truncate, reindex, extend index, and bootstrap each basically duplicated the main executor's logic for extracting information about an index and preparing index entries? Functional indexes should be a little faster now too, due to removal of repeated function lookups. CREATE INDEX 'opt_type' clause is deimplemented by these changes, but I haven't removed it from the parser yet (need to merge with Thomas' latest change set first).
* Remove dangling else warning (Cyrillic recode stuff)Peter Eisentraut2000-07-141-1/+3
|
* Implement nested block comments in the backend and in psql.Thomas G. Lockhart2000-07-141-12/+16
| | | | | | | | | | | | | | Include updates for the comment.sql regression test. Implement SET SESSION CHARACTERISTICS and SET DefaultXactIsoLevel. Implement SET SESSION CHARACTERISTICS TRANSACTION COMMIT and SET AutoCommit in the parser only. Need to add code to actually do something. Implement WITHOUT TIME ZONE type qualifier. Define SCHEMA keyword, along with stubbed-out grammar. Implement "[IN|INOUT|OUT] [varname] type" function arguments in parser only; INOUT and OUT throws an elog(ERROR). Add PATH as a type-specific token, since PATH is in SQL99 to support schema resource search and resolution.
* Fix indenting in prototype declarations. No functional changes.Thomas G. Lockhart2000-07-141-6/+6
|
* Repair parallel make in backend tree (and make it really parallel).Peter Eisentraut2000-07-133-51/+43
| | | | Make Gen_fmgrtab.sh reasonably robust against concurrent invocation.
* Remove a bunch of unused configure tests, in particular cases wherePeter Eisentraut2000-07-129-61/+27
| | | | | | | | | | * the result is not recorded anywhere * the result is not used anywhere * the result is only used in some places, whereas others have been getting away with it * the result is used improperly Also make command line options handling a little better (e.g., --disable-locale, while redundant, should really still *dis*able).
* Can you please apply the following patch to current CVSBruce Momjian2000-07-121-4/+3
| | | | | | | | | to make AIX'ers happy with the changes to the version.o ? Together with the patch I sent Tom, AIX now regresses ok. Thanx Andreas
* Add assert checking to GUC ("debug_assertions")Peter Eisentraut2000-07-121-3/+10
| | | | | Rename settings net_server to tcpip_socket, max_backends to max_connections Add --help and --version to postmaster, reformat help output
* Repair missing MEMORY_CONTEXT_CHECKING logic for realloc().Tom Lane2000-07-121-2/+11
| | | | | Doesn't anyone around here run regression tests before submitting patches, or before committing them?
* First stage of reclaiming memory in executor by resetting short-termTom Lane2000-07-124-130/+141
| | | | | | memory contexts. Currently, only leaks in expressions executed as quals or projections are handled. Clean up some old dead cruft in executor while at it --- unused fields in state nodes, that sort of thing.
* Here is the patch with memory leak checker. This checker allow detectBruce Momjian2000-07-112-30/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in-chunk leaks, overwrite-next-chunk leaks and overwrite block-freeptr leaks. A in-chunk leak --- if something overwrite space after wanted (via palloc() size, but it is still inside chunk. For example x = palloc(12); /* create 16b chunk */ memset(x, '#', 13); this leak is in the current source total invisible, because chunk is 16b and leak is in the "align space". For this feature I add data_size to StandardChunk, and all memory which go from AllocSetAlloc() is marked as 0x7F. The MemoryContextCheck() is compiled '#ifdef USE_ASSERT_CHECKING'. I add this checking to 'tcop/postgres.c' and is active after each backend query, but it is probably not sufficient, because some MemoryContext exist only during memory processing --- will good if someone who known where it is needful (Tom:-) add it for others contexts; A problem in the current source is that we have still some malloc() allocation that is not needful and this allocation is total invisible for all context routines. For example Dllist in backend (pretty dirty it is in catcache where values in Dllist are palloc-ed, but list is malloc-ed). --- and BTW. this Dllist design stand in the way for query cache :-) Tom, if you agree I start replace some mallocs. BTW. --- Tom, have you idea for across transaction presistent allocation for SQL functions? (like regex - now it is via malloc) I almost forget. I add one if() to AllocSetAlloc(), for 'size' that are greater than ALLOC_BIGCHUNK_LIMIT is not needful check AllocSetFreeIndex(), because 'fidx' is always 'ALLOCSET_NUM_FREELISTS - 1'. It a little brisk up allocation for very large chunks. Right? Karel
* oidvectortypes: use SQL type names and separate by commasPeter Eisentraut2000-07-092-66/+91
| | | | | | psql \df: use format_type and oidvectortypes map type REAL to float4, not float8 psql \dd :work around UNION bug
* Another round of those unportable config/build changes :-/Peter Eisentraut2000-07-092-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add option to build with OpenSSL out of the box. Fix thusly exposed bit rot. Although it compiles now, getting this to do something useful is left as an exercise. * Fix Kerberos options to defer checking for required libraries until all the other libraries are checked for. * Change default odbcinst.ini and krb5.srvtab path to PREFIX/etc. * Install work around for Autoconf's install-sh relative path anomaly. Get rid of old INSTL_*_OPTS variables, now that we don't need them anymore. * Use `gunzip -c' instead of g?zcat. Reportedly broke on AIX. * Look for only one of readline.h or readline/readline.h, not both. * Make check for PS_STRINGS cacheable. Don't test for the header files separately. * Disable fcntl(F_SETLK) test on Linux. * Substitute the standard GCC warnings set into CFLAGS in configure, don't add it on in Makefile.global. * Sweep through contrib tree to teach makefiles standard semantics. ... and in completely unrelated news: * Make postmaster.opts arbitrary options-aware. I still think we need to save the environment as well.
* Remove long-dead support for invoking queries from dynamically loadedTom Lane2000-07-081-11/+1
| | | | | | backend functions via backend PQexec(). The SPI interface has long been our only documented way to do this, and the backend pqexec/portal code is unused and suffering bit-rot. I'm putting it out of its misery.
* Fix misuse of StrNCpy to copy and add null to non-null-terminated data.Tom Lane2000-07-074-16/+24
| | | | | | | Does not work since it fetches one byte beyond the source data, and when the phase of the moon is wrong, the source data is smack up against the end of backend memory and you get SIGSEGV. Don't laugh, this is a fix for an actual user bug report.
* - format_type function, in use by psqlPeter Eisentraut2000-07-072-2/+183
| | | | | - added bigint as synonym of int8 - set typelem of varlen non-array types to 0
* Rename cash_words_out to cash_words.Bruce Momjian2000-07-071-3/+3
|
* Correct unsafe use of strcmp(). See rant of same date posted to pghackers.Tom Lane2000-07-061-16/+16
|
* Backend makefile cleanup. make maintainer-clean is now completelyPeter Eisentraut2000-07-061-3/+4
| | | | | | | | | | | | | | | functional. Handle include file installation in src/include/Makefile genbki.sh improvements: Don't substitute anything by config.status, instead pass in AWK and CPP through environment. Change calling convention to support named output files, so we get to see error messages on stderr. Rename bootstrap template files and install them into PREFIX/share. Update initdb to that effect and other readability improvements in initdb.
* Added comments about the compression algorithm as requested by TomJan Wieck2000-07-061-4/+58
| | | | Jan
* Functions on 'text' type updated to new fmgr style. 'text' isTom Lane2000-07-0613-527/+581
| | | | now TOAST-able.
* Update textin() and textout() to new fmgr style. This is just phaseTom Lane2000-07-0510-121/+97
| | | | | one of updating the whole text datatype, but there are so dang many calls of these two routines that it seems worth a separate commit.
* Fixed lztextlen() bug in MULTIBYTE, still thinking that lztextJan Wieck2000-07-051-2/+2
| | | | | | does compression itself the old way. Jan
* Make toast-table creation and deletion work somewhat reliably.Tom Lane2000-07-041-2/+3
| | | | | | | Don't go through pg_exec_query_dest(), but directly to the execution routines. Also, extend parameter lists so that there's no need to change the global setting of allowSystemTableMods, a hack that was certain to cause trouble in the event of any error.
* TOASTJan Wieck2000-07-0321-213/+149
| | | | | | | | WARNING: This is actually broken - we have self-deadlocks due to concurrent changes in buffer management. Vadim and me are working on it. Jan
* Move global internal files to PGDATA/global.Peter Eisentraut2000-07-031-3/+3
|
* Move PGPORT envar handling to ResetAllOptions(). Improve long optionsPeter Eisentraut2000-07-031-1/+50
| | | | | parsing to not clobber the optarg string -- so that we can bring SetOptsFile() up to speed.
* In the attache is new (correct) version. I add TZ (timezone) supportBruce Momjian2000-07-031-453/+556
| | | | | | | for to_char() too. Karel
* Add a check of HEAP_MARKED_FOR_UPDATE in HeapTupleSatisfiesDirty().Hiroshi Inoue2000-07-031-1/+5
| | | | This enables unique constraint check in case of SELECT FOR UPDATEd.