summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/datetime.c
AgeCommit message (Collapse)Author
2000-06-14Big warnings cleanup for Solaris/GCC. Down to about 40 now, butPeter Eisentraut
we'll get there one day. Use `cat' to create aclocal.m4, not `aclocal'. Some people don't have automake installed. Only run the autoconf rule in the top-level GNUmakefile if the invoker specified `make configure', don't run it automatically because of CVS timestamp skew.
2000-06-08Mark functions as static and ifdef NOT_USED as appropriate.Bruce Momjian
2000-05-29Repair problems with overrun of timezone name length. Increase MAXTZLENTom Lane
to 10, and be consistent about whether it counts the trailing null (it does not). Also increase MAXDATELEN to be sure no buffer overflows are caused by the longer MAXTZLEN.
2000-04-14Fix (well, add) support for ISO "week" in date_part(). Needed for ODBC.Thomas G. Lockhart
Fix spelling of "millennium". Thanks to Mika Nystrom <mika@camembert.cs.caltech.edu> for spotting this.
2000-04-12Ye-old pgindent run. Same 4-space tabs.Bruce Momjian
2000-03-29Change rules for interpreting date/time input to disallow 1 and 3 characterThomas G. Lockhart
years. Rejects dates like '0.085', which were accepted previously.
2000-03-16Support full POSIX-style time zone: EST+3, PST-3, etc.Thomas G. Lockhart
We probably support a superset of the spec, but I don't have the spec to confirm this. Update regression tests to include tests for this format.
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-02-16All regression tests pass except for rules.sql (unrelated).Thomas G. Lockhart
Implement "date/time grand unification". 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-15Fixed all elog related warnings, as well as a few others.Peter Eisentraut
2000-01-02Remove DATEDEBUG because it didn't look Y2K safe, and fix timestamp elogBruce Momjian
to be Y2K safe.
1999-07-17 Move some system includes into c.h, and remove duplicates.Bruce Momjian
1999-07-16Update #include cleanupsBruce Momjian
1999-07-15Remove unused #includes in *.c files.Bruce Momjian
1999-07-15Clean up #include in /include directory. Add scripts for checking includes.Bruce Momjian
1999-07-14Cleanup of /include #include's, for 6.6 only.Bruce Momjian
1999-05-25pgindent run over code.Bruce Momjian
1999-04-26Fix from Yutaka Tanida <yutaka@marin.or.jp> for Cygwin32 support.Tatsuo Ishii
1999-04-15Fix code to check legal dates *before* calling localtime() to get theThomas G. Lockhart
time zone. Previously, localtime() rotated a date with a day of month field which exceeded the actual range into the next months, masking the fact that a bad date had been specified. Regression tests pass.
1999-03-14Here is a little syntax error found in a .y file... A dropped semi.Bruce Momjian
DwD -- Daryl W. Dunbar
1999-02-21From: Tatsuo Ishii <t-ishii@sra.co.jp>Marc G. Fournier
Ok. I made patches replacing all of "#if FALSE" or "#if 0" to "#ifdef NOT_USED" for current. I have tested these patches in that the postgres binaries are identical.
1999-02-13Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian
1999-01-20Fix "Y-2K" problem with two-digit BC dates being corrected by two millenia.Thomas G. Lockhart
They are not corrected now. Allow the date type to accept BC dates. Share more date/time validation declarations through dt.h.
1998-12-31Change ordering of HAVE_TM_ZONE and HAVE_INT_TIMEZONE code blocksThomas G. Lockhart
to give HAVE_TM_ZONE priority. This fixes glibc2 machines and any other machine which passes both tests in configure. Repair HAVE_TM_ZONE code which stuffs tm structure with date type values. Same problems as were originally there before v6.1, but never noticed. Thanks to Oleg for nagging :)
1998-09-01Renaming cleanup, no pgindent yet.Bruce Momjian
1998-08-19heap_fetch requires buffer pointer, must be released; heap_getnextBruce Momjian
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-06-15Remove un-needed braces around single statements.Bruce Momjian
1998-02-26pgindent run before 6.3 release, with Thomas' requested changes.Bruce Momjian
1998-01-07Allow varchar() to only store needed bytes. Remove PALLOC,PALLOCTYPE,PFREE. ↵Bruce Momjian
Clean up use of VARDATA.
1998-01-05Change some ABORTS to ERROR. Add line number when COPY Failure.Bruce Momjian
1998-01-05Change elog(WARN) to elog(ERROR) and elog(ABORT).Bruce Momjian
1997-12-23Change a few routine names back to full length now that pg_proc allowsThomas G. Lockhart
names over 16 characters. datet_datetime() -> datetime_datetime(), etc.
1997-10-25Add conversion from datetime to time data type.Thomas G. Lockhart
Rename date+time conversion to datetime to ensure less than 16 characters in routine name (required to fit in pg_proc table).
1997-09-08Used modified version of indent that understands over 100 typedefs.Bruce Momjian
1997-09-08Another PGINDENT run that changes variable indenting and case label ↵Bruce Momjian
indenting. Also static variable indenting.
1997-09-07Massive commit to run PGINDENT on all *.c and *.h files.Bruce Momjian
1997-09-05Cleanups needed for indent. Remove };Bruce Momjian
1997-08-28Fix time_cmpVadim B. Mikheev
1997-08-19Make functions static where possible, enclose unused functions in #ifdef ↵Bruce Momjian
NOT_USED.
1997-07-01Use common parser and encoder for timestamp data type.Thomas G. Lockhart
Remove older date and time code (retain NEW_DATE_CODE and NEW_TIME_CODE). Use common encoder for date and time. Fix datetime +/- timespan math bug.
1997-06-23Expunge code not enabled with USE_NEW_DATE and USE_NEW_TIME #defines.Thomas G. Lockhart
1997-06-03Fix a few DATEDEBUG print statements.Thomas G. Lockhart
1997-05-30Clean up support for USE_POSIX_TIME, ! HAVE_INT_TIMEZONE machines.Thomas G. Lockhart
Remove references to modf() which is buggy on some platforms (Sparc/Linux).
1997-05-16Fix datetime and abstime conversions to and from date.Thomas G. Lockhart
Bring optional new-storage date and time up to date and test. This new storage format should fix the "Sparc gcc -O2 bug". (Enable new code with USE_NEW_DATE and USE_NEW_TIME in dt.h)
1997-05-11Fix timezone manipulation code to avoid crashes on some machines.Thomas G. Lockhart
Add type conversion functions for floating point numbers. Check for zero in unary minus floating point code (IEEE allows an explicit negative zero which looks ugly in a query result!). Ensure circle type has non-negative radius.
1997-04-17From: "Martin J. Laubach" <mjl@CSlab.tuwien.ac.at>Marc G. Fournier
Subject: [HACKERS] Patch: set date to euro/us postgres/iso/sql Here a patch that implements a SET date for use by the datetime stuff. The syntax is SET date TO 'val[,val,...]' where val is us (us dates), euro (european dates), postgres, iso or sql. Thomas is working on the integration in his datetime module. I just needed to get the patch out before it went stale :)
1997-04-04Again, needs float.hMarc G. Fournier
1997-04-02From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>Marc G. Fournier
Subject: [HACKERS] More date time functions Here are some additional patches mostly related to the date and time data types. It includes some type conversion routines to move between the different date types and some other date manipulation routines such as date_part(units,datetime). I noticed Edmund Mergl et al's neat trick for getting function overloading for builtin functions, so started to use that for the date and time stuff. Later, if someone figures out how to get function overloading directly for internal C code, then we can move to that technique. These patches include documentation updates (don't faint!) for the built-in man page. Doesn't yet include mention of timestamp, since I don't know much about it and since it may change a bit to become a _real_ ANSI timestamp which would include parser support for the declaration syntax (what do you think, Dan?). The patches were developed on the 970330 release, but have been rebuilt off of the 970402 release. The first patch below is to get libpq to compile, on my Linux box, but is not related to the rest of the patches and you can choose not to apply that one at this time. Thanks in advance, scrappy!
1997-03-14Date/Time updates from Thomas...Marc G. Fournier