Commit Graph

201 Commits

Author SHA1 Message Date
Tom Lane 9e7e29e6c9 First cut at doing LIKE/regex indexing optimization in
optimizer rather than parser.  This has many advantages, such as not
getting fooled by chance uses of operator names ~ and ~~ (the operators
are identified by OID now), and not creating useless comparison operations
in contexts where the comparisons will not actually be used as indexquals.
The new code also recognizes exact-match LIKE and regex patterns, and
produces an = indexqual instead of >= and <=.

This change does NOT fix the problem with non-ASCII locales: the code
still doesn't know how to generate an upper bound indexqual for non-ASCII
collation order.  But it's no worse than before, just the same deficiency
in a different place...

Also, dike out loc_restrictinfo fields in Plan nodes.  These were doing
nothing useful in the absence of 'expensive functions' optimization,
and they took a considerable amount of processing to fill in.
1999-07-27 03:51:11 +00:00
Tom Lane 2908bd535f Complain about INSERT ... SELECT ... ORDER BY, which we do not
support, but which the grammar was accepting.  Also, fix several bugs
having to do with failure to copy fields up from a subselect to a select
or insert node.
1999-07-20 00:18:01 +00:00
Bruce Momjian 3406901a29 Move some system includes into c.h, and remove duplicates. 1999-07-17 20:18:55 +00:00
Tom Lane f9e2c7fae8 Allow bare column names to be subscripted as arrays. This
creates a reduce/reduce conflict, which I resolved by changing the
'AexprConst -> Typename Sconst' rule to 'AexprConst -> SimpleTypename Sconst'.
In other words, a subscripted type declaration can't be used in that
syntax any longer.  This seems a small price to pay for not having to
qualify subscripted columns anymore.
Other cleanups: rename res_target_list to update_target_list, and remove
productions for variants that are not legal in an UPDATE target list;
rename res_target_list2 to plain target_list; delete position_expr
in favor of using b_expr in that production; merge opt_indirection
into attr nonterminal, since there are no places where an unsubscripted
attr is wanted; fix typos in Param support; change case_arg so that
an arbitrary a_expr is allowed, not only a column name.
1999-07-16 22:29:42 +00:00
Bruce Momjian a71802e12e Final cleanup. 1999-07-16 05:00:38 +00:00
Bruce Momjian 4b2c2850bf Clean up #include in /include directory. Add scripts for checking includes. 1999-07-15 15:21:54 +00:00
Bruce Momjian ad4948862c Remove S*I comments from Stephan. 1999-07-13 21:17:45 +00:00
Bruce Momjian 863db45e86 Make ^ precidence greater than *. 1999-07-09 21:59:59 +00:00
Bruce Momjian 104d6c816e Add ^ precidence. 1999-07-08 00:00:43 +00:00
Bruce Momjian eba41848aa Clarify maximum tuple and max attribute lengths. 1999-07-04 04:56:02 +00:00
Bruce Momjian 97dfff832c Fix to prevent too large tuple from being created. 1999-07-03 00:33:04 +00:00
Tom Lane bad3b3068d Repair recently-introduced error in makeIndexable for LIKE:
a non-leading % would be put into the >=/<= patterns.  Also, repair
longstanding confusion about whether %% means a literal %%.  The SQL92
doesn't say any such thing, and textlike() knows that, but gram.y didn't.
1999-06-07 14:28:26 +00:00
Bruce Momjian e9edb3ef92 Fix for select 1;select 2 without trailing semi. 1999-05-22 05:06:43 +00:00
Bruce Momjian c0d979614e Fix typo and attempt default fix. 1999-05-21 18:31:06 +00:00
Bruce Momjian 96492290b5 Treat {} as special regex too. 1999-05-21 15:47:13 +00:00
Bruce Momjian 56b9a549c7 Fix problem with | in ~ comparison using index. 1999-05-21 04:40:04 +00:00
Jan Wieck 443c08a110 Fixed shift/reduce conflict
SelectStmt and CursorStmt tried to parse FOR UPDATE ... / FOR READ ONLY.
Cursor now checks that it is read only by looking at forUpdate of Query.
SelectStmt handles FOR READ ONLY too.

Jan
1999-05-20 12:12:55 +00:00
Bruce Momjian 6d08b6a7b8 Remove 4096 string limited key on block size 1999-05-19 17:53:12 +00:00
Bruce Momjian 61f618e73e Move IN to proper place. 1999-05-17 01:01:06 +00:00
Bruce Momjian a341db91c5 Cleanup 1999-05-17 00:31:49 +00:00
Bruce Momjian c686be8d56 Require IN in LOCK syntax. 1999-05-17 00:22:07 +00:00
Thomas G. Lockhart bcb5aac81d Add keywords to implement Vadim's transaction isolation
and lock syntax as fully parsed tokens.
Two keywords for isolation are non-reserved SQL92
 (COMMITTED, SERIALIZABLE).
All other new keywords are non-reserved Postgres (not SQL92)
 (ACCESS, EXCLUSIVE, MODE, SHARE).
Add syntax to allow CREATE [GLOBAL|LOCAL] TEMPORARY TABLE, throwing an
 error if GLOBAL is specified.
1999-05-12 07:22:52 +00:00
Bruce Momjian 12f9de3fd4 clean up comments 1999-05-11 03:28:43 +00:00
Bruce Momjian 210055ad61 here are some patches for 6.5.0 which I already submitted but have never
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-05-03 19:10:48 +00:00
Jan Wieck 26909a0797 Fixed DECIMAL data type to handle specified precision in atttypmod
Jan
1999-04-27 13:33:43 +00:00
Bruce Momjian 6eccfbc727 Add temporary for temp. 1999-04-19 16:00:18 +00:00
Bruce Momjian 9aa535a2b9 Add % to b_expr. 1999-03-22 05:07:32 +00:00
Bruce Momjian f8263c52b0 cleanup 1999-03-21 02:30:22 +00:00
Bruce Momjian 7ed3b89d48 Fix for %4 and 4%. 1999-03-21 02:26:56 +00:00
Bruce Momjian 5bfac23006 Fix shift/reduce for NULL = Var. 1999-03-19 23:48:50 +00:00
Bruce Momjian 5dd9b58a86 grammar cleanup' 1999-03-18 22:03:59 +00:00
Bruce Momjian ddd50c440a cleanup of grammer. 1999-03-18 22:01:56 +00:00
Bruce Momjian 30ad427388 Fix optimizer indexing not working for negative numbers. 1999-03-18 21:39:56 +00:00
Bruce Momjian 4989feaf3d Left associates all operators, instead of non-associating them. 1999-03-17 21:02:57 +00:00
Bruce Momjian 3b43accb0f Have % operator have precedence like /. 1999-03-17 20:17:13 +00:00
Bruce Momjian 3a03e3cd30 cleanup 1999-03-15 22:20:20 +00:00
Bruce Momjian d13fe29000 I have a problem with Access97 not working properly when entering new
records using a sub form, i.e. entering a new order/orderlines or master
and
detail tables.  The problem is caused by a SQL statement that Access97
makes
involving NULL.  The syntax that fails is "column_name" = NULL.  The
following attachment was provided by -Jose'-.  It contains a very small
enhancement to gram.y that will allow Access97 to work properly with sub
forms.  Can this enhancement be added to release 6.5?

 <<gram.patch>>
Thanks, Michael
1999-03-14 05:15:08 +00:00
Bruce Momjian 60bb92af33 Really remove Recipe. 1999-03-07 03:34:11 +00:00
Thomas G. Lockhart 03d5c070f0 Modify the outer join placeholder code with something closer to working
code. Works here, but not completely implemented past this point.
1999-02-23 07:42:41 +00:00
Marc G. Fournier 8c3e8a8a0e From: Tatsuo Ishii <t-ishii@sra.co.jp>
Ok. I made patches replacing all of "#if FALSE" or "#if 0" to "#ifdef
NOT_USED" for current. I have tested these patches in that the
postgres binaries are identical.
1999-02-21 03:49:55 +00:00
Bruce Momjian 6724a50787 Change my-function-name-- to my_function_name, and optimizer renames. 1999-02-13 23:22:53 +00:00
Jan Wieck be948af2e8 Added LIMIT/OFFSET functionality including new regression test for it.
Removed CURRENT keyword for rule queries and changed rules regression
accordingly. CURRENT has beed announced to disappear in v6.5.

Jan
1999-02-08 14:14:32 +00:00
Jan Wieck 28fc5d7b83 Reenabled parentheses for grouping multiple rule actions and
added this syntax to rules regression test so it will show up
if someone breaks it again.

Jan
1999-02-07 19:02:20 +00:00
Tom Lane fd1afb7453 Fix silly typo causing SELECT INTO TABLE to sometimes be
treated as SELECT INTO TEMP TABLE.
1999-02-06 20:28:11 +00:00
Bruce Momjian eb3415538e OK I found it,
I search in the planner for the '\xFF' appending.
Finally I found in MakeIndexable() in gram.y

Attach a patch which removes the "<=" test in USE_LOCALE,
might make some queries a bit slower for us "locale-heads",
BUT correct result is more important.

        regards,
--
-----------------
Göran Thyni
1999-02-02 19:20:54 +00:00
Bruce Momjian 4390b0bfbe Add TEMP tables/indexes. Add COPY pfree(). Other cleanups. 1999-02-02 03:45:56 +00:00
Vadim B. Mikheev 247b3f9054 SELECT FOR UPDATE is implemented... 1999-01-25 12:01:19 +00:00
Bruce Momjian 598b628b27 Fix for intersect FOR UPDATE check. 1999-01-22 19:35:54 +00:00
Vadim B. Mikheev 12be3e08f1 FOR UPDATE is in parser & rules. 1999-01-21 16:08:55 +00:00
Bruce Momjian 2a6081235c Add Intersect check. 1999-01-20 19:48:13 +00:00