summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/ruleutils.c
AgeCommit message (Collapse)Author
2000-06-13Another batch of fmgr updates. I think I have gotten all old-styleTom Lane
functions that take pass-by-value datatypes. Should be ready for port testing ...
2000-06-12Rename rule CURRENT to OLD in source tree. Add mapping for backwardBruce Momjian
compatiblity with old rules.
2000-06-10Update rule dumper for the brave new world of ONLY.Tom Lane
2000-06-09Another round of updates for new fmgr, mostly in the datetime code.Tom Lane
2000-05-30Third round of fmgr updates: eliminate calls using fmgr() andTom Lane
fmgr_faddr() in favor of new-style calls. Lots of cleanup of sloppy casts to use XXXGetDatum and DatumGetXXX ...
2000-05-30Remove unused include files. Do not touch /port or includes used by defines.Bruce Momjian
2000-04-12Ye-old pgindent run. Same 4-space tabs.Bruce Momjian
2000-03-17Fix a bunch of minor portability problems and maybe-bugs revealed byTom Lane
running gcc and HP's cc with warnings cranked way up. Signed vs unsigned comparisons, routines declared static and then defined not-static, that kind of thing. Tedious, but perhaps useful...
2000-03-15Update comment obsoleted by Thomas's latest fixes.Tom Lane
2000-03-14Implement column aliases on views "CREATE VIEW name (collist)".Thomas G. Lockhart
Implement TIME WITH TIME ZONE type (timetz internal type). Remap length() for character strings to CHAR_LENGTH() for SQL92 and to remove the ambiguity with geometric length() functions. Keep length() for character strings for backward compatibility. Shrink stored views by removing internal column name list from visible rte. Implement min(), max() for time and timetz data types. Implement conversion of TIME to INTERVAL. Implement abs(), mod(), fac() for the int8 data type. Rename some math functions to generic names: round(), sqrt(), cbrt(), pow(), etc. Rename NUMERIC power() function to pow(). Fix int2 factorial to calculate result in int4. Enhance the Oracle compatibility function translate() to work with string arguments (from Edwin Ramirez). Modify pg_proc system table to remove OID holes.
2000-02-26Change rule dumper to produce reasonable output for casts that assignTom Lane
a specific length or precision, such as foo::char(8). Remove erroneous removal of user-written casts at the top level of a SELECT target item.
2000-02-21Quick hack solution so that pg_dump of views works. Needs repair afterTom Lane
Thomas gets back, but better this than nonfunctional pg_dump in the beta.
2000-02-20Create a new expression node type RelabelType, which exists solely toTom Lane
represent the result of a binary-compatible type coercion. At runtime it just evaluates its argument --- but during type resolution, exprType will pick up the output type of the RelabelType node instead of the type of the argument. This solves some longstanding problems with dropped type coercions, an example being 'select now()::abstime::int4' which used to produce date-formatted output, not an integer, because the coercion to int4 was dropped on the floor.
2000-02-15Repair bogus rule display of attr lists.Tom Lane
2000-02-15Carry column aliases from the parser frontend. Enables queries likeThomas G. Lockhart
SELECT a FROM t1 tx (a); Allow join syntax, including queries like SELECT * FROM t1 NATURAL JOIN t2; Update RTE structure to hold column aliases in an Attr structure.
2000-01-15Fix a passel of problems with incorrect calls to typinput and typoutputTom Lane
functions, which would lead to trouble with datatypes that paid attention to the typelem or typmod parameters to these functions. In particular, incorrect code in pg_aggregate.c explains the platform-specific failures that have been reported in NUMERIC avg().
2000-01-15Fixed all elog related warnings, as well as a few others.Peter Eisentraut
2000-01-05Fix it's and its to be correct.Bruce Momjian
1999-12-24Clean up handling of explicit NULL constants. Cases likeTom Lane
SELECT null::text; SELECT int4fac(null); work as expected now. In some cases a NULL must be surrounded by parentheses: SELECT 2 + null; fails SELECT 2 + (null); OK This is a grammatical ambiguity that seems difficult to avoid. Other than that, NULLs seem to behave about like you'd expect. The internal implementation is that NULL constants are typed as UNKNOWN (like untyped string constants) until the parser can deduce the right type.
1999-12-13aggregate(DISTINCT ...) works, per SQL spec.Tom Lane
Note this forces initdb because of change of Aggref node in stored rules.
1999-12-06Rule deparser needs to quote identifiers that are spelled the same asTom Lane
SQL keywords.
1999-11-24Add pg_statistic index, add missing Hiroshi file.Bruce Momjian
1999-11-22Add system indexes to match all caches.Bruce Momjian
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.
1999-11-15Implement subselects in target lists. Also, relax requirement thatTom Lane
subselects can only appear on the righthand side of a binary operator. That's still true for quantified predicates like x = ANY (SELECT ...), but a subselect that delivers a single result can now appear anywhere in an expression. This is implemented by changing EXPR_SUBLINK sublinks to represent just the (SELECT ...) expression, without any 'left hand side' or combining operator --- so they're now more like EXISTS_SUBLINK. To handle the case of '(x, y, z) = (SELECT ...)', I added a new sublink type MULTIEXPR_SUBLINK, which acts just like EXPR_SUBLINK used to. But the grammar will only generate one for a multiple-left-hand-side row expression.
1999-11-07New NameStr macro to convert Name to Str. No need for var.data anymore.Bruce Momjian
Fewer calls to nameout. Better use of RelationGetRelationName.
1999-10-31Rule dumper failed to affix '*' to inheritable RTEs.Tom Lane
1999-10-04Make the rule deparser a little less quote-happy, so thatTom Lane
display of default expressions isn't quite so ugly.
1999-10-03Reimplement parsing and storage of default expressions and constraintTom Lane
expressions in CREATE TABLE. There is no longer an emasculated expression syntax for these things; it's full a_expr for constraints, and b_expr for defaults (unfortunately the fact that NOT NULL is a part of the column constraint syntax causes a shift/reduce conflict if you try a_expr. Oh well --- at least parenthesized boolean expressions work now). Also, stored expression for a column default is not pre-coerced to the column type; we rely on transformInsertStatement to do that when the default is actually used. This means "f1 datetime default 'now'" behaves the way people usually expect it to. BTW, all the support code is now there to implement ALTER TABLE ADD CONSTRAINT and ALTER TABLE ADD COLUMN with a default value. I didn't actually teach ALTER TABLE to call it, but it wouldn't be much work.
1999-10-02Revise rule-printing routines to use expandable StringInfo buffers, so thatTom Lane
they have no hardwired limit on the length of a rule's text. Fix a couple of minor bugs in passing --- deparsed UPDATE queries didn't have quotes around relation name, and quotes and backslashes in constant values weren't backslash-quoted.
1999-09-02Rule deparser didn't handle unary operators correctly.Tom Lane
1999-08-28Fix several problems in rule deparsing: didn't handle arrayTom Lane
references or CASE expressions, didn't parenthesize complex expressions properly. Also, always output variable references as fully qualified names to eliminate ambiguity bug recently reported. (This could be smarter, but reliability comes first.)
1999-08-25Revise implementation of SubLinks so that there is a consistent,Tom Lane
documented intepretation of the lefthand and oper fields. Fix a number of obscure problems while at it --- for example, the old code failed if the parser decided to insert a type-coercion function just below the operator of a SubLink. CAUTION: this will break stored rules that contain subplans. You may need to initdb.
1999-08-21Major revision of sort-node handling: push knowledge of queryTom Lane
sort order down into planner, instead of handling it only at the very top level of the planner. This fixes many things. An explicit sort is now avoided if there is a cheaper alternative (typically an indexscan) not only for ORDER BY, but also for the internal sort of GROUP BY. It works even when there is no other reason (such as a WHERE condition) to consider the indexscan. It works for indexes on functions. It works for indexes on functions, backwards. It's just so cool... CAUTION: I have changed the representation of SortClause nodes, therefore THIS UPDATE BREAKS STORED RULES. You will need to initdb.
1999-07-17 Move some system includes into c.h, and remove duplicates.Bruce Momjian
1999-07-15Remove unused #includes in *.c files.Bruce Momjian
1999-07-15Clean up #include in /include directory. Add scripts for checking includes.Bruce Momjian
1999-06-02Changed "current." into "old." in rule string backparsingJan Wieck
Jan
1999-05-25Another pgindent run. Sorry folks.Bruce Momjian
1999-05-25Make 0x007f -> (unsigned)0x7f to make pgindent happy.Bruce Momjian
1999-05-25pgindent run over code.Bruce Momjian
1999-05-25Fixed bug in rules event qualification output.Jan Wieck
Jan
1999-05-12Fixed small bug in ruleutils and added output of pg_views andJan Wieck
pg_rules to rules regression test. Jan
1999-05-12Replaced targetlist entry in GroupClause by reference numberJan Wieck
in Resdom and GroupClause so changing of resno's doesn't confuse the grouping any more. Jan
1999-05-10Change error messages to oids come out as %u and not %d. Change has noBruce Momjian
real affect now.
1999-05-03here are some patches for 6.5.0 which I already submitted but have neverBruce Momjian
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
1999-04-29Bugfix (bug by me in 1.4) in backparsing INSERT ... SELECTJan Wieck
Jan
1999-01-25Agg/Aggreg cleanup and datetime.sql patch.Bruce Momjian
1999-01-24Rename Aggreg to Aggref.Bruce Momjian
1998-10-26Get rid of some minor compiler warnings.Tom Lane
1998-10-06 Playing around with pg_dump for a while resulted in someBruce Momjian
fixes, enhancements and some found bugs not yet fixed. After all I was able to get useful results when dumping/reloading the regression database. Jan