summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
AgeCommit message (Collapse)Author
2005-08-26The idea of using _strncoll() on Windows doesn't work. Revert to sameTom Lane
code as we use on other platforms when encoding is not UTF8.
2005-08-25Factor out the common subexpression month_remainder * DAYS_PER_MONTHTom Lane
in interval_mul and interval_div. This avoids an optimization bug in A Certain Company's compiler (and given their explanation, I wouldn't be surprised if other compilers blow it too). Besides the code seems more clear this way --- in the original formulation, you had to mentally recognize the common subexpression in order to understand what was going on.
2005-08-25Back out pfrees for justify_hour function calls.Bruce Momjian
2005-08-25Fix memory leak when using justify_hours.Bruce Momjian
2005-08-24Add small hack to support use of Unicode-based locales on WIN32. ThisTom Lane
is not adequately tested yet, but let's get it into beta1 so it can be tested. Magnus Hagander and Tom Lane.
2005-08-18Add hint for to_char(interval) invalid format specifications.Bruce Momjian
2005-08-18Fix to_char(interval) to return proper year and century values.Bruce Momjian
Fix to_char(interval) to return large year/month/day/hour values that are larger than possible timestamp values. Prevent to_char(interval) format specifications that make no sense, like Month. Clean up formatting.c code to more logically handle return lengths.
2005-08-17More formatting.c cleanups.Bruce Momjian
2005-08-17Small cleanup.Bruce Momjian
2005-08-17Adjust to_char/from_char code to use boolean "is_to_char" rather thanBruce Momjian
integer with flags.
2005-08-15Rename pg_stat_file columns to be more consistent. Split apart changeBruce Momjian
and creation columns to behave for Unix or Win32.
2005-08-15array_in() and array_recv() need to be more paranoid about validatingTom Lane
their OID parameter. It was possible to crash the backend with select array_in('{123}',0,0); because that would bypass the needed step of initializing the workspace. These seem to be the only two places with a problem, though (record_in and record_recv don't have the issue, and the other array functions aren't depending on user-supplied input). Back-patch as far as 7.4; 7.3 does not have the bug.
2005-08-13Make pg_stat_file() use OUT parameters so that the user doesn't have toTom Lane
remember the output parameter set for himself. It's a bit of a kluge but fixing array_in to work in bootstrap mode looks worse. I removed the separate pg_file_length() function, as it no longer has any real notational advantage --- you can write (pg_stat_file(...)).length.
2005-08-12Fix up canonicalize_path to do the right thing in all cases (I think ...Tom Lane
this was harder than it seemed at first glance). Also push code for checking for ".." in file names into path.c where it belongs.
2005-08-12Code & docs review for server instrumentation patch. File timestampsTom Lane
should surely be timestamptz not timestamp; fix some but not all of the holes in check_and_make_absolute(); other minor cleanup. Also put in the missed catversion bump.
2005-08-12Add files to do read I/O on the cluster directory:Bruce Momjian
pg_stat_file() pg_read_file() pg_ls_dir() pg_reload_conf() pg_rotate_logfile() Dave Page Andreas Pflug
2005-08-02Code and docs review for pg_column_size() patch.Tom Lane
2005-08-02Use ReadDir() not readdir() so as to have some modicum of error checking.Tom Lane
2005-08-02Un-Windows-ify newlines.Tom Lane
2005-08-01Add NOWAIT option to SELECT FOR UPDATE/SHARE.Tom Lane
Original patch by Hans-Juergen Schoenig, revisions by Karel Zak and Tom Lane.
2005-07-30Fix justify_days() for integer datestamp, clean up code.Bruce Momjian
2005-07-29Move dbsize functions into the backend. New functions:Bruce Momjian
pg_tablespace_size pg_database_size pg_relation_size pg_complete_relation_size pg_size_pretty Remove /contrib/dbsize. Dave Page
2005-07-29Fix typo.Bruce Momjian
uniware
2005-07-29Thank you for applying patch --- regexp_replace.Bruce Momjian
An attached patch is a small additional improvement. This patch use appendStringInfoText instead of appendStringInfoString. There is an overhead of PG_TEXT_GET_STR when appendStringInfoString is executed by text type. This can be reduced by appendStringInfoText. Atsushi Ogawa
2005-07-28Make use of new list primitives list_append_unique and list_concat_uniqueTom Lane
where applicable.
2005-07-27Fix a few macro definitions to ensure that unary minus is enclosed inNeil Conway
parentheses. This avoids possible operator precedence problems, and is consistent with most of the macro definitions in the tree.
2005-07-26Add a role property 'rolinherit' which, when false, denotes that the roleTom Lane
doesn't automatically inherit the privileges of roles it is a member of; for such a role, membership in another role can be exploited only by doing explicit SET ROLE. The default inherit setting is TRUE, so by default the behavior doesn't change, but creating a user with NOINHERIT gives closer adherence to our current reading of SQL99. Documentation still lacking, and I think the information schema needs another look.
2005-07-26Add pg_has_role() family of privilege inquiry functions modeled after theTom Lane
existing ones for object privileges. Update the information_schema for roles --- pg_has_role() makes this a whole lot easier, removing the need for most of the explicit joins with pg_user. The views should be a tad faster now, too. Stephen Frost and Tom Lane.
2005-07-24Fix rounding problem in interval_div by using rint(), and improveBruce Momjian
interval_mul function.
2005-07-23Improve computations of interval_div to prevent rounding problem on AIX.Bruce Momjian
2005-07-23Andrew pointed out that the current fix didn't handle dates that wereBruce Momjian
near daylight savings time boudaries. This handles it properly, e.g. test=> select '2005-04-03 04:00:00'::timestamp at time zone 'America/Los_Angeles'; timezone ------------------------ 2005-04-03 07:00:00-04 (1 row)
2005-07-23Fix AT TIME ZONE for timestamps without time zones:Bruce Momjian
test=> select (CURRENT_DATE + '05:00'::time)::timestamp at time zone 'Canada/Pacific'; timezone ------------------------ 2005-07-22 08:00:00-04 (1 row)
2005-07-22Fix AT TIME ZONE for timestamps without time zones:Bruce Momjian
test=> select ('2005-07-20 00:00:00'::timestamp without time zone) at time zone 'Europe/Paris'; timezone ------------------------ 2005-07-19 22:00:00-04 Udpate documentation.
2005-07-22Fix insufficient check for overflow in tm2abstime(), per report from jw.Tom Lane
2005-07-22More removal of unneeded parentheses.Bruce Momjian
2005-07-22More spacing adjustmentsBruce Momjian
2005-07-22More minor spacing improvements.Bruce Momjian
2005-07-22Code spacing improvement, particularly *tm spacing.Bruce Momjian
2005-07-21Update DAYS_PER_MONTH comment.Bruce Momjian
Add SECS_PER_YEAR and MINS_PER_HOUR macros.
2005-07-21Fix integer timestamp build for macro changes.Bruce Momjian
2005-07-21Remove unnecessary parentheses in assignments.Bruce Momjian
Add spaces where needed. Reference time interval variables as tinterval.
2005-07-21Add time/date macros for code clarity:Bruce Momjian
#define DAYS_PER_YEAR 365.25 #define MONTHS_PER_YEAR 12 #define DAYS_PER_MONTH 30 #define HOURS_PER_DAY 24
2005-07-20Add 'day' field to INTERVAL so 1 day interval can be distinguished fromBruce Momjian
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-20Fix interval division and multiplication, before:Bruce Momjian
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-15Check for out-of-range varoattno in deparse_context_for_subplan.Tom Lane
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-14Adjust permissions checking for ALTER OWNER commands: instead ofTom Lane
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-12Improve comments for AdjustIntervalForTypmod.Bruce Momjian
Blank line adjustments.
2005-07-12Change 5e0 to 5.0, for consistency.Bruce Momjian
2005-07-10Missed adding extra argument to array_recv in a couple of placesTom Lane
(harmless, actually, but let's be tidy).
2005-07-10Change typreceive function API so that receive functions get the sameTom Lane
optional arguments as text input functions, ie, typioparam OID and atttypmod. Make all the datatypes that use typmod enforce it the same way in typreceive as they do in typinput. This fixes a problem with failure to enforce length restrictions during COPY FROM BINARY.