summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
AgeCommit message (Collapse)Author
2002-06-11Implement SQL99 OVERLAY(). Allows substitution of a substring in a string.Thomas G. Lockhart
Implement SQL99 SIMILAR TO as a synonym for our existing operator "~". Implement SQL99 regular expression SUBSTRING(string FROM pat FOR escape). Extend the definition to make the FOR clause optional. Define textregexsubstr() to actually implement this feature. Update the regression test to include these new string features. All tests pass. Rename the regular expression support routines from "pg95_xxx" to "pg_xxx". Define CREATE CHARACTER SET in the parser per SQL99. No implementation yet.
2002-06-11Katherine Ward wrote:Jan Wieck
> Changes to avoid collisions with WIN32 & MFC names... > 1. Renamed: > a. PROC => PGPROC > b. GetUserName() => GetUserNameFromId() > c. GetCurrentTime() => GetCurrentDateTime() > d. IGNORE => IGNORE_DTF in include/utils/datetime.h & utils/adt/datetim > > 2. Added _P to some lex/yacc tokens: > CONST, CHAR, DELETE, FLOAT, GROUP, IN, OUT Jan
2002-06-07Improve readability of factorial, from Florian Weimer.Bruce Momjian
2002-06-07Fix for factorial(0::int2) returning 1, from sugita@sra.co.jp.Bruce Momjian
2002-06-01Fix timestamp to date conversion for the case where timestamp uses a doubleThomas G. Lockhart
precision storage format. Previously applied the same math as used for the 64-bit integer storage format case, which was wrong. Problem introduced recently when the 64-bit storage format was implemented.
2002-05-28Queries used by ruleutils were not schema-proof.Tom Lane
2002-05-22Add optional "validator" function to languages that can validate thePeter Eisentraut
function body (and other properties) as a function in the language is created. This generalizes ad hoc code that already existed for the built-in languages. The validation now happens after the pg_proc tuple of the new function is created, so it is possible to define recursive SQL functions. Add some regression test cases that cover bogus function definition attempts.
2002-05-22AllowHiroshi Inoue
CREATE VIEW as SELECT CTID, .... SELECT currtid( a view, ..).
2002-05-20Restructure indexscan API (index_beginscan, index_getnext) perTom Lane
yesterday's proposal to pghackers. Also remove unnecessary parameters to heap_beginscan, heap_rescan. I modified pg_proc.h to reflect the new numbers of parameters for the AM interface routines, but did not force an initdb because nothing actually looks at those fields.
2002-05-18Add display of sort keys to the default EXPLAIN output.Tom Lane
2002-05-18Allow functions to be executed with the privileges of the function owner.Peter Eisentraut
I took the opportunity to remove the pg_proc.proistrusted field.
2002-05-17Support temporary setting of search path during CREATE SCHEMA; thisTom Lane
allows the example in the CREATE SCHEMA ref page to actually work now. Also, clean up when the transaction that initially creates a temp-table namespace is later aborted. Simplify internal representation of search path by folding special cases into the main list.
2002-05-17Merge the last few variable.c configuration variables into the genericTom Lane
GUC support. It's now possible to set datestyle, timezone, and client_encoding from postgresql.conf and per-database or per-user settings. Also, implement rollback of SET commands that occur in a transaction that later fails. Create a SET LOCAL var = value syntax that sets the variable only for the duration of the current transaction. All per previous discussions in pghackers.
2002-05-14Remove unnecessary pfree's in geometric operators. At least one of theseTom Lane
is actively dangerous, per bug report from Ewald Geschwinde 14-May-02, and several of the rest look suspicious to me. Since there is no longer any significant value in retail pfree's in these functions, just get rid of all of them for safety's sake.
2002-05-14Fix lookup tables used for rounding interval data values when not usingThomas G. Lockhart
integer datetimes. Thanks to Tom Lane for spotting the problem.
2002-05-12Get rid of long-since-vestigial Iter node type, in favor of adding aTom Lane
returns-set boolean field in Func and Oper nodes. This allows cleaner, more reliable tests for expressions returning sets in the planner and parser. For example, a WHERE clause returning a set is now detected and complained of in the parser, not only at runtime.
2002-05-12First pass at set-returning-functions in FROM, by Joe Conway withTom Lane
some kibitzing from Tom Lane. Not everything works yet, and there's no documentation or regression test, but let's commit this so Joe doesn't need to cope with tracking changes in so many files ...
2002-05-11Forgot to handle 'opaque' function arguments in regprocedurein/out.Tom Lane
2002-05-09Make initdb print a message about which locale it is about to use.Peter Eisentraut
Re-add warning if the locale prevents LIKE-optimization. Done within initdb now.
2002-05-03Make ruleutils.c schema-aware. Displayed names are schema-qualifiedTom Lane
only if they would not be found without qualification given the current search path, as per idea from Peter Eisentraut.
2002-05-02Tweak scanner/grammar interface so that the keyword-as-identifier rulesTom Lane
in gram.y can make use of the keywords.c string table, instead of having their own copies of the keyword strings. This saves a few kilobytes and more importantly eliminates an opportunity for cut-and-paste errors.
2002-05-01Add routines in namespace.c to determine whether objects are visibleTom Lane
in the search path. (We might want to make these available as SQL functions too, but I haven't done that yet.) Fix format_type to be schema-aware.
2002-04-28Make ruleutils.c use format_type for printing typenames. Minor tweaksTom Lane
in quoting rules and recognition of implicit type coercions.
2002-04-27Restructure aclcheck error reporting to make permission-failureTom Lane
messages more uniform and internationalizable: the global array aclcheck_error_strings[] is gone in favor of a subroutine aclcheck_error(). Partial implementation of namespace-related permission checks --- not all done yet.
2002-04-26Add current_schema() and current_schemas() inquiry functions.Tom Lane
Update has_table_privilege functions to cope with schema-qualified names in the same way as nextval() and others.
2002-04-25Implement types regprocedure, regoper, regoperator, regclass, regtypeTom Lane
per pghackers discussion. Add some more typsanity tests, and clean up some problems exposed thereby (broken or missing array types for some built-in types). Also, clean up loose ends from unknownin/out patch.
2002-04-24Here's a patch to add unknownin/unknownout support. I also poked aroundBruce Momjian
looking for places that assume UNKNOWN == TEXT. One of those was the "SET" type in pg_type.h, which was using textin/textout. This one I took care of in this patch. The other suspicious place was in string_to_dataum (which is defined in both selfuncs.c and indxpath.c). I wasn't too sure about those, so I left them be. Joe Conway
2002-04-23Clean up INT64CONST conflicts. Make the pg_crc code use a macro calledTom Lane
UINT64CONST, since unsigned was what it wanted anyway. Centralize macro definitions into c.h.
2002-04-21Support alternate storage scheme of 64-bit integer for date/time types.Thomas G. Lockhart
Use "--enable-integer-datetimes" in configuration to use this rather than the original float8 storage. I would recommend the integer-based storage for any platform on which it is available. We perhaps should make this the default for the production release. Change timezone(timestamptz) results to return timestamp rather than a character string. Formerly, we didn't have a way to represent timestamps with an explicit time zone other than freezing the info into a string. Now, we can reasonably omit the explicit time zone from the result and return a timestamp with values appropriate for the specified time zone. Much cleaner, and if you need the time zone in the result you can put it into a character string pretty easily anyway. Allow fractional seconds in date/time types even for dates prior to 1BC. Limit timestamp data types to 6 decimal places of precision. Just right for a micro-second storage of int8 date/time types, and reduces the number of places ad-hoc rounding was occuring for the float8-based types. Use lookup tables for precision/rounding calculations for timestamp and interval types. Formerly used pow() to calculate the desired value but with a more limited range there is no reason to not type in a lookup table. Should be *much* better performance, though formerly there were some optimizations to help minimize the number of times pow() was called. Define a HAVE_INT64_TIMESTAMP variable. Based on the configure option "--enable-integer-datetimes" and the existing internal INT64_IS_BUSTED. Add explicit date/interval operators and functions for addition and subtraction. Formerly relied on implicit type promotion from date to timestamp with time zone. Change timezone conversion functions for the timetz type from "timetz()" to "timezone()". This is consistant with other time zone coersion functions for other types. Bump the catalog version to 200204201. Fix up regression tests to reflect changes in fractional seconds representation for date/times in BC eras. All regression tests pass on my Linux box.
2002-04-21Restructure AclItem representation so that we can have more than eightTom Lane
different privilege bits (might as well make use of the space we were wasting on padding). EXECUTE and USAGE bits for procedures, languages now are separate privileges instead of being overlaid on SELECT. Add privileges for namespaces and databases. The GRANT and REVOKE commands work for these object types, but we don't actually enforce the privileges yet...
2002-04-19Change naming rule for ON SELECT rules of views: they're all justTom Lane
_RETURN now, since there's no need to keep 'em unique anymore.
2002-04-18Rule names are now unique per-relation, rather than unique globally.Tom Lane
DROP RULE and COMMENT ON RULE syntax adds an 'ON tablename' clause, similar to TRIGGER syntaxes. To allow loading of existing pg_dump files containing COMMENT ON RULE, the COMMENT code will still accept the old syntax --- but only if the target rulename is unique across the whole database.
2002-04-16Operators live in namespaces. CREATE/DROP/COMMENT ON OPERATOR takeTom Lane
qualified operator names directly, for example CREATE OPERATOR myschema.+ ( ... ). To qualify an operator name in an expression you need to write OPERATOR(myschema.+) (thanks to Peter for suggesting an escape hatch). I also took advantage of having to reformat pg_operator to fix something that'd been bugging me for a while: mergejoinable operators should have explicit links to the associated cross-data-type comparison operators, rather than hardwiring an assumption that they are named < and >.
2002-04-15Fix text_substr bug intrduced in 7.3 developmentTatsuo Ishii
using Joe Conway's patches (submitted at pgsql-patches on 2002/04/08) + small fix.
2002-04-11Restructure representation of aggregate functions so that they have pg_procTom Lane
entries, per pghackers discussion. This fixes aggregates to live in namespaces, and also simplifies/speeds up lookup in parse_func.c. Also, add a 'proimplicit' flag to pg_proc that controls whether a type coercion function may be invoked implicitly, or only explicitly. The current settings of these flags are more permissive than I would like, but we will need to debate and refine the behavior; for now, I avoided breaking regression tests as much as I could.
2002-04-05Divide functions into three volatility classes (immutable, stable, andTom Lane
volatile), rather than the old cachable/noncachable distinction. This allows indexscan optimizations in many places where we formerly didn't. Also, add a pronamespace column to pg_proc (it doesn't do anything yet, however).
2002-04-04Authentication improvements:Bruce Momjian
A new pg_hba.conf column, USER Allow specifiction of lists of users separated by commas Allow group names specified by + Allow include files containing lists of users specified by @ Allow lists of databases, and database files Allow samegroup in database column to match group name matching dbname Removal of secondary password files Remove pg_passwd utility Lots of code cleanup in user.c and hba.c New data/global/pg_pwd format New data/global/pg_group file
2002-04-03Locale support is on by default. The choice of locale is done in initdbPeter Eisentraut
and/or with GUC variables.
2002-04-02Make VACUUM handle schema-qualified relation names properly.Tom Lane
2002-04-01Add tgconstrrelid to stored Trigger structures, make RI trigger functionsTom Lane
depend on this rather than the trigger argument strings to locate the other relation to test. This makes RI triggers function properly in the presence of schemas and temp tables. Along the way, fix bogus lack of locking in RI triggers, handle quoting of names fully correctly, compute required sizes of query buffers with some semblance of accuracy.
2002-04-01Create a new GUC variable search_path to control the namespace searchTom Lane
path. The default behavior if no per-user schemas are created is that all users share a 'public' namespace, thus providing behavior backwards compatible with 7.2 and earlier releases. Probably the semantics and default setting will need to be fine-tuned, but this is a start.
2002-04-01Temporary kluge to let RI triggers work on tables outside the systemTom Lane
catalog namespace. This will not do as a production solution because the interpretation of RI trigger arguments will vary depending on the current namespace search path. I'm just putting it in so that the RI regression tests don't fail while schema development proceeds. We must find a better answer before 7.3 can be released.
2002-03-30Further cleanups for relations in schemas: teach nextval and otherTom Lane
sequence functions how to cope with qualified names. Same code is also used for int4notin, currtid_byrelname, pgstattuple. Also, move TOAST tables into special pg_toast namespace.
2002-03-29pg_type has a typnamespace column; system now supports creating typesTom Lane
in different namespaces. Also, cleanup work on relation namespace support: drop, alter, rename commands work for tables in non-default namespaces.
2002-03-26pg_class has a relnamespace column. You can create and access tablesTom Lane
in schemas other than the system namespace; however, there's no search path yet, and not all operations work yet on tables outside the system namespace.
2002-03-22A little further progress on schemas: push down RangeVars intoTom Lane
addRangeTableEntry calls. Remove relname field from RTEs, since it will no longer be a useful unique identifier of relations; we want to encourage people to rely on the relation OID instead. Further work on dumping qual expressions in EXPLAIN, too.
2002-03-21Change the aclchk.c routines to uniformly use OIDs to identify theTom Lane
objects to be privilege-checked. Some change in their APIs would be necessary no matter what in the schema environment, and simply getting rid of the name-based interface entirely seems like the best way.
2002-03-21First phase of SCHEMA changes, concentrating on fixing the grammar andTom Lane
the parsetree representation. As yet we don't *do* anything with schema names, just drop 'em on the floor; but you can enter schema-compatible command syntax, and there's even a primitive CREATE SCHEMA command. No doc updates yet, except to note that you can now extract a field from a function-returning-row's result with (foo(...)).fieldname.
2002-03-20Code review for DOMAIN patch.Tom Lane
2002-03-20Tweak behavior of array slicing operations: seems like it ought to beTom Lane
okay to omit low-order dimensions when accessing an array slice.