summaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_coerce.c
AgeCommit message (Collapse)Author
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-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-06-19Add IS UNKNOWN, IS NOT UNKNOWN boolean tests, fix the existing booleanTom Lane
tests to return the correct results per SQL9x when given NULL inputs. Reimplement these tests as well as IS [NOT] NULL to have their own expression node types, instead of depending on special functions. From Joe Conway, with a little help from Tom Lane.
2001-05-22Make bit and bit varying types reject too long input. (They already triedPeter Eisentraut
to do that, but inconsistently.) Make bit type reject too short input, too, per SQL. Since it no longer zero pads, 'zpbit*' has been renamed to 'bit*' in the source, hence initdb.
2001-03-22pgindent run. Make it all clean.Bruce Momjian
2001-02-27Fix vacuum analyze error.Tatsuo Ishii
vacuum analyze on pg_type fails if bogus entries remain in pg_operator. Here is a sample script to reproduce the problem. drop table t1; create table t1(i int); drop function foo(t1,t1); create function foo(t1,t1) returns bool as 'select true' language 'sql'; create operator = ( leftarg = t1, rightarg = t1, commutator = =, procedure = foo ); drop table t1; vacuum analyze;
2001-01-24Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian
2001-01-17Change lcons(x, NIL) to makeList(x) where appropriate.Bruce Momjian
2000-12-17Tweak select_common_type() to deal with possibility of multiple preferredTom Lane
types in a category --- it was taking the last preferred type among the inputs, rather than the first one as intended.
2000-12-15Remove obsolete comment.Tom Lane
2000-11-17Add separate type category for bit string types, allowing mixed bit/varbitPeter Eisentraut
function calls to work.
2000-11-16Change SearchSysCache coding conventions so that a reference count isTom Lane
maintained for each cache entry. A cache entry will not be freed until the matching ReleaseSysCache call has been executed. This eliminates worries about cache entries getting dropped while still in use. See my posting to pg-hackers of even date for more info.
2000-11-09Arrange for CASE or UNION with only untyped literal constants as inputTom Lane
to resolve the unknown constants as type TEXT.
2000-10-05Reimplementation of UNION/INTERSECT/EXCEPT. INTERSECT/EXCEPT now meet theTom Lane
SQL92 semantics, including support for ALL option. All three can be used in subqueries and views. DISTINCT and ORDER BY work now in views, too. This rewrite fixes many problems with cross-datatype UNIONs and INSERT/SELECT where the SELECT yields different datatypes than the INSERT needs. I did that by making UNION subqueries and SELECT in INSERT be treated like subselects-in-FROM, thereby allowing an extra level of targetlist where the datatype conversions can be inserted safely. INITDB NEEDED!
2000-07-30Type lztext is toast.Tom Lane
(Sorry, couldn't help it...) Removed type filename as well, since it's unused and probably useless. INITDB FORCED, because pg_rewrite columns are now plain text again.
2000-07-05Update textin() and textout() to new fmgr style. This is just phaseTom Lane
one of updating the whole text datatype, but there are so dang many calls of these two routines that it seems worth a separate commit.
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-04-08Tweak TypeCategory to treat new BIT types as of STRING category, ratherTom Lane
than not knowing what they are at all. Perhaps they should have their own type category? Hard to say. In the meantime, doing it this way allows SELECT 'unknown' || 'unknown' to continue being resolved as textcat, instead of spitting out an ambiguous-operator error.
2000-03-23Hack parse_coerce so it won't try to constant-fold the dummy ConstTom Lane
nodes introduced by make_subplan(). It'd be better if we used a different node type for subplan result placeholders, but for now...
2000-03-20Reverse out BYTEA type coersion.Bruce Momjian
2000-03-20Add compatiblity information for bytea.Bruce Momjian
2000-03-19In can_coerce_type, verify that a possible type-coercion functionTom Lane
actually returns the type it is named for.
2000-03-16Turns out that Mazurkiewicz's gripe about 'function inheritance' isTom Lane
actually a type-coercion problem. If you have a function defined on class A, and class B inherits from A, then the function ought to work on class B as well --- but coerce_type didn't know that. Now it does.
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-11Make TypeCategory think that NAME is a member of typeTom Lane
category STRING. Also, if UNKNOWNOID is passed in, return UNKNOWN_TYPE not USER_TYPE.
2000-02-27Add lztext to TypeCategory so that lztext OP text cases will workTom Lane
correctly (the lztext value will be promoted to text automatically).
2000-02-20Create a new expression node type RelabelType, which exists solely toTom Lane
represent the result of a binary-compatible type coercion. At runtime it just evaluates its argument --- but during type resolution, exprType will pick up the output type of the RelabelType node instead of the type of the argument. This solves some longstanding problems with dropped type coercions, an example being 'select now()::abstime::int4' which used to produce date-formatted output, not an integer, because the coercion to int4 was dropped on the floor.
2000-02-20Even after the great date/time consolidation, TypeCategory() was stillTom Lane
a few bricks shy of a load concerning knowing all the date/time types. This is real bad because it interferes with func_select_candidate()'s willingness to disambiguate functions --- func_select_candidate() will punt unless all the available choices have the same type category. I think this whole mechanism needs redesigned, but in the meantime this is a needed patch.
2000-02-16Implement "date/time grand unification".Thomas G. Lockhart
Transform datetime and timespan into timestamp and interval. Deprecate datetime and timespan, though translate to new types in gram.y. Transform all datetime and timespan catalog entries into new types. Make "INTERVAL" reserved word allowed as a column identifier in gram.y. Remove dt.h, dt.c files, and retarget datetime.h, datetime.c as utility routines for all date/time types. date.{h,c} now deals with date, time types. timestamp.{h,c} now deals with timestamp, interval types. nabstime.{h,c} now deals with abstime, reltime, tinterval types. Make NUMERIC a known native type for purposes of type coersion. Not tested.
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-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-10-02Teach parse_coerce about non-cachable functions (actually,Tom Lane
make it call eval_const_expressions() so that it doesn't have to know).
1999-08-24coerce_type() failed to guard against trying to convert a NULLTom Lane
constant to a different type. Not sure that this could happen in ordinary parser usage, but it can in some new code I'm working on...
1999-08-05Revise parse_coerce() to handle coercion of int and floatTom Lane
constants, not only string constants, at parse time. Get rid of parser_typecast2(), which is bogus and redundant...
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-22Fix for DEFAULT ''.Bruce Momjian
1999-05-22Make postgres prompt backend>, and remove PARSEDEBUG.Bruce Momjian
1999-05-19Upgrade to PyGreSQL (2.4)Bruce Momjian
1999-05-10Change error messages to oids come out as %u and not %d. Change has noBruce Momjian
real affect now.