1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-11 20:28:21 +03:00
Commit Graph

223 Commits

Author SHA1 Message Date
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
7665e7b0a8 Allows the following query to succeed: "SELECT NULL ORDER BY 1;"
There are three or four cases in transformSortClause() and I had fixed
only one case for UNION. A second case is now fixed, in the same way; I
assigned INT4OID to the column type for the "won't actually happen"
sort. Didn't want to skip the code entirely, since the backend needs to
_try_ a sort to get the NULLs right. I'm not certain under what
circumstances the other cases are invoked and these are not yet
fixed up, though perhaps they don't need to be...
1998-08-02 13:34:26 +00:00
9fdbbdc877 Fix for UNION selects with constant NULL expressions; e.g.
SELECT 1 UNION SELECT NULL;
1998-07-14 03:51:42 +00:00
fa2a1d7d52 Handle case of GROUP BY target list column number out of range. 1998-07-09 14:34:05 +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
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
d7050cb68c Merge rename name page into alter table. Fix UNION with DISTINCT
or ORDER BY bug.
1998-03-31 04:44:35 +00:00
c530fbfb2f Add checks for UNION target fields, and add optional TABLE to LOCK
and SELECT manual pages and psql help.
1998-03-18 15:49:08 +00:00
a32450a585 pgindent run before 6.3 release, with Thomas' requested changes. 1998-02-26 04:46:47 +00:00
7e46348e62 FIx for regression-test found bug. 1998-01-20 22:55:25 +00:00
7f31669bea Add Var.varlevelup to code. More parser cleanup. 1998-01-20 22:12:17 +00:00
412a5e6539 Parser cleanup.
Add lock to i386 asm.
1998-01-20 05:05:08 +00:00
588867bd7b Create SubLink nodes in parser for Vadim. 1998-01-19 05:06:41 +00:00
e22b09c227 Fix sorting of multiple fields broken with UNION. 1998-01-06 23:58:05 +00:00
0d9fc5afd6 Change elog(WARN) to elog(ERROR) and elog(ABORT). 1998-01-05 03:35:55 +00:00
a1dd409053 Fix for ORDER BY in UNION. 1997-12-29 04:31:50 +00:00
499b13c994 UNION cleanup again. 1997-12-29 02:09:54 +00:00
a01b085c78 Cleanup of UNION ALL fix. Manual page updates. 1997-12-29 01:13:37 +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