aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
Commit message (Collapse)AuthorAge
...
* Change SearchSysCache coding conventions so that a reference count isTom Lane2000-11-16
| | | | | | | 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.
* Print bit values as binary strings (not hex)Peter Eisentraut2000-11-16
|
* Clean up array-dimensions parser a bit.Tom Lane2000-11-14
| | | | This code still needs a lot of love, however ...
* Allow interpretation of INTERVALs with more timezone-like syntax.Thomas G. Lockhart2000-11-11
| | | | | | Define conversions to and from text for date, time, and timetz. Have millisecond and microsecond return full # of seconds in those units. Previously, only returned full fractional part in those units.
* Adjust INET/CIDR display conventions and reimplement some INET/CIDRTom Lane2000-11-10
| | | | | | | functions, per recent discussions on pghackers. For now, I have called the verbose-display formatting function text(), but will reconsider if enough people object. initdb forced.
* Use SearchSysCacheTupleCopy() instead of SearchSysCacheTuple() inHiroshi Inoue2000-11-10
| | | | | order to continue to access the tuple more than now. This would resolve a segmentation fault error.
* This somehow gets moot. Is there a way to make gcc reject those comments?Bruce Momjian2000-11-07
| | | | Andreas
* Fix INTERVAL output when year/month has different sign as day/hour etc.Thomas G. Lockhart2000-11-06
| | | | | | | | | | | | | | Previously, all fields were unsigned, with only a trailing "ago" to indicate negative intervals. Now, ISO format does not use "ago", and and the traditional PostgreSQL format has the first numeric field unsigned with "ago" supporting that field. So "1 month - 2 days ago" is two days less than a month in the past. Fix interval arithmetic across daylight savings time boundaries. Previously, most math across boundaries introduced a one hour offset. Allow some date/time functions to return NULL if called with NULL args. Implement functions for AT TIME ZONE support. Support "SAT" as an Australian time zone if USE_AUSTRALIAN_RULES is defined.
* Allow ORDER BY, LIMIT in sub-selects. Fix most (not all) cases whereTom Lane2000-11-05
| | | | | | the grammar did not allow redundant parentheses around sub-selects. Distinguish LIMIT ALL from LIMIT 0; make the latter behave as one would expect.
* Fix bug reported by bobson: aclinsert3 would delete the 'world' entryTom Lane2000-11-03
| | | | | from an ACL list if it had no permissions remaining, which confused aclcheck terribly. Also clean up code a little.
* Change the parser to convert SQL "position" and "substring" syntax toPeter Eisentraut2000-10-31
| | | | | | | | | | position() and substring() functions, so that it works transparently for bit types as well. Alias the text functions appropriately. Add position() for bit types. Add new constant node T_BitString that represents literals of the form B'1001 and pass those to zpbit type.
* 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.
* Disallow bits beyond the mask length for CIDR values, per discussionTom Lane2000-10-27
| | | | | | | on pghackers. Arrange for the sort ordering of general INET values to be network part as major sort key, host part as minor sort key. I did not force an initdb for this change, but anyone who's running indexes on general INET values may need to recreate those indexes.
* Re-implement LIMIT/OFFSET as a plan node type, instead of a hack inTom Lane2000-10-26
| | | | | | ExecutorRun. This allows LIMIT to work in a view. Also, LIMIT in a cursor declaration will behave in a reasonable fashion, whereas before it was overridden by the FETCH count.
* Minor cleanup.Tom Lane2000-10-25
|
* Integer binary operators, from Marko Kreen <marko@l-t.ee>. Renamed bitxorPeter Eisentraut2000-10-24
| | | | operator to '#' for consistency. Parser still needs work.
* Makeover for Unixware 7.1.1Peter Eisentraut2000-10-22
| | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile: Add more standard targets. Improve shell redirection in GNU make detection. * src/backend/access/transam/rmgr.c: Fix incorrect(?) C. * src/backend/libpq/pqcomm.c (StreamConnection): Work around accept() bug. * src/include/port/unixware.h: ...with help from here. * src/backend/nodes/print.c (plannode_type): Remove some "break"s after "return"s. * src/backend/tcop/dest.c (DestToFunction): ditto. * src/backend/nodes/readfuncs.c: Add proper prototypes. * src/backend/utils/adt/numutils.c (pg_atoi): Cope specially with strtol() setting EINVAL. This saves us from creating an extra set of regression test output for the affected systems. * src/include/storage/s_lock.h (tas): Correct prototype. * src/interfaces/libpq/fe-connect.c (parseServiceInfo): Don't use variable as dimension in array definition. * src/makefiles/Makefile.unixware: Add support for GCC. * src/template/unixware: same here * src/test/regress/expected/abstime-solaris-1947.out: Adjust whitespace. * src/test/regress/expected/horology-solaris-1947.out: Part of this file was evidently missing. * src/test/regress/pg_regress.sh: Fix shell. mkdir -p returns non-zero if the directory exists. * src/test/regress/resultmap: Add entries for Unixware.
* Add support for VPATH builds, that is, building somewhere else than in thePeter Eisentraut2000-10-20
| | | | | | | | | source directory. This involves mostly makefiles using $(srcdir) when they might have used ".". (Regression tests don't work with this, yet.) Sort out usage of CPPFLAGS, CFLAGS (and CXXFLAGS). Add "override" keyword in most places, to preserve necessary flags even when the user overrode the flags.
* Remove NO_SECURITY define.Bruce Momjian2000-10-16
|
* Arrange that no database accesses are attempted during parser() --- thisTom Lane2000-10-07
| | | | | | | | | | | | | | | took some rejiggering of typename and ACL parsing, as well as moving parse_analyze call out of parser(). Restructure postgres.c processing so that parse analysis and rewrite are skipped when in abort-transaction state. Only COMMIT and ABORT statements will be processed beyond the raw parser() phase. This addresses problem of parser failing with database access errors while in aborted state (see pghackers discussions around 7/28/00). Also fix some bugs with COMMIT/ABORT statements appearing in the middle of a single query input string. Function, operator, and aggregate arguments/results can now use full TypeName production, in particular foo[] for array types. DROP OPERATOR and COMMENT ON OPERATOR were broken for unary operators. Allow CREATE AGGREGATE to accept unquoted numeric constants for initcond.
* Fix silly typo that led to 'tleIsArrayAssign: I'm confused' message.Tom Lane2000-10-05
| | | | Indeed it was.
* Add proofreader's changes to docs.Bruce Momjian2000-10-05
| | | | Fix misspelling of disbursion to dispersion.
* Reimplementation of UNION/INTERSECT/EXCEPT. INTERSECT/EXCEPT now meet theTom Lane2000-10-05
| | | | | | | | | | | 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!
* New diff that now covers the entire tree. Applying this gets postgresqlBruce Momjian2000-10-03
| | | | | | | | | | | | | | | | | working on the VERY latest version of BeOS. I'm sure there will be alot of comments, but then if there weren't I'd be disappointed! Thanks for your continuing efforts to get this into your tree. Haven't bothered with the new files as they haven't changed. BTW Peter, the compiler is "broken" about the bool define and so on. I'm filing a bug report to try and get it addressed. Hopefully then we can tidy up the code a bit. I await the replies with interest :) David Reid
* Make default ACL be consistent --- ie, starting point for ChangeAclTom Lane2000-10-02
| | | | | is the same as the access permissions granted when a relation's relacl field is NULL, ie, owner=all rights, world=no rights.
* Subselects in FROM clause, per ISO syntax: FROM (SELECT ...) [AS] alias.Tom Lane2000-09-29
| | | | | | | | | (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!
* New unified regression test driver, test/regress makefile cleanup,Peter Eisentraut2000-09-29
| | | | | add "check" and "installcheck" targets, straighten out make variable naming of host_os, host_cpu, etc.
* Standardize on __CYGWIN__ rather than __CYGWIN32__ macro. Doesn't matterPeter Eisentraut2000-09-29
| | | | | either way (although the former is preferred by the Cygwin folks themselves), but using only one seems nicer.
* When the RI triggers lock the PK table, temporarily switch the current userPeter Eisentraut2000-09-25
| | | | id to the owner of the PK table, to avoid permission problems.
* Use variable aliases, if supplied, rather than real column names inTom Lane2000-09-25
| | | | | | | complaints about ungrouped variables. This is for consistency with behavior elsewhere, notably the fact that the relname is reported as an alias in these same complaints. Also, it'll work with subselect- in-FROM where old code didn't.
* 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
* Implement differentiation between CURRENT_USER and SESSION_USER as per SQL.Peter Eisentraut2000-09-19
| | | | | | There is still no effective difference but it will kick in once setuid functions exist (not included here). Make old getpgusername() alias for current_user.
* Make rule lister use aliases from FROM clause when a table column hasTom Lane2000-09-18
| | | | been given an alias. Otherwise, results are incorrect.
* Reimplement LIKE/ESCAPE as operators so that indexscan optimizationTom Lane2000-09-15
| | | | | can still work, per recent discussion on pghackers. Correct some bugs in ILIKE implementation.
* First cut at full support for OUTER JOINs. There are still a few looseTom Lane2000-09-12
| | | | | ends to clean up (see my message of same date to pghackers), but mostly it works. INITDB REQUIRED!
* Suppress compile warnings caused by failure to use PG_RETURN macro.Tom Lane2000-09-12
|
* Modify date->timestamp conversion to use mktime().Thomas G. Lockhart2000-09-12
| | | | | This should do better than before around Daylight Savings Time transitions.
* O.K. -Bruce Momjian2000-09-12
| | | | | | | | | | | | | | | | | | | Here's the multibyte aware version of my patch to fix the truncation of the rulename autogenerated during a CREATE VIEW. I've modified all the places in the backend that want to construct the rulename to use the MakeRetrieveViewRuleName(), where I put the #ifdef MULTIBYTE, so that's the only place that knows how to construct a view rulename. Except pg_dump, where I replicated the code, since it's a standalone binary. The only effect the enduser will see is that views with names len(name) > NAMEDATALEN-4 will fail to be created, if the derived rulename clases with an existing rule: i.e. the user is trying to create two views with long names whose first difference is past NAMEDATALEN-4 (but before NAMEDATALEN: that'll error out after the viewname truncation.) In no case will the user get left with a table without a view rule, as the current code does. Ross Reedstrom
* Added functionsJan Wieck2000-09-05
| | | | | | | | | | | quote_ident(text) returns text quote_literal(text) returns text These are handy to build up properly quoted query strings for the new PL/pgSQL EXECUTE functionality to submit dynamic DDL statements. Jan
* Fix relative path references so that make knowns which dependencies referPeter Eisentraut2000-08-31
| | | | | to one another. Sort out builddir vs srcdir variable namings. Remove some now obsoleted make variables.
* * 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
* Tired of seeing these warnings ...Tom Lane2000-08-26
|
* Rename BITSPERBYTE to BITS_PER_BYTE to avoid conflict with <values.h>Tom Lane2000-08-26
| | | | on some platforms.
* Avoid creating a TOAST table if we can prove that the maximum tupleTom Lane2000-08-25
| | | | | | | length is < TOAST_TUPLE_THRESHOLD, even with toastable column types present. For example, CREATE TABLE foo (f1 int, f2 varchar(100)) does not require a toast table, even though varchar is a toastable type.
* SQL-language functions are now callable in ordinary fmgr contexts ...Tom Lane2000-08-24
| | | | | | for example, an SQL function can be used in a functional index. (I make no promises about speed, but it'll work ;-).) Clean up and simplify handling of functions returning sets.
* Add functions to convert to and from text, and to truncate to MAC OUI.Thomas G. Lockhart2000-08-23
| | | | | Remove hardcoded macaddr_manuf(), which had really old, obsolete info. Replace this with some contrib/mac/ code to maniag OUI info from IEEE.
* Add multibyte support for both LIKE and ILIKETatsuo Ishii2000-08-22
| | | | Eliminate up-to-4-times memory allocation problem
* Fix format_type() to display correct lengths for BIT/BIT VARYING.Tom Lane2000-08-21
| | | | | Also, make it depend on type OIDs rather than type names for more consistency with rest of backend.
* First pass at integrating BIT and BIT VARYING code from Adriaan Joubert.Tom Lane2000-08-21
| | | | | | | Update functions to new-style fmgr, make BIT and VARBIT be binary- equivalent, add entries to allow these types to be btree indexed, correct a few bugs. BIT/VARBIT are now toastable, too. NOTE: initdb forced due to catalog updates.
* Fix ruleutils to produce correct output for array assignment, suchTom Lane2000-08-12
| | | | as UPDATE foo SET arr[3] = 42.