Commit Graph

20710 Commits

Author SHA1 Message Date
Bruce Momjian aa0f6e8d06 Add comment marking non-exact time conversion macros. 2005-07-21 04:48:42 +00:00
Bruce Momjian 9dbd00b0e2 Remove unnecessary parentheses in assignments.
Add spaces where needed.
Reference time interval variables as tinterval.
2005-07-21 04:41:43 +00:00
Tom Lane 3976899f29 Fix storage size for btree_gist interval indexes. Fix penalty
calculations for interval and time/timetz to behave sanely for both
integer and float timestamps; up to now I think it's been doing
something pretty strange...
2005-07-21 04:15:04 +00:00
Bruce Momjian a536b2dd80 Add time/date macros for code clarity:
#define DAYS_PER_YEAR   365.25
	#define MONTHS_PER_YEAR 12
	#define DAYS_PER_MONTH  30
	#define HOURS_PER_DAY   24
2005-07-21 03:56:25 +00:00
Tom Lane dc73819f2e Fix breakage of INSTALL document build. 2005-07-20 23:57:46 +00:00
Bruce Momjian a45f4c2533 /contrib/btree_gist adjustments for new 'day' interval value. 2005-07-20 18:17:39 +00:00
Bruce Momjian ddc038cad2 Update catalog version for INTERVAL day addition. 2005-07-20 17:24:39 +00:00
Bruce Momjian db05f4a7eb Add 'day' field to INTERVAL so 1 day interval can be distinguished from
24 hours. This is very helpful for daylight savings time:

	select '2005-05-03 00:00:00 EST'::timestamp with time zone + '24 hours';
	      ?column?
	----------------------
	2005-05-04 01:00:00-04

	select '2005-05-03 00:00:00 EST'::timestamp with time zone + '1 day';
	      ?column?
	----------------------
	2005-05-04 01:00:00-04

Michael Glaesemann
2005-07-20 16:42:32 +00:00
Bruce Momjian 826604f9e6 Fix interval division and multiplication, before:
test=> select '4 months'::interval / 5;
	   ?column?
	---------------
	 1 mon -6 days
	(1 row)

after:

	test=> select '4 months'::interval / 5;
	 ?column?
	----------
	 24 days
	(1 row)

The problem was the use of rint() to round, and then find the remainder,
causing the negative values.
2005-07-20 03:50:24 +00:00
Neil Conway ca76df425b Documentation tweak: make <command>CREATE OPERATOR CLASS</command> into
an <xref/>.
2005-07-19 01:27:59 +00:00
Tom Lane 37464a0326 Fix some bogosities in geometric-function documentation: add an entry
for circle(polygon), which was missing; remove bogus entry for
point(lseg, lseg), which does not exist, and the documentation seemed to
describe lseg_interpt, which we already document as an operator not a
function.  Also remove entry for box_intersect, which likewise is
preferentially used via the operator #.
2005-07-18 22:34:14 +00:00
Bruce Momjian 507465525e \pset numericsep -> numericlocale. 2005-07-18 20:57:53 +00:00
Bruce Momjian 71d0cabecd Fix len so decimal length is only added when a period appears in the output. 2005-07-18 19:27:37 +00:00
Tom Lane affcb4371c Avoid use of E'', and thereby creating an unnecessary version-dependency,
by using LIKE...ESCAPE instead.  Per suggestion by andrew@supernews.
2005-07-18 19:12:09 +00:00
Tom Lane fdd84469f7 Avoid need for E'' construct by using regexp instead of LIKE. More
readable, and more like the other places in this file.
2005-07-18 19:09:09 +00:00
Bruce Momjian adeede1391 Fix numiericsep length computations.
Eugen Nedelcu
2005-07-18 18:58:45 +00:00
Tom Lane df38d799ea Adjust psql describe queries so that any pg_foo_is_visible() condition
is applied last, after other constraints such as name patterns.  This
is useful first because the pg_foo_is_visible() functions are relatively
expensive, and second because it minimizes the prospects for race
conditions.  The change is fragile though since it makes unwarranted
assumptions about planner behavior, ie, that WHERE clauses will be
executed in the original order if there's not reason to change it.
This should fix ... or at least hide ... an intermittent failure in the
prepared_xacts regression test, while we think about what else to do.
2005-07-18 17:40:14 +00:00
Tom Lane 24ce1438c0 pgcrypto documentation update. Marko Kreen 2005-07-18 17:17:12 +00:00
Tom Lane 35c675a7fd Fortuna fixes. Marko Kreen 2005-07-18 17:12:54 +00:00
Tom Lane 2787db9b1d Small cleanups for pgcrypto. Marko Kreen 2005-07-18 17:09:01 +00:00
Tom Lane dd4a190d18 Fix C++-style comments, per Rocco Altier. 2005-07-18 16:35:06 +00:00
Tom Lane ac43da8466 MemSet() must not cast its pointer argument to int32* until after it has
checked that the pointer is actually word-aligned.  Casting a non-aligned
pointer to int32* is technically illegal per the C spec, and some recent
versions of gcc actually generate bad code for the memset() when given
such a pointer.  Per report from Andrew Morrow.
2005-07-18 15:53:28 +00:00
Tom Lane d0f312ebfe Make pg_regress accept a command-line option for the temporary installation's
port number, and use a default value for it that is dependent on the
configuration-time DEF_PGPORT.  Should make the world safe for running
parallel 'make check' in different branches.  Back-patch as far as 7.4
so that this actually is useful.
2005-07-17 18:28:45 +00:00
Tom Lane 59857b46a8 Fix create_unique_plan() so it doesn't generate useless entries in the
output targetlist of the Unique or HashAgg plan.  This code was OK when
written, but subsequent changes to use "physical tlists" where possible
had broken it: given an input subplan that has extra variables added to
avoid a projection step, it would copy those extra variables into the
upper tlist, which is pointless since a projection has to happen anyway.
2005-07-15 22:02:51 +00:00
Bruce Momjian 5e544e4eb7 Fix SGML spacing. 2005-07-15 19:02:12 +00:00
Tom Lane 184ba4d5ed Check for out-of-range varoattno in deparse_context_for_subplan.
I have seen this case in CVS tip due to new "physical tlist" optimization
for subqueries.  I believe it probably can't happen in existing releases,
but the check is not going to hurt anything, so backpatch to 8.0 just
in case.
2005-07-15 18:39:59 +00:00
Tom Lane 0182951bc8 Fix overenthusiastic optimization of 'x IN (SELECT DISTINCT ...)' and related
cases: we can't just consider whether the subquery's output is unique on its
own terms, we have to check whether the set of output columns we are going to
use will be unique.  Per complaint from Luca Pireddu and test case from
Michael Fuhr.
2005-07-15 17:09:26 +00:00
Tom Lane aa1110624c Adjust permissions checking for ALTER OWNER commands: instead of
requiring superuserness always, allow an owner to reassign ownership
to any role he is a member of, if that role would have the right to
create a similar object.  These three requirements essentially state
that the would-be alterer has enough privilege to DROP the existing
object and then re-CREATE it as the new role; so we might as well
let him do it in one step.  The ALTER TABLESPACE case is a bit
squirrely, but the whole concept of non-superuser tablespace owners
is pretty dubious anyway.  Stephen Frost, code review by Tom Lane.
2005-07-14 21:46:30 +00:00
Bruce Momjian bd15782164 Enable multi-byte thousands_sep and decimal_point for numericsep. 2005-07-14 21:12:41 +00:00
Bruce Momjian fbc11b9dcf Make better thousands_sep default based on decimal marker value. 2005-07-14 15:54:21 +00:00
Bruce Momjian 45a19efa9e Change numericsep to a boolean, and make it locale-aware. 2005-07-14 08:42:37 +00:00
Bruce Momjian 4a8bbbd2ee Add numeric separator support for latex and troff output methods. 2005-07-14 07:32:01 +00:00
Neil Conway 75c76e93c7 Mark xml2 CREATE FUNCTIONs as IMMUTABLE, and use the "STRICT" syntax
rather than the deprecated "WITH (isStrict)" syntax. Patch from Ilia
Kantor, minor editorializing by Neil Conway.
2005-07-14 07:12:27 +00:00
Bruce Momjian 52d1d2e67c barebones variable name -> tuples_only, for consistency. 2005-07-14 06:49:58 +00:00
Bruce Momjian cff9c5748a Fix malloc length for new numeric separator patch.
Centralize malloc into function.
2005-07-14 06:46:17 +00:00
Neil Conway c3f1b0f4dd This doc patch replaces all inappropriate references to SQL:1999 when it
is used as if it were the latest (and/or still valid) SQL standard.
SQL:2003 is used in its place. Patch from Simon Riggs.
2005-07-14 06:17:36 +00:00
Tom Lane 29094193f5 Integrate autovacuum functionality into the backend. There's still a
few loose ends to be dealt with, but it seems to work.  Alvaro Herrera,
based on the contrib code by Matthew O'Connor.
2005-07-14 05:13:45 +00:00
Tom Lane f2bf2d2dc5 Fix a couple of bogus comments, per Alvaro. 2005-07-13 22:46:09 +00:00
Tom Lane 5a4c2a75d1 Remove extraneous space after -L ... it confuses SHLIB_LINK filter -L
hack.
2005-07-13 17:12:56 +00:00
Tom Lane 0016911b5d Fix unwanted side-effects of recent SHLIB_LINK -L patch on existing
hacking of SHLIB_LINK for HPUX.
2005-07-13 17:00:44 +00:00
Bruce Momjian 505b925276 Fix #elif spacing too. 2005-07-13 15:59:32 +00:00
Tom Lane faea3db958 Fix libpq memory leak during PQreset() --- closePGconn() was not
freeing all transient state of the PGconn object.
2005-07-13 15:25:55 +00:00
Bruce Momjian 5d0a43c585 Fix pgindent to not have blank line before #else in variable definition
section of a function.
2005-07-13 04:44:42 +00:00
Bruce Momjian 7690b41328 Add backslashes to parentheses in awk regex because if not, they are
treated as regex groups.
2005-07-13 04:00:28 +00:00
Bruce Momjian 5bced8f5cb Move -L flag around for shared builds:
I wrote:
> So either we code up some intelligence to put the "C" in the right
> position or we have to pass down "A B" and "D" separately from the
> main makefile.

The following patch might just do the former.  Please try it out.


Peter E.
2005-07-13 02:11:57 +00:00
Neil Conway d6375d6109 Documentation for some new PL/Perl features. Patch from David Fetter,
various editorialization from Neil Conway.
2005-07-13 02:10:42 +00:00
Tom Lane b4363b7733 Hack around the discrepancy between default library search paths for
gcc and for HP's ld on HPUX.  There may be better ways to do this,
but this seems to work for me...
2005-07-12 23:06:48 +00:00
Tom Lane 2d481b31af Fix plperl crash with list value return for an array result type.
Reported by Michael Fuhr, fixed by Andrew Dunstan.
2005-07-12 20:35:42 +00:00
Tom Lane 807bbe6051 More pgcrypto fixes: handle long messages correctly, suppress
compiler warnings.  Marko Kreen and Kris Jurka.
2005-07-12 20:27:45 +00:00
Bruce Momjian 7f0b690334 Improve comments for AdjustIntervalForTypmod.
Blank line adjustments.
2005-07-12 16:05:12 +00:00