summaryrefslogtreecommitdiff
path: root/src/backend/utils
AgeCommit message (Collapse)Author
2002-10-19Fix range-query estimation to not double-exclude NULLs, per gripe fromTom Lane
Ray Ontko 28-June-02. Also, fix prefix_selectivity for NAME lefthand variables (it was bogusly assuming binary compatibility), and adjust make_greater_string() to not call pg_mbcliplen() with invalid multibyte data (this last per bug report that I can't find at the moment, but it was in July '02).
2002-10-19This patch adds some missing functions for float8 math operations,Bruce Momjian
specifically ceil(), floor(), and sign(). There may be other functions that need to be added, but this is a start. I've included some simple regression tests. Neil Conway
2002-10-18Fix breakage that had crept into setlocale() usage: once again we'veTom Lane
been bit by the fact that the locale functions return pointers to modifiable variables. I added some comments that might help us avoid the mistake in future.
2002-10-14Arrange to copy relcache's trigdesc structure at the start of anyTom Lane
query that uses it. This ensures that triggers will be applied consistently throughout a query even if someone commits changes to the relation's pg_class.reltriggers field meanwhile. Per crash report from Laurette Cisneros. While at it, simplify memory management in relcache.c, which no longer needs the old hack to try to keep trigger info in the same place over a relcache entry rebuild. (Should try to fix rd_att and rewrite-rule access similarly, someday.) And make RelationBuildTriggers simpler and more robust by making it build the trigdesc in working memory and then CopyTriggerDesc() into cache memory.
2002-10-13Make macaddr_in reject trailing garbage (except whitespace).Tom Lane
Per gripe from Patrick Welche, 13-Oct-2002.
2002-10-11Oops, back out newNode changes. We are not ready for that yet.Bruce Momjian
2002-10-11Prevent tv_sec from becoming negative in connection timeout code.Bruce Momjian
2002-10-08Move responsibility for setting QuerySnapshot for utility statementsTom Lane
into postgres.c; make sure it happens for all cases that seem to need it. Perhaps it would be better to explicitly exclude just a few utility statement types from setting a snapshot?
2002-10-04Fix a couple of grammatical errors in error messages.Tom Lane
2002-10-04Tweak a few of the most heavily used function call points to zero outTom Lane
just the significant fields of FunctionCallInfoData, rather than MemSet'ing the whole struct to zero. Unused positions in the arg[] array will thereby contain garbage rather than zeroes. This buys back some of the performance hit from increasing FUNC_MAX_ARGS. Also tweak tuplesort.c code for more speed by marking some routines 'inline'. All together these changes speed up simple sorts, like count(distinct int4column), by about 25% on a P4 running RH Linux 7.2.
2002-10-03Hack to make it possible to load CREATE CONSTRAINT TRIGGER commands thatTom Lane
are missing the FROM clause (due to a long-ago pg_dump bug). Patch by Stephan Szabo, minor tweaking by Tom Lane.
2002-10-03In a bootstrap process or standalone backend, set MaxBackends = 1Tom Lane
to avoid unnecessary consumption of semaphores.
2002-10-03This patch removes two unused global variables from globals.cBruce Momjian
Neil Conway
2002-10-02Alter scale selection for NUMERIC division and transcendental functionsTom Lane
so that precision of result is always at least as good as you'd get from float8 arithmetic (ie, always at least 16 digits of accuracy). Per pg_hackers discussion a few days ago.
2002-10-02Turn GUC log_min_error_statement off by default by setting it to PANIC.Bruce Momjian
2002-09-24Change default privileges for languages and functions to be PUBLIC USAGETom Lane
and PUBLIC EXECUTE, respectively. Per discussion about easing updates from prior versions.
2002-09-24Tweak conversion names to follow the established naming scheme, andPeter Eisentraut
document that scheme.
2002-09-22RelationClearRelation must reset rd_targblock and update rd_nblocksTom Lane
even when dealing with a nailed-in-cache relation; otherwise, following VACUUM truncation of a system catalog, other backends might have unreasonably large values of these fields.
2002-09-22server_min_messages and friends should have valid values at bootup.Tom Lane
2002-09-22Bring SIMILAR TO and SUBSTRING into some semblance of conformance withTom Lane
the SQL99 standard. (I'm not sure that the character-class features are quite right, but that can be fixed later.) Document SQL99 and POSIX regexps as being different features; provide variants of SUBSTRING for each.
2002-09-21Add last-ditch defense against attempts to compile datetime code withTom Lane
-ffast-math.
2002-09-20The patch fix bug described in TODO:Bruce Momjian
* to_char(0,'FM999.99') returns a period, to_char(1,'FM999.99') does not Karel Zak
2002-09-20Tom Lane wrote:Bruce Momjian
> I see in your recent bytea-LIKE patch > > if (datatype != BYTEAOID && pg_database_encoding_max_length() > 1) > len = pg_mbcliplen((const unsigned char *) workstr, len, len - 1); > else > len -= -1; > > Surely there's one too many minus signs in that last? Joe Conway
2002-09-20This patch cleans up some of the code in src/util/adt/formatting.c,Bruce Momjian
fixes a few minor bugs (typos, potential buffer overruns, etc.), and fixes some spelling/grammar mistakes. Neil Conway
2002-09-19Tweak heap.c to refuse attempts to create table columns of standaloneTom Lane
composite types. Add a couple more lsyscache.c routines to support this, and make use of them in some other places that were doing lookups the hard way.
2002-09-19Department of second thoughts: suppressing implicit casts everywhere inTom Lane
ruleutils display is not such a great idea. For arguments of functions and operators I think we'd better keep the historical behavior of showing such casts explicitly, to ensure that the function/operator is reparsed the same way when the rule is reloaded. This also makes the output of EXPLAIN less obscurantist about exactly what's happening.
2002-09-18Extend pg_cast castimplicit column to a three-way value; this allows usTom Lane
to be flexible about assignment casts without introducing ambiguity in operator/function resolution. Introduce a well-defined promotion hierarchy for numeric datatypes (int2->int4->int8->numeric->float4->float8). Change make_const to initially label numeric literals as int4, int8, or numeric (never float8 anymore). Explicitly mark Func and RelabelType nodes to indicate whether they came from a function call, explicit cast, or implicit cast; use this to do reverse-listing more accurately and without so many heuristics. Explicit casts to char, varchar, bit, varbit will truncate or pad without raising an error (the pre-7.2 behavior), while assigning to a column without any explicit cast will still raise an error for wrong-length data like 7.3. This more nearly follows the SQL spec than 7.2 behavior (we should be reporting a 'completion condition' in the explicit-cast cases, but we have no mechanism for that, so just do silent truncation). Fix some problems with enforcement of typmod for array elements; it didn't work at all in 'UPDATE ... SET array[n] = foo', for example. Provide a generalized array_length_coerce() function to replace the specialized per-array-type functions that used to be needed (and were missing for NUMERIC as well as all the datetime types). Add missing conversions int8<->float4, text<->numeric, oid<->int8. initdb forced.
2002-09-18Fix bug in encoding conversion map.Tatsuo Ishii
2002-09-18Update Japanese README so that it reflects the changes made to theTatsuo Ishii
conversion function interface.
2002-09-13Change Assert(len > 0) to Assert(len >= 0)Tatsuo Ishii
Change PG_RETURN_INT32(0) to PG_RETURN_VOID()
2002-09-12Avoid misleading error message when SET/RESET target variable nameTom Lane
doesn't match any known variable.
2002-09-10Powerup defaults for LC_foo GUC variables should match what main.c does.Tom Lane
2002-09-05Assorted fixes for Cygwin:Peter Eisentraut
Eliminate the mysterious games that the Cygwin build plays with the linker flag variables. DLLLIBS is gone, use SHLIB_LINK like everyone else. Detect cygipc in configure, after the linker flags are set up, otherwise configure might not work at all. Make sure everything is covered by make clean. Fix the build of the new conversion procedure modules. Add new DLLIMPORT markers where required. Finally, the compiler complains if we use an explicit -I/usr/local/include, so don't do that. Curiously, -L/usr/local/lib is still necessary.
2002-09-05Be careful to include postgres.h *before* any system headers, to ensureTom Lane
that the right flavors of largefile-related definitions are seen. Most of these changes are probably unnecessary, but better safe than sorry.
2002-09-04pgindent run.Bruce Momjian
2002-09-04Avoid multiple scans of utils/mb/conversion_procs/ subdirectories duringTom Lane
'make install'; there are enough of 'em that this slowed down the make noticeably. Ensure that 'all' is the default make target in all these directories (defaulting to 'make install' is surprising and dangerous IMHO). Fix a couple small typos.
2002-09-04Refrect the changes to src/test/regress/sql/conversion.sql By Tom.Tatsuo Ishii
2002-09-03EXTRACT(EPOCH FROM timestamp) gave wrong answers in the int64-timestampTom Lane
case for timestamptz input, and differently wrong answers in the float- timestamp case for timestamp input.
2002-09-03Arrange for the default permissions on a database to allow temp tableTom Lane
creation to world, but disallow temp table creation in template1. Per latest round of pghackers discussion. I did not force initdb, but the permissions lockdown on template1 will not take effect unless you do one (or manually REVOKE TEMP ON DATABASE template1 FROM public).
2002-09-03Remove all traces of multibyte and locale options. Clean up commentsPeter Eisentraut
referring to "multibyte" where it really means character encoding.
2002-09-03Work around mktime() brain damage in recent versions of glibc by usingTom Lane
a series of localtime() calls to determine the local timezone offset when mktime() fails. This eliminates regression failures on RHL 7.3, and should continue to work until it occurs to the glibc boys to break localtime() as well. By then I hope we'll have our own timezone code...
2002-09-03Eliminate unnecessary dependency on mktime(), and consequent 'Unable toTom Lane
convert date to tm' failures, by using DetermineLocalTimeZone() instead.
2002-09-02> Okay. When you get back to the original issue, the gold is hidden inBruce Momjian
> src/backend/optimizer/path/indxpath.c; see the "special indexable > operators" stuff near the bottom of that file. (It's a bit of a crock > that this code is hardwired there, and not somehow accessed through a > system catalog, but it's what we've got at the moment.) The attached patch re-enables a bytea right hand argument (as compared to a text right hand argument), and enables index usage, for bytea LIKE Joe Conway
2002-09-02I checked all the previous string handling errors and most of them wereBruce Momjian
already fixed by You. However there were a few left and attached patch should fix the rest of them. I used StringInfo only in 2 places and both of them are inside debug ifdefs. Only performance penalty will come from using strlen() like all the other code does. I also modified some of the already patched parts by changing snprintf(buf, 2 * BUFSIZE, ... style lines to snprintf(buf, sizeof(buf), ... where buf is an array. Jukka Holappa
2002-09-02Add GUC variable to print original query to the server logs when thereBruce Momjian
is an error, warning, etc. Gavin Sherry
2002-09-02Remove sys/types.h in files that include postgres.h, and hence c.h,Bruce Momjian
because c.h has sys/types.h.
2002-09-02Code review for HeapTupleHeader changes. Add version number to page headersTom Lane
(overlaying low byte of page size) and add HEAP_HASOID bit to t_infomask, per earlier discussion. Simplify scheme for overlaying fields in tuple header (no need for cmax to live in more than one place). Don't try to clear infomask status bits in tqual.c --- not safe to do it there. Don't try to force output table of a SELECT INTO to have OIDs, either. Get rid of unnecessarily complex three-state scheme for TupleDesc.tdhasoids, which has already caused one recent failure. Improve documentation.
2002-09-01Add log_duration to GUC/postgresql.conf.Bruce Momjian
Rename debug_print_query to log_statement and rename show_query_stats to show_statement_stats.
2002-09-01Mark the float8 -> int8 cast as implicit. This resolves the problemTom Lane
pointed out by Barry Lind: UPDATE bigintcol = 10000000000 fails because the constant is initially taken as float8. We really need a better way, but it's not gonna happen for 7.3. Also, remove int4reltime() function, which is redundant with the existing binary-compatibility coercion path from int4 to reltime, and probably has been unreachable code for a long while.
2002-08-31Code review for domain-constraints patch. Use a new ConstraintTest nodeTom Lane
type for runtime constraint checks, instead of misusing the parse-time Constraint node for the purpose. Fix some damage introduced into type coercion logic; in particular ensure that a coerced expression tree will read out the correct result type when inspected (patch had broken some RelabelType cases). Enforce domain NOT NULL constraints against columns that are omitted from an INSERT.