Commit Graph

392 Commits

Author SHA1 Message Date
Tom Lane a58843b49a Fix problems seen when result of a subselect was used in an
expression context (ie, not at the top level of a WHERE clause).  Examples
like this one work now:
SELECT name, value FROM t1 as touter WHERE
(value/(SELECT AVG(value) FROM t1 WHERE name = touter.name)) > 0.75;
1999-04-19 04:17:11 +00:00
Tom Lane 2deef968f4 After transforming a CASE expr with a default argument,
delete the default argument from the node.  This prevents the executor
from spitting up on the untransformed argument expression.  Typical
failure was:
select (case f1 when 'val' then 'subst' else f1 end) from t1;
ERROR:  copyObject: don't know how to copy 704
1999-04-18 17:35:51 +00:00
Bruce Momjian 9322950aa4 Cleanup of source files where 'return' or 'var =' is alone on a line. 1999-02-03 21:18:02 +00:00
Bruce Momjian 17467bb7fb Rename Aggreg to Aggref. 1999-01-24 00:28:37 +00:00
Thomas G. Lockhart 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
Thomas G. Lockhart bedd04a551 Implement CASE expression. 1998-12-04 15:34:49 +00:00
Bruce Momjian 9b21a18cee the following little patch adds array references to query
parameters. With it applied a function like

    CREATE FUNCTION getname(oid8, int4) RETURNS name AS
        'SELECT typname FROM pg_type WHERE oid = $1[$2]'
        LANGUAGE 'sql';

    is possible. Mainly I need this to enable array references in
    expressions for PL/pgSQL. Complete regression test ran O.K.

Jan
1998-10-02 16:23:07 +00:00
Bruce Momjian c17b2d1b16 Fix for constbyval. 1998-10-01 22:51:22 +00:00
Bruce Momjian fa1a8d6a97 OK, folks, here is the pgindent output. 1998-09-01 04:40:42 +00:00
Bruce Momjian af74855a60 Renaming cleanup, no pgindent yet. 1998-09-01 03:29:17 +00:00
Bruce Momjian 683f399391 Change atttypmod from int16 to int32, for Thomas. 1998-07-12 21:29:40 +00:00
Thomas G. Lockhart 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
Bruce Momjian 6bd323c6b3 Remove un-needed braces around single statements. 1998-06-15 19:30:31 +00:00
Thomas G. Lockhart 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
Thomas G. Lockhart 3ace5fd082 Add capabilities for automatic type conversion. 1998-05-09 23:31:34 +00:00
Bruce Momjian 0d203b745d Re-apply Darren's char2-16 removal code. 1998-04-26 04:12:15 +00:00
Bruce Momjian db21523314 Back out char2-char16 removal. Add later. 1998-04-07 18:14:38 +00:00
Bruce Momjian 57b5966405 The following uuencoded, gzip'd file will ...
1. Remove the char2, char4, char8 and char16 types from postgresql
2. Change references of char16 to name in the regression tests.
3. Rename the char16.sql regression test to name.sql.  4. Modify
the regression test scripts and outputs to match up.

Might require new regression.{SYSTEM} files...

Darren King
1998-03-30 17:28:21 +00:00
Bruce Momjian 0d8a7dc6a4 BETWEEN and LIKE patch from Thomas 1998-03-26 21:08:10 +00:00
Vadim B. Mikheev b0571ebf65 In '(a,b,...) Op [ANY|ALL] (SubSelect)' Op is restricted to
'=' and '<>'.
1998-02-27 16:07:02 +00:00
Bruce Momjian a32450a585 pgindent run before 6.3 release, with Thomas' requested changes. 1998-02-26 04:46:47 +00:00
Vadim B. Mikheev 6eeb3d9eac gram.y: ALL_SUBLINK type was returned for x Op (subquery).
parse_expr.c: only Op of bool type are supported currently...
1998-02-13 08:10:33 +00:00
Vadim B. Mikheev 7fab67a8ac Fix for EXISTS. 1998-02-13 03:41:23 +00:00
Bruce Momjian 0386a50f31 Pass around typmod as int16. 1998-02-10 16:04:38 +00:00
Bruce Momjian 65faaf3046 atttypmod now -1. 1998-02-07 06:11:56 +00:00
Bruce Momjian b20fd6c42d FIx hasSubLinks for Vadim. 1998-02-06 16:46:29 +00:00
Bruce Momjian e3f2eb1f39 Fix for varchar functions, and indextyple j-1 fix. 1998-02-05 17:22:41 +00:00
Bruce Momjian c18ed2f5a7 Parser cleanup for expr and subqueries. 1998-02-03 01:53:24 +00:00
Bruce Momjian 79f99a3888 Fix for psort. fixes regression tests. 1998-02-01 22:20:47 +00:00
Bruce Momjian 6159ba3ab1 AIX patch from Darren King and Univel patch from Billy Allie, mostly
related to grammar and parser issues, with one postmaster fix.
1998-02-01 19:43:54 +00:00
Bruce Momjian 7f31669bea Add Var.varlevelup to code. More parser cleanup. 1998-01-20 22:12:17 +00:00
Bruce Momjian 412a5e6539 Parser cleanup.
Add lock to i386 asm.
1998-01-20 05:05:08 +00:00
Bruce Momjian 1316113ea3 Fix problem with nodes handling. 1998-01-19 18:11:10 +00:00
Bruce Momjian 3d24e75176 Added code so SubLinks make it to optimizer. 1998-01-19 05:48:55 +00:00
Bruce Momjian 588867bd7b Create SubLink nodes in parser for Vadim. 1998-01-19 05:06:41 +00:00
Bruce Momjian 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
Bruce Momjian 0d9fc5afd6 Change elog(WARN) to elog(ERROR) and elog(ABORT). 1998-01-05 03:35:55 +00:00
Bruce Momjian a65e4484da Fix for aggs on views and complex ones. I missed one file. 1998-01-04 04:53:50 +00:00
Thomas G. Lockhart 98f5975cb0 Fix up some elog error messages. 1997-12-23 19:36:20 +00:00
Bruce Momjian b704426618 Make parser functions static where possible. 1997-11-26 03:43:18 +00:00
Bruce Momjian 598e86f3b3 Cleanup up include files. 1997-11-26 01:14:33 +00:00
Bruce Momjian 4a5b781d71 Break parser functions into smaller files, group together. 1997-11-25 22:07:18 +00:00