summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
Commit message (Collapse)AuthorAgeFilesLines
* Ok. Updated patch attached.Bruce Momjian2002-03-061-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - domain.patch -> source patch against pgsql in cvs - drop_domain.sgml and create_domain.sgml -> New doc/src/sgml/ref docs - dominfo.txt -> basic domain related queries I used for testing [ ADDED TO /doc] Enables domains of array elements -> CREATE DOMAIN dom int4[3][2]; Uses a typbasetype column to describe the origin of the domain. Copies data to attnotnull rather than processing in execMain(). Some documentation differences from earlier. If this is approved, I'll start working on pg_dump, and a \dD <domain> option in psql, and regression tests. I don't really feel like doing those until the system table structure settles for pg_type. CHECKS when added, will also be copied to to the table attributes. FK Constraints (if I ever figure out how) will be done similarly. Both will lbe handled by MergeDomainAttributes() which is called shortly before MergeAttributes(). Rod Taylor
* Modify ALTER TABLE OWNER to change index ownership; code cleanup.Bruce Momjian2002-03-061-27/+2
| | | | Neil Conway
* Change made to elog:Bruce Momjian2002-03-067-49/+49
| | | | | | | | | | | | | | | | | | | o Change all current CVS messages of NOTICE to WARNING. We were going to do this just before 7.3 beta but it has to be done now, as you will see below. o Change current INFO messages that should be controlled by client_min_messages to NOTICE. o Force remaining INFO messages, like from EXPLAIN, VACUUM VERBOSE, etc. to always go to the client. o Remove INFO from the client_min_messages options and add NOTICE. Seems we do need three non-ERROR elog levels to handle the various behaviors we need for these messages. Regression passed.
* I attach a version of my toast-slicing patch, against current CVSBruce Momjian2002-03-051-42/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (current as of a few hours ago.) This patch: 1. Adds PG_GETARG_xxx_P_SLICE() macros and associated support routines. 2. Adds routines in src/backend/access/tuptoaster.c for fetching only necessary chunks of a toasted value. (Modelled on latest changes to assume chunks are returned in order). 3. Amends text_substr and bytea_substr to use new methods. It now handles multibyte cases -and should still lead to a performance improvement in the multibyte case where the substring is near the beginning of the string. 4. Added new command: ALTER TABLE tabname ALTER COLUMN colname SET STORAGE {PLAIN | EXTERNAL | EXTENDED | MAIN} to parser and documented in alter-table.sgml. (NB I used ColId as the item type for the storage mode string, rather than a new production - I hope this makes sense!). All this does is sets attstorage for the specified column. 4. AlterTableAlterColumnStatistics is now AlterTableAlterColumnFlags and handles both statistics and storage (it uses the subtype code to distinguish). The previous version of my patch also re-arranged other code in backend/commands/command.c but I have dropped that from this patch.(I plan to return to it separately). 5. Documented new macros (and also the PG_GETARG_xxx_P_COPY macros) in xfunc.sgml. ref/alter_table.sgml also contains documentation for ALTER COLUMN SET STORAGE. John Gray
* Fix bug in extract/date_part for milliseconds/miscroseconds andTatsuo Ishii2002-03-041-5/+5
| | | | | | | | | | | timestamp/timestamptz combo. Now extract/date_part returns seconds*1000 or 1000000 + fraction part as the manual stats. regression test are also fixed. See the thread in pgsql-hackers: Subject: Re: [HACKERS] timestamp_part() bug? Date: Sat, 02 Mar 2002 11:29:53 +0900
* Commit to match discussed elog() changes. Only update is that LOG isBruce Momjian2002-03-024-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | now just below FATAL in server_min_messages. Added more text to highlight ordering difference between it and client_min_messages. --------------------------------------------------------------------------- REALLYFATAL => PANIC STOP => PANIC New INFO level the prints to client by default New LOG level the prints to server log by default Cause VACUUM information to print only to the client NOTICE => INFO where purely information messages are sent DEBUG => LOG for purely server status messages DEBUG removed, kept as backward compatible DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1 added DebugLvl removed in favor of new DEBUG[1-5] symbols New server_min_messages GUC parameter with values: DEBUG[5-1], INFO, NOTICE, ERROR, LOG, FATAL, PANIC New client_min_messages GUC parameter with values: DEBUG[5-1], LOG, INFO, NOTICE, ERROR, FATAL, PANIC Server startup now logged with LOG instead of DEBUG Remove debug_level GUC parameter elog() numbers now start at 10 Add test to print error message if older elog() values are passed to elog() Bootstrap mode now has a -d that requires an argument, like postmaster
* Array slice extraction should produce a result array with index lowerTom Lane2002-03-021-3/+11
| | | | | bounds of 1, not the lower bound subscripts of the original slice. Per bug report from Andre Holzner, 1-Feb-02.
* array_ref() should set isNull to false explicitly if it's not going toPeter Eisentraut2002-03-011-1/+2
| | | | return NULL.
* Teach planner about the idea that a mergejoin won't necessarily readTom Lane2002-03-011-23/+269
| | | | | | both input streams to the end. If one variable's range is much less than the other, an indexscan-based merge can win by not scanning all of the other table. Per example from Reinhard Max.
* Add a large number of time zones to the lookup table.Thomas G. Lockhart2002-02-251-167/+144
| | | | Fix a few apparently-wrong TZ vs DTZ declarations.
* Make factorial(0) return 1, as per spec.Bruce Momjian2002-02-232-4/+8
|
* Avoid failures in cash_out and cash_words for INT_MIN.Tom Lane2002-02-191-10/+14
| | | | Also, 'fourty' -> 'forty'.
* A bunch of changes aimed at reducing backend startup time...Tom Lane2002-02-191-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Improve 'pg_internal.init' relcache entry preload mechanism so that it is safe to use for all system catalogs, and arrange to preload a realistic set of system-catalog entries instead of only the three nailed-in-cache indexes that were formerly loaded this way. Fix mechanism for deleting out-of-date pg_internal.init files: this must be synchronized with transaction commit, not just done at random times within transactions. Drive it off relcache invalidation mechanism so that no special-case tests are needed. Cache additional information in relcache entries for indexes (their pg_index tuples and index-operator OIDs) to eliminate repeated lookups. Also cache index opclass info at the per-opclass level to avoid repeated lookups during relcache load. Generalize 'systable scan' utilities originally developed by Hiroshi, move them into genam.c, use in a number of places where there was formerly ugly code for choosing either heap or index scan. In particular this allows simplification of the logic that prevents infinite recursion between syscache and relcache during startup: we can easily switch to heapscans in relcache.c when and where needed to avoid recursion, so IndexScanOK becomes simpler and does not need any expensive initialization. Eliminate useless opening of a heapscan data structure while doing an indexscan (this saves an mdnblocks call and thus at least one kernel call).
* Privileges on functions and procedural languagesPeter Eisentraut2002-02-182-11/+14
|
* Remove MAX/MIN() macros, use c.h Max/Min() instead.Bruce Momjian2002-02-183-92/+67
|
* Repair bugs in declarations of routines to add timestamptz and interval.Thomas G. Lockhart2002-01-121-3/+3
| | | | | | | | | Thanks to Bruce for spotting it and Tom Lane for diagnosing it. Since horology test output is changing anyway, add some date/time input tests to horology.sql. Some of these should move to the tests for the individual data types, and we perhaps should add an entire new test for "timezone" to allow manipulating the current time zone without risking damage to the results of other tests.
* Fix lpad() and rpad() to produce correct results in variable-lengthTom Lane2002-01-081-5/+5
| | | | multibyte encodings.
* Have to_date() call timestamptz_date() per Karel's email instructions.Thomas G. Lockhart2002-01-041-2/+2
| | | | | | | Fixes time zone problems introduced by Thomas' implementation of TIMESTAMP WITHOUT TIME ZONE which caused the behavior of the previously appropriate routine, timestamp_date(), to change for the worse in this context.
* Guard against roundoff errors in new selectivity-estimation code,Tom Lane2002-01-031-22/+34
| | | | per bug report from Laurette Cisneros.
* Fix to_timestamp/to_date so that zero year input for Y, YY, or YYYTom Lane2002-01-021-56/+41
| | | | | formats will be taken as 2000, not year zero. Per bug report from Aasmund Midttun Godal. Fix from Karel Zak.
* Rename TIME token to ISOTIME to eliminate conflict with gram.y parserThomas G. Lockhart2002-01-011-4/+4
| | | | token. Seems to be isolated to datetime.c and datetime.h.
* Make sure that all <ctype.h> routines are called with unsigned charTom Lane2001-12-301-3/+3
| | | | | values; it's not portable to call them with signed chars. I recall doing this for the last release, but a few more uncasted calls have snuck in.
* Fix newly introduced datetime.c compile failure; not enough parens.Bruce Momjian2001-12-291-2/+2
|
* Check a bit more carefully for preceeding ISO field tagsThomas G. Lockhart2001-12-291-10/+10
| | | | when decoding date fields.
* Rework the date/time parsing to tighten up some cases and to enable otherThomas G. Lockhart2001-12-292-204/+676
| | | | | | | | | cases which should have worked but did not. Now supports julian day (J2452271), ISO time labels (T040506) and various combinations of spaces and run-togethers of dates, times, and time zones. All regression tests pass, and I have more tests to add after the 7.2 release (don't want to require changes to the ancillary horology result files until after then).
* Add full name of the month of July to the lookup table.Thomas G. Lockhart2001-12-211-1/+2
| | | | Thanks to Greg Sabino Mullane <greg@turnstep.com> for finding the problem.
* Repair roundoff-error problem for stddev/variance results near zero,Tom Lane2001-12-112-41/+98
| | | | | per complaint from Kemin Zhou. Fix lack of precision in numeric stddev/variance.
* Repair case-conversion error in to_date's handling of roman numerals.Tom Lane2001-12-101-3/+3
| | | | From Manuel Sugawara, approved by Karel Zak.
* Fix for usage of spirntf in more portable way.Tatsuo Ishii2001-12-051-4/+11
|
* Fix array_out's failure to backslash backslashes, per bug# 524. Also,Tom Lane2001-11-291-39/+57
| | | | | | | | | remove brain-dead rule that double quotes are needed if and only if the datatype is pass-by-reference; neither direction of the implication holds water. Instead, examine the actual data string to see if it contains any characters that force us to quote it. Add some documentation about quoting of array values, which was previously explained nowhere AFAICT.
* Change display of FieldSelect nodes from arg.field to field(arg),Tom Lane2001-11-261-8/+16
| | | | | | | per bug report from Stefan Hadjistoytchev. There are some cases where the dot notation works, but there are more where it doesn't. Eventually ought to consider fixing the parser to allow cases like func().field, but for now this is the simplest patch.
* Repair problem with listing rules that have a WHERE condition andTom Lane2001-11-261-7/+20
| | | | | have an INSERT...SELECT as the first or only action. Per bug report from Sergio Pili.
* Tweak int8in to accept -9223372036854775808, per recent discussion inTom Lane2001-11-241-3/+24
| | | | pgsql-patches.
* Spell 'precedes', 'preceding' correctly in various places.Tom Lane2001-11-211-2/+2
|
* Tweak interval_avg support to avoid coredump with Alpha/Tru64 compiler.Tom Lane2001-11-211-5/+11
| | | | Per report from Bernd Tegge.
* Add a few new time zones, and list every time zone mentioned in myThomas G. Lockhart2001-11-211-5/+282
| | | | | Linux box's time zone database. Do not allow 'current' as a date/time input value.
* Repair swapped sign for time minus time routine (time_mi_time()).Thomas G. Lockhart2001-11-211-2/+2
| | | | Problem reported by Manuel Sugawara (masm@fciencias.unam.mx).
* Tweak format_type so that we get good behavior for both column typeTom Lane2001-11-192-49/+78
| | | | | display (with a typemod) and function arg/result type display (without a typemod).
* Fix arg coerect match text type, per Tom.Bruce Momjian2001-11-191-2/+2
|
* Make text octet_length() return non-compressed length to be consistentBruce Momjian2001-11-191-10/+3
| | | | with other data types, per disucssion. Encoding issue still open.
* Grammatical and spelling fixes.Tom Lane2001-11-193-8/+8
|
* Optimization for bpcharlen, textlen, varcharlen in case of single byteTatsuo Ishii2001-11-182-18/+17
| | | | encodings.
* Fix performance problems in TOAST compressor. The management ofTom Lane2001-11-171-70/+97
| | | | | | | | | | search lists was broken in such a way that only the most recent instance of a given hash code would ever be searched, thus possibly missing longer matches further back. Fixing this gave 5 to 10% compression improvement on some text test cases. Additional small tweaks to improve speed of inner loops a little bit. There is no compatibility issue created by this change, since the compressed data format and decompression algorithm don't change.
* IsSystemRelationName() treats TOAST relations as system relations.Tom Lane2001-11-161-2/+4
| | | | | | | | This seems the right thing for most usages, but I notice two places where it is the wrong thing. One is that the default permissions on TOAST rels should be no-access, not world-readable; the other is that PrepareForTupleInvalidation doesn't really need to spend time looking at tuples of TOAST relations.
* Tweak parser so that there is a defined representation for datatypesTom Lane2001-11-121-11/+24
| | | | | | | | | | | | bpchar, bit, numeric with typmod -1. Alter format_type so that this representation is printed when the typmod is -1. This ensures that tables having such columns can be pg_dump'd and reloaded correctly. Also, remove the rather useless and non-SQL-compliant default precision and scale for type NUMERIC. A numeric column declared as such (with no precision/scale) will now have typmod -1 which means that numeric values of any precision/scale can be stored in it, without conversion to a uniform scale. This seems significantly more useful than the former behavior. Part of response to bug #513.
* Tables without oids wouldn't be able to beBruce Momjian2001-11-121-13/+13
| | | | | | | | | | used inside fk constraints, since some of the checks in the trigger did a SELECT oid. Since the oid wasn't actually used, I changed this to SELECT 1. My test case with non-oid tables now works and fk regression appears to run fine on my machine. Stephan Szabo
* Make ALTER TABLE RENAME update foreign-key trigger arguments correctly.Tom Lane2001-11-121-11/+1
| | | | Brent Verner, with review and kibitzing from Tom Lane.
* Add casts to suppress compiler warnings observed on Darwin platformTom Lane2001-11-081-4/+7
| | | | (surprised no one has reported these yet...)
* Add British Double Standard Time (BDST) per mailing list report.Thomas G. Lockhart2001-11-061-1/+2
|
* New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian2001-11-0510-27/+27
| | | | initdb/regression tests pass.