1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-29 10:41:53 +03:00
Commit Graph

248 Commits

Author SHA1 Message Date
86ef36c907 New NameStr macro to convert Name to Str. No need for var.data anymore.
Fewer calls to nameout.

Better use of RelationGetRelationName.
1999-11-07 23:08:36 +00:00
d40dbb7387 Eliminate local inefficiencies in updateTargetListEntry, make_var, and
make_const --- don't repeat cache searches that aren't needed.
1999-11-01 05:06:21 +00:00
7f76eab140 Rewrite parser's handling of INSERT ... SELECT so that processing
of the SELECT part of the statement is just like a plain SELECT.  All
INSERT-specific processing happens after the SELECT parsing is done.
This eliminates many problems, e.g. INSERT ... SELECT ... GROUP BY using
the wrong column labels.  Ensure that DEFAULT clauses are coerced to
the target column type, whether or not stored clause produces the right
type.  Substantial cleanup of parser's array support.
1999-07-19 00:26:20 +00:00
3406901a29 Move some system includes into c.h, and remove duplicates. 1999-07-17 20:18:55 +00:00
a71802e12e Final cleanup. 1999-07-16 05:00:38 +00:00
2e6b1e63a3 Remove unused #includes in *.c files. 1999-07-15 22:40:16 +00:00
5f74d499bf Defend against function calls with more than 8 arguments (code
used to overrun its fixed-size arrays before detecting error; not cool).
Also, replace uses of magic constant '8' with 'MAXFARGS'.
1999-06-17 22:21:41 +00:00
1bdd7c68c0 Avoid redundant SysCache searches in coerce_type, for another
few percent speedup in INSERT...
1999-05-29 03:17:20 +00:00
07842084fe pgindent run over code. 1999-05-25 16:15:34 +00:00
9432b6dd64 Do not assign output columns to junk attributes created from
GROUP BY or ORDER BY expressions in INSERT ... SELECT.
1999-05-23 21:42:09 +00:00
a8d2820e6d Fix for DEFAULT ''. 1999-05-22 04:12:29 +00:00
585c967720 Change resjunk to a boolean. 1999-05-17 17:03:51 +00:00
b8b1ba53ea SELECT * error message fix. 1999-05-17 04:19:33 +00:00
99f61dac7e Defend against 'update oid'. Someday we might want to support
that, but it'd be a New Feature, wouldn't it ... in the meantime,
avoiding a backend crash seems worthwhile.
1999-04-29 03:01:50 +00:00
9322950aa4 Cleanup of source files where 'return' or 'var =' is alone on a line. 1999-02-03 21:18:02 +00:00
17467bb7fb Rename Aggreg to Aggref. 1999-01-24 00:28:37 +00:00
2b189aa953 Improve CASE statement support.
Try to label CASE columns for a SELECT if not specified with an AS clause.
1998-12-13 23:56:44 +00:00
bedd04a551 Implement CASE expression. 1998-12-04 15:34:49 +00:00
173c555948 Make functions static or ifdef NOT_USED. Prevent pg_version creation. 1998-10-08 18:30:52 +00:00
ee88006cf2 Clean up code in analyze.c for SERIAL data type.
Remove _all_ PARSEDEBUG print statements.
1998-09-25 13:36:08 +00:00
58fdae0ddf Fix for indexing problems. 1998-09-02 23:05:37 +00:00
fa1a8d6a97 OK, folks, here is the pgindent output. 1998-09-01 04:40:42 +00:00
af74855a60 Renaming cleanup, no pgindent yet. 1998-09-01 03:29:17 +00:00
a873da484f Fix for select bug. 1998-08-26 03:17:32 +00:00
6f36e9f7c9 Cleanup of target file. 1998-08-25 03:22:49 +00:00
0fc13f582a Make sure resdomno for update/insert match attribute number for
rewrite system.  Restructure parse_target to make it easier to
understand.
1998-08-25 03:17:29 +00:00
9cad9febb1 cleanup 1998-08-23 14:43:46 +00:00
7971539020 heap_fetch requires buffer pointer, must be released; heap_getnext
no longer returns buffer pointer, can be gotten from scan;
	descriptor; bootstrap can create multi-key indexes;
pg_procname index now is multi-key index; oidint2, oidint4, oidname
are gone (must be removed from regression tests); use System Cache
rather than sequential scan in many places; heap_modifytuple no
longer takes buffer parameter; remove unused buffer parameter in
a few other functions; oid8 is not index-able; remove some use of
single-character variable names; cleanup Buffer variables usage
and scan descriptor looping; cleaned up allocation and freeing of
tuples; 18k lines of diff;
1998-08-19 02:04:17 +00:00
a1627a1d64 From: David Hartwig <daybee@bellatlantic.net>
I have attached a patch to allow GROUP BY and/or ORDER BY function or
expressions.  Note worthy items:

1. The expression or function need not be in the target list.
Example:
            SELECT  name FROM foo GROUP BY lower(name);

2.   Simplified the grammar to use expressions only.

3.  Cleaned up earlier patch in this area to make use of existing
utility functions.

3.  Reduced some of the members in the SortGroupBy parse node.   The
original data members were redundant with the new expression node.
(MUST do a "make clean" now)

4.  Added a new parse node "JoinUsing".   The JOIN USING clause was
overloading this SortGroupBy structure.   With the afore mentioned
reduction of members, the two clauses lost all their commonality.

5.  A bug still exist where, if a function or expression is GROUPed BY,
and an aggregate function does not include a attribute from the
expression or function, the backend crashes.   (or something like
that)   The bug pre-dates this patch.    Example:

    SELECT lower(a) AS lowcase, count(b) FROM foo GROUP BY lowcase;
                 *** BOOM  ***

    --Also when not in target list
    SELECT  count(b) FROM foo GROUP BY lower(a);
                *** BOOM  AGAIN ***
1998-08-05 04:49:19 +00:00
3dd2eabc53 Cleanup makeTargetEntry and remove internal.c. 1998-07-20 19:53:53 +00:00
683f399391 Change atttypmod from int16 to int32, for Thomas. 1998-07-12 21:29:40 +00:00
92ed9294de Allow floating point constants for "def_arg" numeric arguments.
Used in the generic "CREATE xxx" parsing.
Do some automatic type conversion for inserts from other columns.
Previous trouble with "resjunk" regression test remains for now.
1998-07-08 14:04:11 +00:00
6bd323c6b3 Remove un-needed braces around single statements. 1998-06-15 19:30:31 +00:00
2e6159311a I made several adjustments to my earlier patch to handle the
condition where the target label is ambiguous.
1998-06-05 03:49:20 +00:00
8536c96261 Do type conversion to match columns in UNION clauses.
Currently force the type to match the _first_ select in the union.
Move oper_select_candidate() from parse_func.c to parse_oper.c.
Throw error inside of oper_inexact() if no match for binary operators.
Check more carefully that types can be coerced
 even if there is only one candidate operator in oper_inexact().
Fix up error messages for more uniform look.
Remove unused code.
Fix up comments.
1998-05-29 14:00:24 +00:00
9f3d63936b From: David Hartwig <daveh@insightdist.com>
Here is a patch to remove the requirement that ORDER/GROUP BY clause
identifiers be included in the target list.
1998-05-21 03:53:51 +00:00
3ace5fd082 Add capabilities for automatic type conversion. 1998-05-09 23:31:34 +00:00
a32450a585 pgindent run before 6.3 release, with Thomas' requested changes. 1998-02-26 04:46:47 +00:00
edd3668895 Atttypmod cleanup. 1998-02-13 19:46:22 +00:00
0386a50f31 Pass around typmod as int16. 1998-02-10 16:04:38 +00:00
2c482cdbf2 Pass attypmod through to executor by adding to Var and Resdom. 1998-02-10 04:02:59 +00:00
412a5e6539 Parser cleanup.
Add lock to i386 asm.
1998-01-20 05:05:08 +00:00
c65ea0e040 New pg_attribute.atttypmod for type-specific information like
varchar length.

Cleans up code so attlen is always length.

Removed varchar() hack added earlier.

Will fix bug in selecting varchar() fields, and varchar() can be
variable length.
1998-01-16 23:21:07 +00:00
0d9fc5afd6 Change elog(WARN) to elog(ERROR) and elog(ABORT). 1998-01-05 03:35:55 +00:00
4b05912f0b Fix for count(*), aggs with views and multiple tables and sum(3). 1998-01-04 04:31:43 +00:00
b704426618 Make parser functions static where possible. 1997-11-26 03:43:18 +00:00
598e86f3b3 Cleanup up include files. 1997-11-26 01:14:33 +00:00
4a5b781d71 Break parser functions into smaller files, group together. 1997-11-25 22:07:18 +00:00