summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
Commit message (Collapse)AuthorAgeFilesLines
* Back out to_ascii patch from Karel.Bruce Momjian2000-08-042-162/+2
|
* 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-034-196/+179
| | | | | 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-303-494/+3
| | | | | | | (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
|
* Ensure that values stored within arrays are not toasted, perTom Lane2000-07-271-6/+29
| | | | discussion on pghackers a few days ago.
* 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...
* 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-131-11/+5
| | | | 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).
* First stage of reclaiming memory in executor by resetting short-termTom Lane2000-07-122-119/+124
| | | | | | 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.
* 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
* 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
|
* 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-0612-526/+550
| | | | now TOAST-able.
* Update textin() and textout() to new fmgr style. This is just phaseTom Lane2000-07-056-87/+64
| | | | | 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
* 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
* In the attache is new (correct) version. I add TZ (timezone) supportBruce Momjian2000-07-031-453/+556
| | | | | | | for to_char() too. Karel
* Version number now set in configure, available through Makefile.globalPeter Eisentraut2000-07-021-2/+1
| | | | | | | | | | and config.h. Adjusted all referring code. Scrapped pg_version and changed initdb accordingly. Integrated src/utils/version.c into src/backend/utils/init/miscinit.c. Changed all callers. Set version number to `7.1devel'. (Non-numeric version suffixes now allowed.)
* Back out Karels to_char changes.Bruce Momjian2000-07-011-422/+370
|
* In the attache is new to_date()/to_timestamp() version.Bruce Momjian2000-07-011-370/+422
| | | | | | | | | | | | Now the to_timestamp() support WW,W,J,SSSS,DDD conversion from strings and the am/pm bug is fixed, the to_char() use week-of-year (WW) full compatible with Oracle. This patch update relevant regress-tests and docs too. Karel ~ ~
* Add #ifdef for LC_MESSAGES, because it is not ANSI C standard, and BSDIBruce Momjian2000-06-291-6/+13
| | | | does not have it.
* Tamotsu Nakagawa has posted a fix for this to a local mail list inBruce Momjian2000-06-271-2/+3
| | | | | | | Japan. Can someone comment on this? According to him, with the patch now only the geometry test fails. Tatsuo Ishii
* Clean up bogosities in pg_opclass, pg_amop, pg_amproc. There are amprocTom Lane2000-06-193-91/+54
| | | | | | | 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-181-2/+1
| | | | | | | | | | 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.
* Final #include cleanup.Bruce Momjian2000-06-151-3/+1
|
* 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-1414-93/+98
| | | | | | | | | | | 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-1312-966/+819
| | | | | 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