Commit Graph

667 Commits

Author SHA1 Message Date
Tom Lane 51f62d505e Standardize on MAXPGPATH as the size of a file pathname buffer,
eliminating some wildly inconsistent coding in various parts of the
system.  I set MAXPGPATH = 1024 in config.h.in.  If anyone is really
convinced that there ought to be a configure-time test to set the
value, go right ahead ... but I think it's a waste of time.
1999-10-25 03:08:03 +00:00
Tom Lane b7d49a4209 Drive a stake through the heart of the last use of MAX_PARSE_BUFFER
in the backend.  Still a few stragglers, but we're getting closer to
being rid of query length limits...
1999-10-18 03:32:29 +00:00
Hiroshi Inoue 05d13cad28 The 1st step to implement new type of scan,TidScan.
Now WHERE restriction on ctid is allowed though it is
sequentially scanned.
1999-10-11 06:28:29 +00:00
Jan Wieck 34eb4f0a32 First real FOREIGN KEY constraint trigger functionality.
Implemented now:

    FOREIGN KEY ... REFERENCES ... MATCH FULL
	FOREIGN KEY ... MATCH FULL ... ON DELETE CASCADE

Jan
1999-10-08 12:00:08 +00:00
Tom Lane 3e21ecbbe6 Make the rule deparser a little less quote-happy, so that
display of default expressions isn't quite so ugly.
1999-10-04 04:37:23 +00:00
Tom Lane eabc714a91 Reimplement parsing and storage of default expressions and constraint
expressions in CREATE TABLE.  There is no longer an emasculated expression
syntax for these things; it's full a_expr for constraints, and b_expr
for defaults (unfortunately the fact that NOT NULL is a part of the
column constraint syntax causes a shift/reduce conflict if you try a_expr.
Oh well --- at least parenthesized boolean expressions work now).  Also,
stored expression for a column default is not pre-coerced to the column
type; we rely on transformInsertStatement to do that when the default is
actually used.  This means "f1 datetime default 'now'" behaves the way
people usually expect it to.
BTW, all the support code is now there to implement ALTER TABLE ADD
CONSTRAINT and ALTER TABLE ADD COLUMN with a default value.  I didn't
actually teach ALTER TABLE to call it, but it wouldn't be much work.
1999-10-03 23:55:40 +00:00
Tom Lane 1f122a7c4c Replace float.c's #ifdef finite check with a proper autoconf check, so it
works if finite() is a function.  Patch from Christof Petig.
1999-10-02 17:45:31 +00:00
Tom Lane cd243d27ce Revise rule-printing routines to use expandable StringInfo buffers, so that
they have no hardwired limit on the length of a rule's text.  Fix a couple
of minor bugs in passing --- deparsed UPDATE queries didn't have quotes
around relation name, and quotes and backslashes in constant values weren't
backslash-quoted.
1999-10-02 01:08:05 +00:00
Jan Wieck ccecf1fa46 Added utils/adt/ri_triggers with empty shells for the
FOREIGN KEY triggers.

Added pg_proc entries for all the new functions.

Jan
1999-09-30 14:54:24 +00:00
Jan Wieck b5c4b77283 Added nbtree operator class for NUMERIC
Jan
1999-09-29 21:13:31 +00:00
Tom Lane be09bc9ff2 Modify nodeAgg.c so that no rows are returned for a GROUP BY
with no input rows, per pghackers discussions around 7/22/99.  Clean up
a bunch of ugly coding while at it; remove redundant re-lookup of
aggregate info at start of each new GROUP.  Arrange to pfree intermediate
values when they are pass-by-ref types, so that aggregates on pass-by-ref
types no longer eat memory.  This takes care of a couple of TODO items...
1999-09-26 21:21:15 +00:00
Bruce Momjian dabc3f31b5 Fix for netmask('x.x.x.x/0') is 255.255.255.255 instead of 0.0.0.0
This is because (-1) << 32 is -1 (Only intel arc. has been checked)

Oleg Sharoiko
1999-09-23 17:42:23 +00:00
Bruce Momjian ad604ac372 values.h patch from Alex Howansky 1999-09-21 20:58:25 +00:00
Tom Lane bd272cace6 Mega-commit to make heap_open/heap_openr/heap_close take an
additional argument specifying the kind of lock to acquire/release (or
'NoLock' to do no lock processing).  Ensure that all relations are locked
with some appropriate lock level before being examined --- this ensures
that relevant shared-inval messages have been processed and should prevent
problems caused by concurrent VACUUM.  Fix several bugs having to do with
mismatched increment/decrement of relation ref count and mismatched
heap_open/close (which amounts to the same thing).  A bogus ref count on
a relation doesn't matter much *unless* a SI Inval message happens to
arrive at the wrong time, which is probably why we got away with this
sloppiness for so long.  Repair missing grab of AccessExclusiveLock in
DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi.
Recommend 'make clean all' after pulling this update; I modified the
Relation struct layout slightly.
Will post further discussion to pghackers list shortly.
1999-09-18 19:08:25 +00:00
Tom Lane 51db6455ea Repair error noticed by Roberto Cornacchia: selectivity code
was rejecting negative attnums as bogus, which of course they are not.
Add code to get_attdisbursion to produce a useful value for OID attribute,
since VACUUM does not store stats for system attributes.
Also, repair bug that's been in eqjoinsel for a long time: it was taking
the max of the two columns' disbursions, whereas it should use the min.
1999-09-09 02:36:04 +00:00
Tom Lane bee7cd2a36 Repair logic error in LIKE: should not return LIKE_ABORT
when reach end of pattern before end of text.  Improve code comments.
1999-09-07 19:09:46 +00:00
Tom Lane 51f62ea45c Rule deparser didn't handle unary operators correctly. 1999-09-02 03:04:04 +00:00
Tom Lane 958600156c Fix several problems in rule deparsing: didn't handle array
references or CASE expressions, didn't parenthesize complex expressions
properly.  Also, always output variable references as fully qualified
names to eliminate ambiguity bug recently reported.  (This could be
smarter, but reliability comes first.)
1999-08-28 03:59:05 +00:00
Tom Lane 42af56e1ea Revise implementation of SubLinks so that there is a consistent,
documented intepretation of the lefthand and oper fields.  Fix a number of
obscure problems while at it --- for example, the old code failed if the parser
decided to insert a type-coercion function just below the operator of a
SubLink.
CAUTION: this will break stored rules that contain subplans.  You may
need to initdb.
1999-08-25 23:21:43 +00:00
Tom Lane db436adf76 Major revision of sort-node handling: push knowledge of query
sort order down into planner, instead of handling it only at the very top
level of the planner.  This fixes many things.  An explicit sort is now
avoided if there is a cheaper alternative (typically an indexscan) not
only for ORDER BY, but also for the internal sort of GROUP BY.  It works
even when there is no other reason (such as a WHERE condition) to consider
the indexscan.  It works for indexes on functions.  It works for indexes
on functions, backwards.  It's just so cool...

CAUTION: I have changed the representation of SortClause nodes, therefore
THIS UPDATE BREAKS STORED RULES.  You will need to initdb.
1999-08-21 03:49:17 +00:00
Tom Lane 5588c559e6 Cleanups for int8: guard against null inputs in comparison
operators (and some other places), fix rangechecks in int8 to int4
conversion (same problem we recently figured out in pg_atoi).
1999-08-21 03:06:58 +00:00
Tom Lane d91baea025 Ooops ... I had left some test coding in selfuncs.c that
failed on 'field < textconstant' ...
1999-08-21 00:56:18 +00:00
Tom Lane 14f84cd821 Store -1 in attdisbursion to signal 'no duplicates in column'.
Centralize att_disbursion readout logic.
1999-08-09 03:16:47 +00:00
Tom Lane 8624ff7612 Further selectivity-estimation work. Speed up eqsel()
(it should just call the given operator, not look up an = operator).
Fix intltsel() so that all numeric data types are converted to double
before trying to estimate where the given comparison value is in the
known range of column values.  intltsel() still needs work, or replacement,
for non-numeric data types ... but for nonintegral numeric types it
should now be delivering reasonable estimates.
1999-08-02 02:05:41 +00:00
Tom Lane 44878506d8 First step in fixing selectivity-estimation code. eqsel and
neqsel now behave as per my suggestions in pghackers a few days ago.
selectivity for < > <= >= should work OK for integral types as well, but
still need work for nonintegral types.  Since these routines have never
actually executed before :-(, this may result in some significant changes
in the optimizer's choices of execution plans.  Let me know if you see
any serious misbehavior.
CAUTION: THESE CHANGES REQUIRE INITDB.  pg_statistic table has changed.
1999-08-01 04:54:25 +00:00
Bruce Momjian 66f66343f6 Alpha spinlock fix from Uncle George <gatgul@voicenet.com> 1999-07-22 18:30:08 +00:00
Bruce Momjian 7944d501f4 Use -ieee alpha flag for gcc and egcs only. 1999-07-20 16:48:58 +00:00
Bruce Momjian 93fbd46ba5 Re-add Makefile. 1999-07-20 02:44:09 +00:00
Bruce Momjian e740c9b1d1 Move -ieee to adt Makefile, and add CPU Makefile variable. 1999-07-20 02:42:20 +00:00
Bruce Momjian faf7d78174 Install new alignment code to use MAXALIGN rather than DOUBLEALIGN where
approproate.
1999-07-19 07:07:29 +00:00
Bruce Momjian 3406901a29 Move some system includes into c.h, and remove duplicates. 1999-07-17 20:18:55 +00:00
Bruce Momjian 33e826d167 Fix for multi-byte includes. 1999-07-17 16:25:28 +00:00
Bruce Momjian 69817665cb Final cleanup 1999-07-16 05:23:30 +00:00
Bruce Momjian a71802e12e Final cleanup. 1999-07-16 05:00:38 +00:00
Bruce Momjian 9b645d481c Update #include cleanups 1999-07-16 03:14:30 +00:00
Bruce Momjian a9591ce66a Change #include's to use <> and "" as appropriate. 1999-07-15 23:04:24 +00:00
Bruce Momjian 2e6b1e63a3 Remove unused #includes in *.c files. 1999-07-15 22:40:16 +00:00
Bruce Momjian fb38a5d8cf Remove un-needed #include's from *.c files. 1999-07-15 19:21:43 +00:00
Bruce Momjian 4b2c2850bf Clean up #include in /include directory. Add scripts for checking includes. 1999-07-15 15:21:54 +00:00
Bruce Momjian 0cf1b79528 Cleanup of /include #include's, for 6.6 only. 1999-07-14 01:20:30 +00:00
Bruce Momjian 050371fccd More cpu cleanups, only for 6.6. 1999-07-13 20:12:51 +00:00
Bruce Momjian d62c25d452 cleanup of long long int atoi test. 1999-07-10 17:03:34 +00:00
Bruce Momjian 103cf75651 Re-apply range check patch after fixing LIMIT_H test and defines. 1999-07-09 17:40:31 +00:00
Tom Lane b9c0096d97 Another place that HAVE_LIMITS_H was misspelled. 1999-07-09 15:09:54 +00:00
Bruce Momjian 296efd8065 Fix for ACL length problem on different platforms. 1999-07-09 03:28:53 +00:00
Bruce Momjian 46db8ac712 Backup pg_atoi patch for long checking. Caused initdb problems. 1999-07-09 03:27:20 +00:00
Bruce Momjian 2cf2a4fe2b > In both datetime_trunc() and timespan_trunc() in dt.c,
> the DTK_MICROSEC case is just like the DTK_MILLISEC case.
> I think this is wrong and it ought to look like
>         fsec = rint(fsec * 1000000) / 1000000;
> no?

Tom Lane.
1999-07-08 03:22:46 +00:00
Bruce Momjian 5035d7b985 pg_atoi() does range check on int4 data only if
"HAS_LONG_LONG" is defined based on the assumption that
strtol() would return ERANGE if a platform does not support
64-bit integers. In current PostgreSQL 6.5 (and 6.4.2)
distribution, "HAS_LONG_LONG" is defined only if platform
is "alpha". (See include/port/alpha.h) I think the int4
range check should apply to linux_alpha as well. (I have
not tested yet but I guess this might be applicable to
newer Linux/i386 distributions which includes new GCC which
implements long int as 64-bit int.)
1999-07-08 00:27:01 +00:00
Bruce Momjian eba41848aa Clarify maximum tuple and max attribute lengths. 1999-07-04 04:56:02 +00:00
Bruce Momjian 97dfff832c Fix to prevent too large tuple from being created. 1999-07-03 00:33:04 +00:00
Tom Lane d30c4b0562 Temporarily disable error checks for missing selectivity
functions, in order to work around oversight in 6.5 release: rtree
index functions haven't got any.  Mea culpa ...
1999-06-19 00:44:44 +00:00
Tom Lane bad3b3068d Repair recently-introduced error in makeIndexable for LIKE:
a non-leading % would be put into the >=/<= patterns.  Also, repair
longstanding confusion about whether %% means a literal %%.  The SQL92
doesn't say any such thing, and textlike() knows that, but gram.y didn't.
1999-06-07 14:28:26 +00:00
Jan Wieck 98981a9f1c Changed "current." into "old." in rule string backparsing
Jan
1999-06-02 11:52:29 +00:00
Bruce Momjian e47b93d333 The INET and CIDR types mistakenly compared 198.68.123.0/24 and
198.68.123.0/27 the same when indexing them.

D'Arcy
1999-06-02 03:37:15 +00:00
Tom Lane 81ced1e037 Generate a more specific error message when an operator used
in an index doesn't have a restriction selectivity estimator.
1999-05-31 19:32:47 +00:00
Bruce Momjian 278bbf4572 Make functions static or NOT_USED as appropriate. 1999-05-26 12:57:23 +00:00
Bruce Momjian fcff1cdf4e Another pgindent run. Sorry folks. 1999-05-25 22:43:53 +00:00
Bruce Momjian 4eadfe8754 Make 0x007f -> (unsigned)0x7f to make pgindent happy. 1999-05-25 22:04:56 +00:00
Bruce Momjian 07842084fe pgindent run over code. 1999-05-25 16:15:34 +00:00
Jan Wieck f4fadbe4db Fixed bug in rules event qualification output.
Jan
1999-05-25 08:49:33 +00:00
Bruce Momjian 6bf0db7e07 FIx for 0.0.0.0/0 output as 00/0. 1999-05-25 05:29:38 +00:00
Bruce Momjian 6d08b6a7b8 Remove 4096 string limited key on block size 1999-05-19 17:53:12 +00:00
Jan Wieck c8cc45b2f3 Fixed small bug in ruleutils and added output of pg_views and
pg_rules to rules regression test.

Jan
1999-05-12 17:59:32 +00:00
Jan Wieck 79c2576f77 Replaced targetlist entry in GroupClause by reference number
in Resdom and GroupClause so changing of resno's doesn't confuse
the grouping any more.

Jan
1999-05-12 15:02:39 +00:00
Bruce Momjian 1a87c14c9c I am sorry, I misinterpreted the still failing trigger regression test.
The
offending code
has been removed, the action is now always dependent :-)

I suggest the following patch, to finally make trigger regression happy
again:

 <<refint1.patch>>
After that you can remove the following from TODO:
Remove ERROR:  check_primary_key: even number of arguments should be
specified
Trigger regression test fails

Andreas
1999-05-12 12:47:24 +00:00
Jan Wieck bb885dd1a1 Check for NUMERIC overflow a second time after rounding
Jan
1999-05-10 18:17:44 +00:00
Bruce Momjian 4853495e03 Change error messages to oids come out as %u and not %d. Change has no
real affect now.
1999-05-10 00:46:32 +00:00
Bruce Momjian 5d5cf912bc I have two patches for 6.5.0:
arrayfuncs.patch        fixes a small bug in my previous patches for
arrays

array-regress.patch     adds _bpchar and _varchar to regression tests

--
Massimo Dal Zotto
1999-05-05 21:38:40 +00:00
Thomas G. Lockhart 84e832a802 Use sprintf() to convert float8 to a string during conversion to numeric.
Original code used float8out(), but the resulting exponential notation
 was not handled (e.g. '3E9' was decoded as '3').
1999-05-04 15:50:24 +00:00
Tom Lane b6c732e63c Correct declaration of array_map() so that it doesn't make
gcc quite so unhappy.
1999-05-03 23:48:26 +00:00
Bruce Momjian 210055ad61 here are some patches for 6.5.0 which I already submitted but have never
been applied. The patches are in the .tar.gz attachment at the end:

varchar-array.patch     this patch adds support for arrays of bpchar() and
                        varchar(), which where always missing from postgres.

                        These datatypes can be used to replace the _char4,
                        _char8, etc., which were dropped some time ago.

block-size.patch        this patch fixes many errors in the parser and other
                        program which happen with very large query statements
                        (> 8K) when using a page size larger than 8192.

                        This patch is needed if you want to submit queries
                        larger than 8K. Postgres supports tuples up to 32K
                        but you can't insert them because you can't submit
                        queries larger than 8K. My patch fixes this problem.

                        The patch also replaces all the occurrences of `8192'
                        and `1<<13' in the sources with the proper constants
                        defined in include files. You should now never find
                        8192 hardwired in C code, just to make code clearer.


--
Massimo Dal Zotto
1999-05-03 19:10:48 +00:00
Tom Lane c422e1a93d Fix compile failures in dt.c --- line broken in middle of
an identifier :-(.  Sloppy transmission of a patch, likely.
1999-05-01 17:14:56 +00:00
Jan Wieck 7d62e9c719 Bugfix (bug by me in 1.4) in backparsing INSERT ... SELECT
Jan
1999-04-29 15:52:01 +00:00
Tatsuo Ishii 89c7369d0e Fix from Yutaka Tanida <yutaka@marin.or.jp> for Cygwin32 support. 1999-04-26 04:42:49 +00:00
Tom Lane d30e2ac306 Portability patches for HPUX 11 and Unixware in configure
and related files.  Also remove float.c's gratuitous redeclaration of
isinf() ... looks like there are more decls in there that ought to be
in config.h, but I'll leave well enough alone for now ...
1999-04-20 00:26:32 +00:00
Thomas G. Lockhart 1d1cf38c0d Fix max(int8) result by making sure int8larger() copies its result
rather than reusing the input storage.
Also made the same fix to int8smaller(), though there wasn't a symptom,
 and went through and verified that other pass-by-reference data types
 do the same thing. Not an issue for the by-value types.
1999-04-15 13:34:45 +00:00
Thomas G. Lockhart b2b3d5d184 Fix code to check legal dates *before* calling localtime() to get the
time zone.
Previously, localtime() rotated a date with a day of month field which
 exceeded the actual range into the next months, masking the fact that
 a bad date had been specified.
Regression tests pass.
1999-04-15 02:22:39 +00:00
Thomas G. Lockhart 64e74e30b5 Fix boolean assignment of return values to use "FALSE" rather than the
mis-copied "NULL", which happens to have the same binary value.
Previously, gcc gave non-fatal warnings.
1999-04-15 02:20:50 +00:00
Thomas G. Lockhart d1c1301039 Version string was truncating the last character.
Use memcpy() rather than StrNCpy() which had forced a string termination
 character at the end.
1999-04-06 15:35:36 +00:00
Tom Lane 23ef47f89d Fix bogus function signature for areajoinsel.
It still doesn't do anything, but at least now it does nothing correctly.
1999-03-28 01:56:12 +00:00
Bruce Momjian 53d52a685a Cleanup of NULL in inet types. 1999-03-22 05:00:57 +00:00
Bruce Momjian beb1851dd9 This patch fixes the bug that made it impossible to grant permissions to
a user such as "www-data".

Oliver
1999-03-21 06:31:59 +00:00
Bruce Momjian 3ea6c806eb cleanup 1999-03-20 02:31:45 +00:00
Bruce Momjian dc02fd709f cleanups 1999-03-18 19:59:55 +00:00
Bruce Momjian 25541a5cd3 LIKE cleanup. 1999-03-15 13:45:09 +00:00
Tom Lane 4a9c239063 Fix brain death in !!= operator ... it's still pretty bogus
but at least now it does what it's supposed to do ...
1999-03-15 03:24:32 +00:00
Bruce Momjian 265c283e1b > > > This patches src/bin/psql/psql.c.
> > >
> > > This patch is in responce to the following TODO list item:
> > >  * have psql \d on a view show the query
> > > -Ryan
1999-03-15 02:18:37 +00:00
Bruce Momjian 8930699cd6 src/backend/utils/adt/numeric.c fails to compile due to a string having
an
embedded new-line character.


Billy G. Allie
1999-03-14 16:49:32 +00:00
Bruce Momjian c10e6bcbed Attempting to insert a value of 'now' into a datetime type
results in a bogus datetime value under AlphaLinux.  (Note that
the link to submit a port-specific bug on your website is broken)

-Test Case:
----------
testdb=> create table dttest (dt datetime);
testdb=> insert into dttest values ('now');

--------------------------------------------------------------------------


Solution:
---------
The basic problem is the typedefs of AbsoluteTime and RelativeTime,
which are both 'int32'.  These types appear to be used synonymously
with the 'time_t' type, which on AlphaLinux is typedef'd as a 'long
int', which is 64-bits (not 32).  The solution included here fixes
the datetime type (it now passes the regression test), but does not
pass the absolute and relative time regression tests.  Presumably, a
more thorough investigation of how these types are used is warranted.
The included patch is from the v6.3.2 source, but can be applied to
the v6.4.2 source.  Please note that there is also a RedHat-specific
patch distributed with the PostgreSQL source package from RedHat
that was applied first.

Rich Edwards
1999-03-14 16:44:02 +00:00
Bruce Momjian 80db587e7b Here is a little syntax error found in a .y file... A dropped semi.
DwD
--
Daryl W. Dunbar
1999-03-14 16:40:18 +00:00
Bruce Momjian aba8c12f67 We have tested the patches on three platforms:
NetBSD/macppc
LinuxPPC
FreeBSD 2.2.6-RELEASE

All of them seem happy with the regression test. Note that, however,
compiling with optimization enabled on NetBSD/macppc causes an initdb
failure (other two platforms are ok). After checking the asm code, we
are suspecting that might be a compiler(egcs) bug.

Tatsuo Ishii
1999-03-14 16:03:33 +00:00
Bruce Momjian 02fa3e4394 Thank you for the advice. I concluded that current inet code has a
portability problem. Included patches should be applied to both
current and 6.4 tree. I have tested on LinuxPPC, FreeBSD and Solaris
2.6. Now the inet regression tests on these platforms are all happy.
---
Tatsuo Ishii
1999-02-24 03:17:05 +00:00
Marc G. Fournier 8c3e8a8a0e From: Tatsuo Ishii <t-ishii@sra.co.jp>
Ok. I made patches replacing all of "#if FALSE" or "#if 0" to "#ifdef
NOT_USED" for current. I have tested these patches in that the
postgres binaries are identical.
1999-02-21 03:49:55 +00:00
Tom Lane 390d5e9f14 regprocin should accept '-' signifying InvalidOid, for
symmetry with regprocout.
1999-02-15 16:29:32 +00:00
Bruce Momjian 6724a50787 Change my-function-name-- to my_function_name, and optimizer renames. 1999-02-13 23:22:53 +00:00
Thomas G. Lockhart 8c3fff7337 Fix offset of one for date_part(timespan) when given arguments of
decade, century, or millenium.
1999-02-13 05:34:24 +00:00
Thomas G. Lockhart a97683bc6c Change #if FALSE to #if NOT_USED to avoid port problems.
Fix problem with date_part() for timespan (had an offset of one)
 when given decade, century, and millenium as arguments.
 Reported by Ricardo J.C.Coelho.
1999-02-13 04:25:01 +00:00
Thomas G. Lockhart 910fe5891e Add routines to convert between int8 and text/varchar types.
Change #if FALSE to #if NOT_USED to avoid port problems.
Fix up pg_indent weirdness with function argument declarations.
1999-02-13 04:22:34 +00:00
Bruce Momjian d5db88142c Fix for returning stack pointer from selectivity, from Bernard Frankpitt. 1999-02-05 17:47:29 +00:00
Bruce Momjian 9322950aa4 Cleanup of source files where 'return' or 'var =' is alone on a line. 1999-02-03 21:18:02 +00:00
Tom Lane 724119a979 Modify int8 to not depend on sscanf(), and fix configure's test
for int8 support.  configure now checks only snprintf() for int8 support,
not sprintf and sscanf as it used to.  The reason for doing this is that
if we are supplying our own snprintf code (which does handle long long int),
we now only need working long long support in the compiler not in the
platform's C library.  I have verified that int8 now passes regression test
on HPUX 9, and I think it should work on SunOS 4.1.* and other older
platforms if gcc is used.
1999-02-03 00:18:53 +00:00
Bruce Momjian 1401f63dd1 Agg/Aggreg cleanup and datetime.sql patch. 1999-01-25 18:02:28 +00:00
Bruce Momjian 17467bb7fb Rename Aggreg to Aggref. 1999-01-24 00:28:37 +00:00
Tom Lane 157349e3af Improper addition of NaN/Infinity recognition to float8in()
was causing it not to detect out-of-range float values, as evidenced by
failure of float8 regression test.  I corrected that logic and also
modified expected float8 results to account for new error message
generated for out-of-range inputs.
1999-01-24 00:12:59 +00:00
Vadim B. Mikheev 12be3e08f1 FOR UPDATE is in parser & rules. 1999-01-21 16:08:55 +00:00
Thomas G. Lockhart 1ace93c46c Fix "Y-2K" problem with two-digit BC dates being corrected by two millenia.
They are not corrected now.
Allow the date type to accept BC dates.
Share more date/time validation declarations through dt.h.
1999-01-20 16:29:39 +00:00
Tom Lane 5d2cf6af9e TCL_ARRAYS option patches from Massimo Dal Zotto 1999-01-17 21:12:55 +00:00
Bruce Momjian 7a6b562fdf Apply Win32 patch from Horak Daniel. 1999-01-17 06:20:06 +00:00
Bruce Momjian 4deb20f4ce Fix for missing NAN. 1999-01-17 03:28:37 +00:00
Thomas G. Lockhart 6d5d673ca8 Be more careful to check input string lengths as well as values
when deciding whether a field is a year field.  Assume *anything* longer
 than 2 digits (if it isn't a special-case doy) is a valid year.
 This should fix the "Y1K" and "Y10K" problems
  pointed out by Massimo recently.
Check usage of BC to require a positive-valued year; before just used it
 to flip the sign of the year without checking. This led to problems
 near year zero.
Allow a 5 digit "concatenated date" of 2 digit year plus day of year.
Do 2->4 digit year correction for 6 and 5 digit "concatenated dates".
 Somehow forgot this originally. Guess not many folks use it...
1999-01-10 17:20:54 +00:00
Thomas G. Lockhart c715788681 Handle "NaN" and "Infinity" for input values.
I think NAN is already guaranteed to be there from Jan's work on NUMERIC,
 but perhaps HUGE_VAL needs some #ifndef's in the same place.
Should also include "-Infinity" as -HUGE_VAL sometime; not there yet.
1999-01-10 17:13:06 +00:00
Jan Wieck 814c8495a7 Removed precision restriction in numeric_round() causing
overflow error on high precision calculations where temporary
huge precision is required.

Jan
1999-01-05 11:10:45 +00:00
Jan Wieck 1bbe55c79f Just one more bugfix - this time in cmp_abs (cannot imagine that
taking a logarithm with a 400 digit precision worked with that bug
in place).

Jan
1999-01-04 17:51:58 +00:00
Jan Wieck c1855793df Fixed backend crashing bug in apply_typmod()
Jan
1999-01-04 12:53:23 +00:00
Jan Wieck e3a5ac283b Little fix for round() function
Jan
1999-01-04 11:20:33 +00:00
Bruce Momjian 936d89e9e0 Fix NAN code. 1999-01-03 05:30:47 +00:00
Bruce Momjian 6fd29f2c01 Fix for NAN generation. 1999-01-03 02:40:12 +00:00
Bruce Momjian d8ae7ffb2f Fix for no platform NAN. 1999-01-01 04:17:13 +00:00
Thomas G. Lockhart 4d56dbd678 Change ordering of HAVE_TM_ZONE and HAVE_INT_TIMEZONE code blocks
to give HAVE_TM_ZONE priority. This fixes glibc2 machines and any other
 machine which passes both tests in configure.
Repair HAVE_TM_ZONE code which stuffs tm structure with date type values.
 Same problems as were originally there before v6.1, but never noticed.
Thanks to Oleg for nagging :)
1998-12-31 16:30:59 +00:00
Jan Wieck 5df20d4449 Little precision fix for POWER(). I discovered problems with big
exponents.

Jan
1998-12-30 20:46:06 +00:00
Jan Wieck 0e9d75c6ac Added NUMERIC data type with many builtin funcitons, operators
and aggregates.

Jan
1998-12-30 19:56:35 +00:00
Marc G. Fournier 54c3e65242 Oops, sorry...meant to commit the patch from Thomas for tzn->CTZName 1998-12-15 15:28:57 +00:00
Vadim B. Mikheev 83f558afdd tzn undeclared in FreeBSD, commented out. 1998-12-15 15:10:03 +00:00
Vadim B. Mikheev 3f7fbf85dc Initial MVCC code.
New code for locking buffer' context.
1998-12-15 12:47:01 +00:00
Marc G. Fournier 9396802f14 more cleanups...of note, appendStringInfo now performs like sprintf(),
where you state a format and arguments.  the old behavior required
each appendStringInfo to have to have a sprintf() before it if any
formatting was required.

Also shortened several instances where there were multiple appendStringInfo()
calls in a row, doing nothing more then adding one more word to the String,
instead of doing them all in one call.
1998-12-14 08:11:17 +00:00
Thomas G. Lockhart 239564e9ef Add routines to help with single-byte (internal) character type support. 1998-12-13 23:36:48 +00:00
Thomas G. Lockhart f9f4004b7c Switch around conditional code so that HAVE_TM_ZONE takes precedence
over HAVE_INT_TIMEZONE. This may help out linux/glibc2 and Dec Alpha.
Included #error precompiler macros to catch cases where neither is defined
 but USE_POSIX_TIME is (shouldn't happen). Hopefully this isn't just
 a gcc-ism.
1998-12-13 23:34:17 +00:00
Thomas G. Lockhart 53b476798a Define routines and catalog entries for string min()/max() functions.
Extend new type coersion techniques to aggregates.
Clean up a few elog() messages.
1998-12-08 06:19:15 +00:00
Tom Lane 92eacaf523 Change exp() behavior to generate error on underflow rather
than silently returning zero on some machines.  Correct float8 regress test
to agree.  Also fix pow() overflow/underflow check to work correctly on
HPUX.
1998-11-29 01:57:59 +00:00
Vadim B. Mikheev 6beba218d7 New HeapTuple structure/interface. 1998-11-27 19:52:36 +00:00
Thomas G. Lockhart 643c7beddf Add text<->float8 and text<->float4 conversion functions.
This will fix the problem reported by Jose' Soares
 when trying to cast a float to text.
1998-11-17 14:36:51 +00:00
Thomas G. Lockhart 396571d79c Very minor cleanup of no-op code. 1998-10-29 18:11:28 +00:00
Bruce Momjian 1e7c7343c4 Add oid8neq. 1998-10-29 18:07:09 +00:00
Tom Lane 9e38dcfd43 Re-fix test for negative-integer return code that should be
testing for null-pointer return code...
1998-10-29 16:13:07 +00:00
Bruce Momjian 374d9a1f2b D'Arcy INET fix. 1998-10-29 04:41:44 +00:00
Tom Lane 990fa43c23 Get rid of some minor compiler warnings. 1998-10-26 01:05:07 +00:00
Tom Lane 0bdf46a37f Fix some actual bugs exposed by compiler warnings.
(Someone forgot whether their subroutine signaled errors by a NULL pointer
return value, or a negative integer... I'm surprised gcc -Wall doesn't
catch this...)
1998-10-26 01:03:24 +00:00
Bruce Momjian 1115162c84 rename file. 1998-10-23 02:56:13 +00:00
Bruce Momjian 33c4072dbc INET/CIDR cleanup from D'Arcy. 1998-10-22 20:40:50 +00:00
Bruce Momjian ca2995be7b Remove duplicate CIDR funcs by using coerce entries. 1998-10-22 13:51:07 +00:00
Bruce Momjian 9ac0c1e371 CIDR/INET fixes from D'Arcy. 1998-10-22 13:16:27 +00:00
Bruce Momjian 3fe6a77f91 Fix for funcs on INET/CIDR. 1998-10-22 04:58:11 +00:00
Bruce Momjian 2ba4ee74aa Fix function calls to INET/CIDR functions. Added cidr_out. 1998-10-22 00:35:28 +00:00
Bruce Momjian 858a3b570a New CIDR type and fixed INET type, from D'Arcy. 1998-10-21 16:06:50 +00:00
Bruce Momjian 89f01cd92f Add RIP notice for Paul. 1998-10-21 04:25:25 +00:00
Bruce Momjian f8042120b6 INET fix from D'Arcy. 1998-10-21 02:48:22 +00:00
Bruce Momjian a824add49a Remove unused INET functions for D'Arcy. 1998-10-20 23:03:20 +00:00
Bruce Momjian 71a5da47d2 Disable inet. 1998-10-17 04:08:40 +00:00
Bruce Momjian 0c430306fe Re-enable inet code. 1998-10-17 03:59:14 +00:00
Bruce Momjian a643d97f29 Fix for inet from Tom H. 1998-10-12 15:56:34 +00:00
Bruce Momjian b1f3293b8b Fix for version.c warning. 1998-10-12 05:09:55 +00:00
Bruce Momjian eb3e640ea2 New INET functions from D'Arcy J.M. Cain 1998-10-12 04:07:53 +00:00
Bruce Momjian 377b5fa3a4 Fix for inet_net_pton() from Tom. 1998-10-12 01:30:26 +00:00
Bruce Momjian 1483456418 Fix for version() string overwrite. 1998-10-09 16:42:32 +00:00
Bruce Momjian 173c555948 Make functions static or ifdef NOT_USED. Prevent pg_version creation. 1998-10-08 18:30:52 +00:00
Bruce Momjian deaaf96975 Fix for INET type addition. 1998-10-08 02:08:47 +00:00
Bruce Momjian 8849655d24 I agree. I think, though, that the best argument presented in the
debate was from Paul Vixie, who wanted INET to be the name covering
both IPV4 and IPV6.  The following kit makes the needed changes:

Tom Ivar Helbekkmo
1998-10-08 00:19:47 +00:00
Bruce Momjian 803204bd1e Playing around with pg_dump for a while resulted in some
fixes,  enhancements and some found bugs not yet fixed. After
    all I was able to get useful results  when  dumping/reloading
    the regression database.

Jan
1998-10-06 22:14:21 +00:00
Bruce Momjian e1ebac319d Here are the patches against the current source tree. I have run the
regression test on a FreeBSD box with both non-MULTIBYTE and
MULTIBYTE-enabled, and confirmed that the results are same.

However I do not tested on PCs(I don't have access to win). Please let
me know if the patches break anything on PCs.

Also please note that the patch for varchar.c is a fix for a nasty bug
of char(n) types that I introduced and I believe at least this should
be applied.

Tatsuo Ishii
1998-10-06 03:02:29 +00:00
Bruce Momjian 10d987c709 Add includes for prototypes for new IP type. 1998-10-04 16:24:32 +00:00
Bruce Momjian a593107d9e Add prototype include to inet types. 1998-10-04 15:35:12 +00:00
Bruce Momjian f5a219204b Remove u_int32_t 1998-10-04 15:31:09 +00:00
Bruce Momjian 2d69fd90b9 Integrate new IP type from Tom Ivar Helbekkmo. 1998-10-03 05:41:01 +00:00
Bruce Momjian f93b6974f9 Here's a combination of all the patches I'm currently waiting
for against a just updated CVS tree. It contains

        Partial new rewrite system that handles subselects,  view
        aggregate  columns, insert into select from view, updates
        with set col = view-value and select rules restriction to
        view definition.

        Updates  for  rule/view  backparsing utility functions to
        handle subselects correct.


        New system views pg_tables and pg_indexes (where you  can
        see the complete index definition in the latter one).

        Enabling array references on query parameters.

        Bugfix for functional index.

        Little changes to system views pg_rules and pg_views.


    The rule system isn't a release-stopper any longer.

    But  another  stopper  is  that  I  don't  know if the latest
    changes to PL/pgSQL (not already in CVS) made it  compile  on
    AIX. Still wait for some response from Dave.

Jan
1998-10-02 16:28:04 +00:00
Bruce Momjian 744c3cd271 regproc cleanups 1998-10-02 05:31:28 +00:00
Bruce Momjian 290428dd30 Fix for regproc so proc name can be supplied if unique, if not, oid. 1998-10-02 05:10:11 +00:00
Bruce Momjian 3f2fff5c5d Search contrib/tcl for tcl startup. 1998-10-02 01:22:43 +00:00
Bruce Momjian bd041d82bf multi-byte fix from Tatsuo Ishii 1998-09-25 15:51:02 +00:00
Bruce Momjian 2df1465757 Fix comment for regproc. 1998-09-25 03:36:33 +00:00
Bruce Momjian f52e7346ea MB patches from Tatsuo Ishii 1998-09-25 01:46:25 +00:00
Bruce Momjian 31fea9777f Fix for datetime from Tatsuo Ishii 1998-09-23 17:51:46 +00:00
Bruce Momjian b9f16535a4 Fix for oidArray from Christopher Oliver. 1998-09-23 17:50:12 +00:00
Bruce Momjian a3c5a3cb2f Cleanup for oid8[] from Tatsuo Ishii. 1998-09-22 20:28:15 +00:00
Bruce Momjian 0fc8bce760 Fix for \df. 1998-09-18 04:43:20 +00:00
Bruce Momjian 786b1802c8 The pg_atoi() function uses strtol() to convert the string to numbers. Some
implementations of strtol() treat empty strings ("") as invalid arguments
while others convert this (erroneously, IHMO) to zero (0).  Assuming that the
expected behaviour of pg_atoi() is to return 0 if it is passed an empty
string, I am supplying the following patch to explictly check for an empty
string in pg_atoi() and return 0 if the string is empty.  The patch will also
trap a NULL character pointer being passed to pg_atoi() and will use elog() to
print out an error message if the input char pointer is NULL.


Billy G. Allie
1998-09-12 16:04:35 +00:00
Bruce Momjian bcc15f15e1 > David Hartwig wrote:
>
> Please apply this HAVING regression patch.
> > My bad.   It is caused by a known bug having to do with GROUP BY.
It ain't$
> > nothing to do with HAVING.  For some reason the bug went away for a
while, $
> > script.  It must have, because that is how I created the expected
file.   :(
> >
> > A patch to the regression will be forthcoming.
>
1998-09-02 23:37:13 +00:00
Bruce Momjian 4b9e21bbc2 cleanup 1998-09-01 06:22:46 +00:00
Bruce Momjian a89089c1f4 cleanup 1998-09-01 05:34:16 +00:00
Bruce Momjian fa1a8d6a97 OK, folks, here is the pgindent output. 1998-09-01 04:40:42 +00:00
Bruce Momjian af74855a60 Renaming cleanup, no pgindent yet. 1998-09-01 03:29:17 +00:00
Bruce Momjian 24a05f5b3e Fix for regproc 1998-08-31 07:55:50 +00:00
Bruce Momjian 50676b40ac Fix for regprocout, use underscore, not parens. 1998-08-31 07:35:44 +00:00
Bruce Momjian 9728ce7499 This is the first (of hopefully few) AIX port patches. This patch
was tested with Linux/GCC.  I still have some issues with with the
snprintf() function.

David Hartwig
1998-08-29 04:09:29 +00:00
Bruce Momjian 15cb32d93e This is the final state of the rule system for 6.4 after the
patch is applied:

	Rewrite rules on relation level work fine now.

	Event qualifications on insert/update/delete  rules  work
	fine now.

	I  added  the  new  keyword  OLD to reference the CURRENT
	tuple. CURRENT will be removed in 6.5.

	Update rules can  reference  NEW  and  OLD  in  the  rule
	qualification and the actions.

	Insert/update/delete rules on views can be established to
	let them behave like real tables.

	For  insert/update/delete  rules  multiple  actions   are
	supported  now.   The  actions  can also be surrounded by
	parantheses to make psql  happy.   Multiple  actions  are
	required if update to a view requires updates to multiple
	tables.

	Regular users  are  permitted  to  create/drop  rules  on
	tables     they     have     RULE     permissions     for
	(DefineQueryRewrite() is  now  able  to  get  around  the
	access  restrictions  on  pg_rewrite).  This enables view
	creation for regular users too. This  required  an  extra
	boolean  parameter  to  pg_parse_and_plan() that tells to
	set skipAcl on all rangetable entries  of  the  resulting
	queries.       There      is      a      new     function
	pg_exec_query_acl_override()  that  could  be   used   by
	backend utilities to use this facility.

	All rule actions (not only views) inherit the permissions
	of the event relations  owner.  Sample:  User  A  creates
	tables    T1    and    T2,   creates   rules   that   log
	INSERT/UPDATE/DELETE on T1 in T2 (like in the  regression
	tests  for rules I created) and grants ALL but RULE on T1
	to user B.  User B  can  now  fully  access  T1  and  the
	logging  happens  in  T2.  But user B cannot access T2 at
	all, only the rule actions can. And due to  missing  RULE
	permissions on T1, user B cannot disable logging.

	Rules  on  the  attribute  level are disabled (they don't
	work properly and since regular users are  now  permitted
	to create rules I decided to disable them).

	Rules  on  select  must have exactly one action that is a
	select (so select rules must be a view definition).

	UPDATE NEW/OLD rules  are  disabled  (still  broken,  but
	triggers can do it).

	There are two new system views (pg_rule and pg_view) that
	show the definition of the rules or views so the db admin
	can  see  what  the  users do. They use two new functions
	pg_get_ruledef() and pg_get_viewdef() that are  builtins.

	The functions pg_get_ruledef() and pg_get_viewdef() could
	be used to implement rule and view support in pg_dump.

	PostgreSQL is now the only database system I  know,  that
	has rewrite rules on the query level. All others (where I
	found a  rule  statement  at  all)  use  stored  database
	procedures  or  the  like  (triggers as we call them) for
	active rules (as some call them).

    Future of the rule system:

	The now disabled parts  of  the  rule  system  (attribute
	level,  multiple  actions on select and update new stuff)
	require a complete new rewrite handler from scratch.  The
	old one is too badly wired up.

	After  6.4  I'll  start to work on a new rewrite handler,
	that fully supports the attribute level  rules,  multiple
	actions on select and update new.  This will be available
	for 6.5 so we get full rewrite rule capabilities.

Jan
1998-08-24 01:38:11 +00:00
Bruce Momjian 7971539020 heap_fetch requires buffer pointer, must be released; heap_getnext
no longer returns buffer pointer, can be gotten from scan;
	descriptor; bootstrap can create multi-key indexes;
pg_procname index now is multi-key index; oidint2, oidint4, oidname
are gone (must be removed from regression tests); use System Cache
rather than sequential scan in many places; heap_modifytuple no
longer takes buffer parameter; remove unused buffer parameter in
a few other functions; oid8 is not index-able; remove some use of
single-character variable names; cleanup Buffer variables usage
and scan descriptor looping; cleaned up allocation and freeing of
tuples; 18k lines of diff;
1998-08-19 02:04:17 +00:00
Thomas G. Lockhart 402b47cffa Disable not-ready-to-use support code for the line data type.
Bracket things with #ifdef ENABLE_LINE_TYPE.
The line data type has always been used internally to support other types,
 but I/O routines have never been defined for it.
1998-08-16 04:06:55 +00:00
Thomas G. Lockhart 21d1e474f5 Some old cleanup fixes for close_ps() from G. Thaker. 1998-08-15 06:45:10 +00:00
Bruce Momjian f22c6f9237 the following patch fixes a bug in the oracle compatibility
functions btrim() ltrim() and rtrim().

    The error was that the character after the set  was  included
    in the tests (ptr2 pointed to the character after the vardata
    part of set if no match found,  so  comparing  *ptr  or  *end
    against *ptr2 MAY match -> strip).


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being
right. # # Let's break this rule - forgive me.
# #======================================== jwieck@debis.com (Jan
Wieck) #
1998-08-11 18:38:07 +00:00
Vadim B. Mikheev be8300b18f Use Snapshot in heap access methods. 1998-07-27 19:38:40 +00:00
Marc G. Fournier 5979d73841 From: t-ishii@sra.co.jp
As Bruce mentioned, this is due to the conflict among changes we made.
Included patches should fix the problem(I changed all MB to
MULTIBYTE). Please let me know if you have further problem.

P.S. I did not include pathces to configure and gram.c to save the
file size(configure.in and gram.y modified).
1998-07-26 04:31:41 +00:00
Marc G. Fournier bf00bbb0c4 I really hope that I haven't missed anything in this one...
From: t-ishii@sra.co.jp

Attached are patches to enhance the multi-byte support.  (patches are
against 7/18 snapshot)

* determine encoding at initdb/createdb rather than compile time

Now initdb/createdb has an option to specify the encoding. Also, I
modified the syntax of CREATE DATABASE to accept encoding option. See
README.mb for more details.

For this purpose I have added new column "encoding" to pg_database.
Also pg_attribute and pg_class are changed to catch up the
modification to pg_database.  Actually I haved added pg_database_mb.h,
pg_attribute_mb.h and pg_class_mb.h. These are used only when MB is
enabled. The reason having separate files is I couldn't find a way to
use ifdef or whatever in those files. I have to admit it looks
ugly. No way.

* support for PGCLIENTENCODING when issuing COPY command

commands/copy.c modified.

* support for SQL92 syntax "SET NAMES"

See gram.y.

* support for LATIN2-5
* add UNICODE regression test case
* new test suite for MB

New directory test/mb added.

* clean up source files

Basic idea is to have MB's own subdirectory for easier maintenance.
These are include/mb and backend/utils/mb.
1998-07-24 03:32:46 +00:00
Bruce Momjian 0da6358f37 Cleanup use of 16 that should be NAMEDATALEN. 1998-07-20 16:57:18 +00:00
Bruce Momjian aac163336f Remove unneeded strcpy() of timezone. 1998-07-19 10:08:15 +00:00
Bruce Momjian 7b2b779a2a Add auto-size to screen to \d? commands. Use UNION to show all
\d? results in one query. Add \d? field search feature.  Rename MB
to MULTIBYTE.
1998-07-18 18:34:34 +00:00
Bruce Momjian 683f399391 Change atttypmod from int16 to int32, for Thomas. 1998-07-12 21:29:40 +00:00
Thomas G. Lockhart fa838876e9 Include 8-byte integer type.
At the moment, probably only works for i686/gcc and Alphas...
1998-07-08 13:57:05 +00:00
Bruce Momjian 8d8bcda253 Hello!
Attached to the mail is locale-patch.tar.gz. In the archive
   there are:

file README.locale
   short description

directory src/test/locale
   test suite; currently only koi8-r tests, but the suite can be
   easily extended

file locale.patch
   the very patch; to apply: patch < locale.patch; should be applied
   to postgres-6.3.2 (at least I created it with 6.3.2 without any
additional
   patches)

   Files touched by the patch:  src/include/utils/builtins.h
src/backend/utils/adt/char.c src/backend/utils/adt/varchar.c
src/backend/utils/adt/varlena.c

Oleg
1998-06-16 06:42:02 +00:00
Bruce Momjian 6bd323c6b3 Remove un-needed braces around single statements. 1998-06-15 19:30:31 +00:00
Bruce Momjian 27db9ecd0b Fix macros that were not properly surrounded by parens or braces. 1998-06-15 18:40:05 +00:00
Bruce Momjian 755c00a360 Auto-seed random so user's can't request random values based on
our postmaster random seed used from cancel.
1998-06-09 19:20:59 +00:00
Thomas G. Lockhart 457b6efa43 Add conversion functions to and from the "name" data type. 1998-05-29 13:33:58 +00:00
Thomas G. Lockhart e8cbf3a79c Ensure string is completely null padded on input (as advertised). 1998-05-29 13:31:52 +00:00
Thomas G. Lockhart cb03826201 Add routines to convert between varchar and bpchar.
Add routines to allow sizing of varchar and bpchar into target columns.
1998-05-09 22:45:14 +00:00
Thomas G. Lockhart 70c4c57e42 Make a few line routines visible.
Incorporate patches from Gautam for line/point intersection.
1998-05-09 22:39:55 +00:00
Thomas G. Lockhart 8e602a3cb7 Define "tz_hour" and "tz_minute" arguments to date_part().
Fix up "ISO-style" timespan decoding and encoding.
1998-05-09 22:38:18 +00:00
Marc G. Fournier 51a1741cfb From: Jeroen van Vianen <jeroenv@design.nl>
Attached patch will add a version() function to Postges, e.g.

template1=> select version();
version
------------------------------------------------------------
PostgreSQL 6.3.2 on i586-pc-linux-gnu, compiled by gcc 2.8.1
(1 row)
1998-04-29 12:41:29 +00:00
Marc G. Fournier f554af0a9f From: t-ishii@sra.co.jp
Hi, here are patches I promised (against 6.3.2):

* character_length(), position(), substring() are now aware of
          multi-byte characters
* add octet_length()
* add --with-mb option to configure
* new regression tests for EUC_KR
  (contributed by "Soonmyung. Hong" <hong@lunaris.hanmesoft.co.kr>)
* add some test cases to the EUC_JP regression test
* fix problem in regress/regress.sh in case of System V
* fix toupper(), tolower() to handle 8bit chars

note that:

o  patches for both configure.in and configure are
included. maybe the one for configure is not necessary.

o pg_proc.h was modified to add octet_length(). I used OIDs
(1374-1379) for that. Please let me know if these numbers are not
appropriate.
1998-04-27 17:10:50 +00:00
Marc G. Fournier 1af6b56427 From: Ryan Kirkpatrick <rkirkpat@nag.cs.colorado.edu>
Ok, I have finally gotten all of the defines for Dec/Alpha and
Linux/Alpha sorted out as Marc asked. There is no longer any need for
'-Dalpha' or '-Dlinuxalpha' in either the Dec/Alpha or the Linux/Alpha
template files (./src/template/{alpha,linuxalpha}). I have replaced every
instance of 'alpha' or '__alpha__' with '__alpha', as that appears to be
the common symbol between C compilers on both operating systems (RH4.2 &
DecUnix 4.0b) for alpha.
1998-04-27 14:46:51 +00:00
Bruce Momjian 09baa3cc81 This patch...
1. Removes the unnecessary "#define AbcRegProcedure 123"'s from
pg_proc.h.

2. Changes those #defines to use the names already defined in
fmgr.h.

3. Forces the make of fmgr.h in backend/Makefile instead of having
it
   made as a dependency in access/common/Makefile  *hack*hack*hack*

4. Rearranged the #includes to a less helter-skelter arrangement,
also
    changing <file.h> to "file.h" to signify a non-system header.

5. Removed "pg_proc.h" from files where its only purpose was for
the
   #defines removed in item #1.

6. Added "fmgr.h" to each file changed for completeness sake.

Turns out that #6 was not necessary for some files because fmgr.h
was being included in a roundabout way SIX levels deep by the first
include.

"access/genam.h"
 ->"access/relscan.h"
   ->"utils/rel.h"
     ->"access/strat.h"
       ->"access/skey.h"
	 ->"fmgr.h"

So adding fmgr.h really didn't add anything to the compile, hopefully
just made it clearer to the programmer.

S Darren.
1998-04-27 04:08:07 +00:00
Bruce Momjian 0d203b745d Re-apply Darren's char2-16 removal code. 1998-04-26 04:12:15 +00:00
Marc G. Fournier 07e3fb08be More work in the right direction on linux/alpha
From: Ryan Kirkpatrick <rkirkpat@nag.cs.colorado.edu>
1998-04-12 02:58:22 +00:00
Bruce Momjian db21523314 Back out char2-char16 removal. Add later. 1998-04-07 18:14:38 +00:00
Bruce Momjian 1e801a8f16 Hi,
Attached you'll find a (big) patch that fixes make dep and make
depend in all Makefiles where I found it to be appropriate.

It also removes the dependency in Makefile.global for NAMEDATALEN
and OIDNAMELEN by making backend/catalog/genbki.sh and bin/initdb/initdb.sh
a little smarter.

This no longer requires initdb.sh that is turned into initdb with
a sed script when installing Postgres, hence initdb.sh should be
renamed to initdb (after the patch has been applied :-) )

This patch is against the 6.3 sources, as it took a while to
complete.

Please review and apply,

Cheers,

Jeroen van Vianen
1998-04-06 00:32:26 +00:00
Bruce Momjian 57b5966405 The following uuencoded, gzip'd file will ...
1. Remove the char2, char4, char8 and char16 types from postgresql
2. Change references of char16 to name in the regression tests.
3. Rename the char16.sql regression test to name.sql.  4. Modify
the regression test scripts and outputs to match up.

Might require new regression.{SYSTEM} files...

Darren King
1998-03-30 17:28:21 +00:00
Bruce Momjian 9a0dd4fb18 There's a patch attached to fix gcc 2.8.x warnings, except for the
yyerror ones from bison. It also includes a few 'enhancements' to
the C programming style (which are, of course, personal).

The other patch removes the compilation of backend/lib/qsort.c, as
qsort() is a standard function in stdlib.h and can be used any
where else (and it is). It was only used in
backend/optimizer/geqo/geqo_pool.c, backend/optimizer/path/predmig.c,
and backend/storage/page/bufpage.c

> > Some or all of these changes might not be appropriate for v6.3,
since we > > are in beta testing and since they do not affect the
current functionality.  > > For those cases, how about submitting
patches based on the final v6.3 > > release?

There's more to come. Please review these patches. I ran the
regression tests and they only failed where this was expected
(random, geo, etc).

Cheers,

Jeroen
1998-03-30 16:47:35 +00:00
Bruce Momjian d705aa8136 > > I'm using text[] arrays. Some of my array elements have '"'
> > characters in them.  Dumping and reloading using pg_dumpall >
> doesn't work with this and dumping the entire array and > > then
trying to parse it is hopeless.

Doug Gibson
1998-03-20 03:44:19 +00:00
Marc G. Fournier b64a7549b4 From: "Thomas G. Lockhart" <lockhart@alumni.caltech.edu>
For substr() and substring() on the text data type, the relevant code is in
varlena.c. You are right, there is a problem. I have a patch which I will
apply to the source tree soon. The copy enclosed below probably does not
preserve tabs correctly so cannot be applied directly; the relevant change
is simply changing the ">=" to ">"...
1998-03-15 08:07:01 +00:00
Marc G. Fournier 661ecf3c48 From: t-ishii@sra.co.jp
Included are patches intended for allowing PostgreSQL to handle
multi-byte charachter sets such as EUC(Extende Unix Code), Unicode and
Mule internal code. With the MB patch you can use multi-byte character
sets in regexp and LIKE. The encoding system chosen is determined at
the compile time.

To enable the MB extension, you need to define a variable "MB" in
Makefile.global or in Makefile.custom. For further information please
take a look at README.mb under doc directory.

(Note that unlike "jp patch" I do not use modified GNU regexp any
more. I changed Henry Spencer's regexp coming with PostgreSQL.)
1998-03-15 07:39:04 +00:00
Thomas G. Lockhart 77ac40d73e Fix money type USE_LOCALE support at least for default "C" locale.
Still has questionable code for some locale-specific strings.
1998-03-02 00:13:36 +00:00
Bruce Momjian a32450a585 pgindent run before 6.3 release, with Thomas' requested changes. 1998-02-26 04:46:47 +00:00
Marc G. Fournier 780068f812 From: Jan Wieck <jwieck@debis.com>
seems  that  my last post didn't make it through. That's good
    since  the  diff  itself  didn't  covered  the  renaming   of
    pg_user.h to pg_shadow.h and it's new content.

    Here  it's  again.  The  complete regression test passwd with
    only some  float  diffs.  createuser  and  destroyuser  work.
    pg_shadow cannot be read by ordinary user.
1998-02-25 13:09:49 +00:00
Marc G. Fournier 0227a4e114 From: "Denis V. Dmitrienko" <denis@null.net>
What it does:
It solves stupid problem with cyrillic charsets IP-based on-fly recoding.
take a look at /data/charset.conf for details.
You can use any tables for any charset.
Tables are from Russian Apache project.
Tables in this patch contains also Ukrainian characters.

Then run ./configure --enable-recode
1998-02-24 15:27:04 +00:00
Marc G. Fournier 18e1f0331b Remove #include "port-protos.h", since we no longer use it
From: Frank Ridderbusch <ridderbusch.pad@sni.de>
1998-02-24 03:47:26 +00:00
Marc G. Fournier 5cf1964fc6 From: Jan Wieck <jwieck@debis.com>
So   if   the   relname   is   given   to   acldefault()   in
    utils/adt/acl.c, it can do a IsSystemRelationName() on it and
    return ACL_RD instead of ACL_WORLD_DEFAULT.
1998-02-24 03:31:50 +00:00
Marc G. Fournier aa0d3ec1be From: Tom I Helbekkmo <tih@Hamartun.Priv.NO>
The file 'backend/utils/adt/arrayfuncs.c' won't compile with the
February 14th snapshot, because of an inconsistency between the
declaration and implementation of ReadArrayStr().  As far as I can
tell, the predeclaration is wrong.  I assume this is what was meant:
1998-02-14 18:00:37 +00:00
Bruce Momjian edd3668895 Atttypmod cleanup. 1998-02-13 19:46:22 +00:00
Bruce Momjian 24cab6bd0d Goodbye register keyword. Compiler knows better. 1998-02-11 19:14:04 +00:00
Bruce Momjian 0386a50f31 Pass around typmod as int16. 1998-02-10 16:04:38 +00:00
Bruce Momjian 65faaf3046 atttypmod now -1. 1998-02-07 06:11:56 +00:00
Bruce Momjian 4eb1ee294d Vadim fix for vacuum analyze. 1998-02-05 21:19:21 +00:00
Bruce Momjian e3f2eb1f39 Fix for varchar functions, and indextyple j-1 fix. 1998-02-05 17:22:41 +00:00
Thomas G. Lockhart 3f52d1705a Define boolean functions for lseg <, <=, <>, >=, >
Define close_ls(), close_lseg(), lseg_length().
Write real code for close_sb(), close_pb(), inter_sb(), inter_lb().
Repair lseg_perp() which determines if two lsegs are perpendicular.
Repair lseg_dt() distance between two lsegs.
Note: close_sl() is clearly broken  but will repair later
 (calculating point on lseg rather than point on line).
1998-02-03 15:55:58 +00:00
Bruce Momjian 244c4a180f No datedebug printing of date debug is not defined. 1998-02-02 01:28:12 +00:00
Marc G. Fournier e6e364088a Move all the isinf() stuff from float.c to isinf.c, and build it according to
configure vs port specific #ifdef's...
1998-02-02 00:04:08 +00:00
Bruce Momjian 6159ba3ab1 AIX patch from Darren King and Univel patch from Billy Allie, mostly
related to grammar and parser issues, with one postmaster fix.
1998-02-01 19:43:54 +00:00
Bruce Momjian 726c3854cb Inline fastgetattr and others so data access does not use function
calls.
1998-01-31 04:39:26 +00:00
Bruce Momjian c65ea0e040 New pg_attribute.atttypmod for type-specific information like
varchar length.

Cleans up code so attlen is always length.

Removed varchar() hack added earlier.

Will fix bug in selecting varchar() fields, and varchar() can be
variable length.
1998-01-16 23:21:07 +00:00
PostgreSQL Daemon baef78d96b Thank god for searchable mail archives.
Patch by: wieck@sapserv.debis.de (Jan Wieck)

   One  of  the design rules of PostgreSQL is extensibility. And
   to follow this rule means (at least for me) that there should
   not  only  be a builtin PL.  Instead I would prefer a defined
   interface for PL implemetations.
1998-01-15 19:46:37 +00:00
Marc G. Fournier 8adc838ff6 Various cleanups for the i386_solaris environment 1998-01-13 19:28:39 +00:00
Marc G. Fournier 374bb5d261 Some *very* major changes by darrenk@insightdist.com (Darren King)
==========================================
What follows is a set of diffs that cleans up the usage of BLCKSZ.

As a side effect, the person compiling the code can change the
value of BLCKSZ _at_their_own_risk_.  By that, I mean that I've
tried it here at 4096 and 16384 with no ill-effects.  A value
of 4096 _shouldn't_ affect much as far as the kernel/file system
goes, but making it bigger than 8192 can have severe consequences
if you don't know what you're doing.  16394 worked for me, _BUT_
when I went to 32768 and did an initdb, the SCSI driver broke and
the partition that I was running under went to hell in a hand
basket. Had to reboot and do a good bit of fsck'ing to fix things up.

The patch can be safely applied though.  Just leave BLCKSZ = 8192
and everything is as before.  It basically only cleans up all of the
references to BLCKSZ in the code.

If this patch is applied, a comment in the config.h file though above
the BLCKSZ define with warning about monkeying around with it would
be a good idea.

Darren  darrenk@insightdist.com

(Also cleans up some of the #includes in files referencing BLCKSZ.)
==========================================
1998-01-13 04:05:12 +00:00
Marc G. Fournier f0445dcbc4 > It seems there is a mistake in substr function:
> then you try get substr, which consists only of last char in string
> you get all string
>
> For example:
> userbase=> select substr('123456', 6,1) ;
> substr
> ------
> 123456
> (1 row)
>

From Edmund Mergl <E.Mergl@bawue.de>
1998-01-13 03:49:51 +00:00
Bruce Momjian 8f125413b0 Cleanup of varchar. 1998-01-08 06:18:18 +00:00
Bruce Momjian 84ef6aae18 Re-install working varchar() with compress size. 1998-01-08 04:58:19 +00:00
Bruce Momjian 5fe090c559 Completion of varchar rollback. 1998-01-08 04:19:16 +00:00
Bruce Momjian 35be73027e Cleanup of varchar. 1998-01-08 03:15:06 +00:00
Bruce Momjian c098f309e3 Rollback varchar size change. 1998-01-08 03:05:01 +00:00
Bruce Momjian 1c9fcfb683 Fix for varchar I missed. 1998-01-07 22:08:23 +00:00
Bruce Momjian e6c6146eb8 Allow varchar() to only store needed bytes. Remove PALLOC,PALLOCTYPE,PFREE. Clean up use of VARDATA. 1998-01-07 18:47:07 +00:00
Bruce Momjian deea69b90e Change some ABORTS to ERROR. Add line number when COPY Failure. 1998-01-05 16:40:20 +00:00
Bruce Momjian 0d9fc5afd6 Change elog(WARN) to elog(ERROR) and elog(ABORT). 1998-01-05 03:35:55 +00:00