summaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_target.c
AgeCommit message (Collapse)Author
2002-03-29pg_type has a typnamespace column; system now supports creating typesTom Lane
in different namespaces. Also, cleanup work on relation namespace support: drop, alter, rename commands work for tables in non-default namespaces.
2002-03-22A little further progress on schemas: push down RangeVars intoTom Lane
addRangeTableEntry calls. Remove relname field from RTEs, since it will no longer be a useful unique identifier of relations; we want to encourage people to rely on the relation OID instead. Further work on dumping qual expressions in EXPLAIN, too.
2002-03-21First phase of SCHEMA changes, concentrating on fixing the grammar andTom Lane
the parsetree representation. As yet we don't *do* anything with schema names, just drop 'em on the floor; but you can enter schema-compatible command syntax, and there's even a primitive CREATE SCHEMA command. No doc updates yet, except to note that you can now extract a field from a function-returning-row's result with (foo(...)).fieldname.
2002-03-12Restructure representation of join alias variables. An explicit JOINTom Lane
now has an RTE of its own, and references to its outputs now are Vars referencing the JOIN RTE, rather than CASE-expressions. This allows reverse-listing in ruleutils.c to use the correct alias easily, rather than painfully reverse-engineering the alias namespace as it used to do. Also, nested FULL JOINs work correctly, because the result of the inner joins are simple Vars that the planner can cope with. This fixes a bug reported a couple times now, notably by Tatsuo on 18-Nov-01. The alias Vars are expanded into COALESCE expressions where needed at the very end of planning, rather than during parsing. Also, beginnings of support for showing plan qualifier expressions in EXPLAIN. There are probably still cases that need work. initdb forced due to change of stored-rule representation.
2001-11-05New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian
initdb/regression tests pass.
2001-10-25pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian
tests pass.
2001-10-08Another go-round with FigureColname, to produce less surprising resultsTom Lane
for nested typecasts. It now produces a column header of 'timestamptz' for 'SELECT CURRENT_TIMESTAMP', rather than 'text' as it was doing for awhile there.
2001-09-28Measure the current transaction time to milliseconds.Thomas G. Lockhart
Define a new function, GetCurrentTransactionStartTimeUsec() to get the time to this precision. Allow now() and timestamp 'now' to use this higher precision result so we now have fractional seconds in this "constant". Add timestamp without time zone type. Move previous timestamp type to timestamp with time zone. Accept another ISO variant for date/time values: yyyy-mm-ddThh:mm:ss (note the "T" separating the day from hours information). Remove 'current' from date/time types; convert to 'now' in input. Separate time and timetz regression tests. Separate timestamp and timestamptz regression test.
2001-09-17Simplify and clean up FigureColname; make it work without coredumpingTom Lane
for TypeCast case.
2001-09-10Bug #1: attribute name when column is type cast:Bruce Momjian
Given the following table: test=# \d f Table "f" Column | Type | Modifiers --------+---------+----------- i | integer | test | text | If I do the following: test=# insert into f values(1,'test'); INSERT 139549 1 test=# select i::int8,test from f; ?column? | test ----------+------ 1 | test (1 row) It doesn't make much sense that the first column should be called '?column?'. The patch results in the output appearing like this: test=# select i::int8,test from f; i | test ---+------ 1 | test (1 row) ---------- Gavin Sherry
2001-08-09Use format_type sibling in backend error messages, so the user seesPeter Eisentraut
consistent type naming.
2001-06-24Back out BYTEA binary compatibility changes.Bruce Momjian
2001-06-23> Marko Kreen <marko@l-t.ee> writes:Bruce Momjian
> > secure_ctx changes too. it will be PGC_BACKEND after '-p'. > > Oh, okay, I missed that part. Could we see the total state of the > patch --- ie, a diff against current CVS, not a bunch of deltas? > I've gotten confused about what's in and what's out. Ok, here it is. Cleared the ctx comment too - after -p it will be PGC_BACKEND in any case. Marko Kreen
2001-05-21Print error on SELECT tab FROM tab:Bruce Momjian
You can't use relation names alone in the target list, try relation.*
2001-03-22pgindent run. Make it all clean.Bruce Momjian
2001-02-14Change scoping of table and join refnames to conform to SQL92: a JOINTom Lane
clause with an alias is a <subquery> and therefore hides table references appearing within it, according to the spec. This is the same as the preliminary patch I posted to pgsql-patches yesterday, plus some really grotty code in ruleutils.c to reverse-list a query tree with the correct alias name depending on context. I'd rather not have done that, but unless we want to force another initdb for 7.1, there's no other way for now.
2001-01-24Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian
2000-09-29Subselects in FROM clause, per ISO syntax: FROM (SELECT ...) [AS] alias.Tom Lane
(Don't forget that an alias is required.) Views reimplemented as expanding to subselect-in-FROM. Grouping, aggregates, DISTINCT in views actually work now (he says optimistically). No UNION support in subselects/views yet, but I have some ideas about that. Rule-related permissions checking moved out of rewriter and into executor. INITDB REQUIRED!
2000-09-12First cut at full support for OUTER JOINs. There are still a few looseTom Lane
ends to clean up (see my message of same date to pghackers), but mostly it works. INITDB REQUIRED!
2000-08-08Remove 'func_tlist' from Func expression nodes, likewise 'param_tlist'Tom Lane
from Param nodes, per discussion a few days ago on pghackers. Add new expression node type FieldSelect that implements the functionality where it's actually needed. Clean up some other unused fields in Func nodes as well. NOTE: initdb forced due to change in stored expression trees for rules.
2000-06-15Clean up #include's.Bruce Momjian
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-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-03-09Trial implementation of ALTER DROP COLUMN.Hiroshi Inoue
They are #ifdef'd. Add -D_DROP_COLUMN_HACK__ compile option to evaluate it.
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-26Add:Bruce Momjian
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc to all files copyright Regents of Berkeley. Man, that's a lot of files.
2000-01-17Pass atttypmod to CoerceTargetExpr, so that it can pass it on toTom Lane
coerce_type, so that the right things happen when coercing a previously- unknown constant to a destination data type.
2000-01-17Create a new parsetree node type, TypeCast, so that transformation ofTom Lane
SQL cast constructs can be performed during expression transformation instead of during parsing. This allows constructs like x::numeric(9,2) and x::int2::float8 to behave as one would expect.
2000-01-10Make number of args to a function configurable.Bruce Momjian
1999-12-10Teach grammar and parser about aggregate(DISTINCT ...). No implementationTom Lane
yet, but at least we can give a better error message: regression=> select count(distinct f1) from int4_tbl; ERROR: aggregate(DISTINCT ...) is not implemented yet instead of 'parser: parse error at or near distinct'.
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-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-11-01Eliminate local inefficiencies in updateTargetListEntry, make_var, andTom Lane
make_const --- don't repeat cache searches that aren't needed.
1999-07-19Rewrite parser's handling of INSERT ... SELECT so that processingTom Lane
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-17 Move some system includes into c.h, and remove duplicates.Bruce Momjian
1999-07-16Final cleanup.Bruce Momjian
1999-07-15Remove unused #includes in *.c files.Bruce Momjian
1999-06-17Defend against function calls with more than 8 arguments (codeTom Lane
used to overrun its fixed-size arrays before detecting error; not cool). Also, replace uses of magic constant '8' with 'MAXFARGS'.
1999-05-29Avoid redundant SysCache searches in coerce_type, for anotherTom Lane
few percent speedup in INSERT...
1999-05-25pgindent run over code.Bruce Momjian
1999-05-23Do not assign output columns to junk attributes created fromTom Lane
GROUP BY or ORDER BY expressions in INSERT ... SELECT.
1999-05-22Fix for DEFAULT ''.Bruce Momjian
1999-05-17Change resjunk to a boolean.Bruce Momjian
1999-05-17SELECT * error message fix.Bruce Momjian
1999-04-29Defend against 'update oid'. Someday we might want to supportTom Lane
that, but it'd be a New Feature, wouldn't it ... in the meantime, avoiding a backend crash seems worthwhile.
1999-02-03Cleanup of source files where 'return' or 'var =' is alone on a line.Bruce Momjian
1999-01-24Rename Aggreg to Aggref.Bruce Momjian
1998-12-13Improve CASE statement support.Thomas G. Lockhart
Try to label CASE columns for a SELECT if not specified with an AS clause.
1998-12-04Implement CASE expression.Thomas G. Lockhart