aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/formatting.c
Commit message (Collapse)AuthorAge
...
* Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian2001-01-24
|
* Fix up "Postgres-style" time interval representation when fields haveThomas G. Lockhart2001-01-18
| | | | | | | | | | mixed-signs. Previous effort left way too many minus signs, and was at least as broken as the one before that :( Clean up "ISO-style" time interval representation to omit zero fields if there is at least one non-zero field. Supress some leading plus signs when not necessary for clarity. Replace every #ifdef __CYGWIN__ block with a cleaner TIMEZONE_GLOBAL macro defined in datetime.h.
* Change comparisons of tm->tm_isdst from "nonzero" to "greater than zero".Thomas G. Lockhart2001-01-17
| | | | | | | | | Not sure why some were this way, and others were already correct, but it seems to have been like this for several years. This caused problems on a few damaged platforms like AIX and IRIX which do not support DST calculations for years before 1970. Thanks to Andreas Zeugswetter <ZeugswetterA@wien.spardat.at> for finding the problem.
* Replace overly-cute coding with code that (a) has defined behaviorTom Lane2000-12-23
| | | | | according to the ANSI C spec, (b) gets the boundary conditions right, and (c) is about a third as long and three times more intelligible.
* here is a patch fixing today's bug report:Bruce Momjian2000-12-15
| | | | | | | | | | | | | | | | | | | | > Date: Thu, 14 Dec 2000 12:44:47 +0100 (CET) > From: Kovacs Zoltan Sandor <tip@pc10.radnoti-szeged.sulinet.hu> > To: pgsql-bugs@postgresql.org > Subject: [BUGS] to_char() causes backend to close connection > > Hi, this query gives different strange results: > > select to_char(now()::abstime,'YYMMDDHH24MI'); > > I get e.g. a "backend closed the channel unexpectedly..." error with > successful or failed resetting attempt (indeterministic) Again thanks Kovacs, you found really designing bug, that appear if anyone write bad format template to "number" version of to_char() (as you with 'DD'). Karel
* Ensure that all uses of <ctype.h> functions are applied to unsigned-charTom Lane2000-12-03
| | | | | values, whether the local char type is signed or not. This is necessary for portability. Per discussion on pghackers around 9/16/00.
* It seems appropriate that the extended MEMORY_CONTEXT_CHECKING codeTom Lane2000-12-01
| | | | | immediately uncovered three of Karel's own bugs, including a routine that scribbled on its input (naughty naughty!)
* here is a patch for formatting.c (to_char/timestampt()), for 7.1Bruce Momjian2000-11-25
| | | | | | | | | | | | it fixing Y,YY,YYY,YYYY conversion, the docs and regress tests update are included too. During the patch testing I found small bug in miscadmin.h in convertstr() declaration. Here it's fixed too. Thanks Karel
* USE_POSIX_TIME replaced by HAVE_TM_ZONE || HAVE_INT_TIMEZONE, which arePeter Eisentraut2000-10-29
| | | | | | | | equivalent. In linux.h there were some #undef HAVE_INT_TIMEZONE, which are useless because HAVE_TM_ZONE overrides it anyway, and messing with configure results isn't cool.
* the patch include:Bruce Momjian2000-09-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - rename ichar() to chr() (discussed with Tom) - add docs for oracle compatible routines: btrim() ascii() chr() repeat() - fix bug with timezone in to_char() - all to_char() variants return NULL instead textin("") if it's needful. The contrib/odbc is without changes and contains same routines as main tree ... because I not sure how plans are Thomas with this :-) Karel --------------------------------------------------------------------------- This effectively one line patch should fix the fact that foreign key definitions in create table were erroring if a primary key was defined. I was using the columns list to get the columns of the table for comparison, but it got reused as a temporary list inside the primary key stuff. Stephan Szabo
* * to_char:Bruce Momjian2000-08-29
| | | | | | | | | | | | | | | | | | | | | | | - full support for IW (ISO week) and vice versa conversion for IW too (the to_char 'week' support is now complete and I hope correct). Thomas, I use for IW code from timestamp.c, for this I create separate function date2isoweek() from original 'case DTK_WEEK:' code in the timestamp_part(). I mean will better use one code for same feature in date_part() and in to_char(). The isoweek2date() is added to timestamp.c too. Right? IMHO in 7.1 will all to_char's features complete. It is cca 41 templates for date/time and cca 21 for numbers. * to_ascii: - gcc, is it correct now? :-) In the patch is documentation for to_char's IW and for to_ascii(). Karel
* bpchar, varchar, bytea, numeric are toastable --- if you initdb, whichTom Lane2000-07-29
| | | | | | I did not force. I marked numeric as compressable-but-not-move-off-able, partly to test that storage mode and partly because I've got doubts that numerics are large enough to need external storage.
* Update textin() and textout() to new fmgr style. This is just phaseTom Lane2000-07-05
| | | | | 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.
* TOASTJan Wieck2000-07-03
| | | | | | | | WARNING: This is actually broken - we have self-deadlocks due to concurrent changes in buffer management. Vadim and me are working on it. Jan
* In the attache is new (correct) version. I add TZ (timezone) supportBruce Momjian2000-07-03
| | | | | | | for to_char() too. Karel
* Back out Karels to_char changes.Bruce Momjian2000-07-01
|
* In the attache is new to_date()/to_timestamp() version.Bruce Momjian2000-07-01
| | | | | | | | | | | | Now the to_timestamp() support WW,W,J,SSSS,DDD conversion from strings and the am/pm bug is fixed, the to_char() use week-of-year (WW) full compatible with Oracle. This patch update relevant regress-tests and docs too. Karel ~ ~
* Clean up #include's.Bruce Momjian2000-06-15
|
* Big warnings cleanup for Solaris/GCC. Down to about 40 now, butPeter Eisentraut2000-06-14
| | | | | | | | | | | 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.
* Another batch of fmgr updates. I think I have gotten all old-styleTom Lane2000-06-13
| | | | | functions that take pass-by-value datatypes. Should be ready for port testing ...
* The enclosed patch changes the behaviour of the "ordinal" ('TH') format forBruce Momjian2000-06-09
| | | | | | | | | | | | | | | | | | | | | | to_char. I don't know about the rest of the world, but the "standard" in Australia is the following: 1st, 2nd, 3rd, 4th - 9th 10th - 19th 21st, 22nd, 23rd, 24th - 29th (similarly for 30s - 90s) 110th - 119th (and for all "teens") 121st, 122nd, 123rd, 124th - 129th I think you see the trend. The current code works fine except that it produces: 111st, 112nd, 113rd, 114th - 119th 211st, 212nd, 213rd, 214th - 219th ... and so on. Without knowing anything about what's supported (and what isn't) in the usual I18N libraries, should this type of behaviour be defined within the locales? Daniel Baldoni
* Another round of updates for new fmgr, mostly in the datetime code.Tom Lane2000-06-09
|
* Latest round of fmgr updates. All functions with bool,char, or int2Tom Lane2000-06-05
| | | | | | | inputs have been converted to newstyle. This should go a long way towards fixing our portability problems with platforms where char and short parameters are passed differently from int-width parameters. Still more to do for the Alpha port however.
* Ye-old pgindent run. Same 4-space tabs.Bruce Momjian2000-04-12
|
* Update create_rule manual page.Bruce Momjian2000-04-07
|
* Hi,Bruce Momjian2000-03-16
| | | | | | | | | | small changes in formatting.c code (better memory usage ...etc.) and better to_char's cache (will fastly for more to_char()s in one query). (It is probably end of to_char() development in 7.0 cycle.) Karel
* Hi,Bruce Momjian2000-03-08
| | | | | | | | | | | | | the to_char() source code is large, here are regression tests for numeric/timestamp/int8 part. It is probably enough test for formatting code in the formatting.c module. The others (float4/float8/int4) types share this formatting code and eventual bugs for these types aren't few probable. Patch fix timestamp_to_char() for infinity/invalid timestamp too. Karel
* Implement "date/time grand unification".Thomas G. Lockhart2000-02-16
| | | | | | | | | | | | | 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.
* I'm sending patch with new version of to_char numbers formatting.Bruce Momjian2000-02-08
| | | | | | | | | | | | The PostgreSQL's to_char() is very compatible with Oracle's to_char now. I hope that to_char's 3000 rows of source is without bugs, but will good if anyone test it, for me it works very well :-) Karel ---------------------------------------------------------------------- Karel Zak <zakkr@zf.jcu.cz> http://home.zf.jcu.cz/~zakkr/
* Add include for float.h.Bruce Momjian2000-01-26
|
* as attache of this mail is patch (to the main tree) with to_char'sBruce Momjian2000-01-25
family functions. Contain: conversion from a datetype to formatted text: to_char( datetime, text) to_char( timestamp, text) to_char( int4, text) to_char( int8, text) to_char( float4, text) to_char( float8, text) to_char( numeric, text) vice versa: to_date ( text, text) to_datetime ( text, text) to_timestamp ( text, text) to_number ( text, text) (convert to numeric) PostgreSQL to_char is very compatible with Oracle's to_char(), but not total exactly (now). Small differentions are in number formating. It will fix in next to_char() version. ! If will this patch aplly to the main tree, must be delete the current to_char version in contrib (directory "dateformat" and note in contrib's README), this patch not erase it (sorry Bruce). The patch patching files: doc/src/sgml/func.sgml ^^^^^^^^ Hmm, I'm not sure if my English... :( Check it anyone (volunteer)? Thomas, it is right? SGML is not my primary lang and compile the current PG docs tree is very happy job (hard variables setting in docs/sgml/Makefile --> HSTYLE= /home/users/t/thomas/.... :-) What add any definition to global configure.in and set Makefiles in docs tree via ./configure? src/backend/utils/adt/Makefile src/backend/utils/adt/formatting.c src/include/catalog/pg_proc.h src/include/utils/formatting.h Karel Zak <zakkr@zf.jcu.cz> http://home.zf.jcu.cz/~zakkr/