Commit Graph

2155 Commits

Author SHA1 Message Date
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
daaeafd9e1 Removed (useless) pg_proc_prosrc_index
Jan
1999-09-30 10:31:47 +00:00
Jan Wieck
b5c4b77283 Added nbtree operator class for NUMERIC
Jan
1999-09-29 21:13:31 +00:00
Jan Wieck
1547ee017c This is part #1 for of the DEFERRED CONSTRAINT TRIGGER support.
Implements the CREATE CONSTRAINT TRIGGER and SET CONSTRAINTS commands.

TODO:
    Generic builtin trigger procedures
    Automatic execution of appropriate CREATE CONSTRAINT... at CREATE TABLE
    Support of new trigger type in pg_dump
    Swapping of huge # of events to disk

Jan
1999-09-29 16:06:40 +00:00
Bruce Momjian
d62a7ac6d3 Massimo's SET FSYNC and SHOW PG_OPTIONS changes, without SET QUERY_LIMIT. 1999-09-27 20:27:32 +00:00
Vadim B. Mikheev
30659d43eb Transaction log manager core code.
It doesn't work currently but also don't break anything -:)
1999-09-27 15:48:12 +00:00
Bruce Momjian
e7cad7b0cb Add TRUNCATE command, with psql help and sgml additions. 1999-09-23 17:03:39 +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
b399805e22 Eliminate elog()'s hardwired limit on length of an error message.
This change seems necessary in conjunction with long queries, and it
cleans up some bogosity in connection with long EXPLAIN texts anyway.
Note that current libpq will accept any length error message (at least
until it runs out of memory); prior versions have a limit of 8K, but
will cleanly discard excess error text, so there shouldn't be any
big compatibility problems with old clients.
1999-09-11 19:06:42 +00:00
Tom Lane
5bc0d31ae8 Repair incorrect cleanup of heap memory allocation during
transaction abort --- before it only worked if there was exactly one level
of allocation context stacked in the blank portal.  Now it does the right
thing for any depth, including zero...
1999-09-09 16:25:35 +00:00
Bruce Momjian
fb7548f4db Invalidate temp entries for aborted transactions. 1999-09-04 19:55:50 +00:00
Tom Lane
b4a607c9e0 Modify RelationFlushRelation so that if the relcache entry
has positive refcount, it is rebuilt from pg_class data.  This ensures
that relcache entries will track changes made by other backends.  Formerly,
a shared inval report would just be ignored if it happened to arrive while
the relcache entry was in use.  Also, fix relcache to reset ref counts
to zero during transaction abort.  Finally, change LockRelation() so that
it checks for shared inval reports after obtaining the lock.  In this way,
once any kind of lock has been obtained on a rel, we can trust the relcache
entry to be up-to-date.
1999-09-04 18:42:15 +00:00
Tom Lane
2b67dc5387 Alter AllocSet routines so that requests larger than
ALLOC_BIGCHUNK_LIMIT are always allocated as separate malloc() blocks,
and are free()d immediately upon pfree().  Also, if such a chunk is enlarged
with repalloc(), translate the operation into a realloc() so as to
minimize memory usage.  Of course, these large chunks still get freed
automatically if the alloc set is reset.
I have set ALLOC_BIGCHUNK_LIMIT at 64K for now, but perhaps another
size would be better?
1999-08-24 20:11:19 +00:00
Tom Lane
b1baf1ff60 Add get_func_rettype() to general-use lsyscache routines,
since it's now needed in both optimizer and parser.
1999-08-16 02:06:25 +00:00
Tom Lane
5af4b04f31 Move get_attdisbursion to lsyscache. Clean up get_typdefault. 1999-08-09 03:13:31 +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
c175de56dc Reverse out cache changes that are not ready yet. 1999-07-20 17:14: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
faf7d78174 Install new alignment code to use MAXALIGN rather than DOUBLEALIGN where
approproate.
1999-07-19 07:07:29 +00:00
Bruce Momjian
d0634aca39 configure cleanup 1999-07-18 17:38:25 +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
773088809d More cleanup 1999-07-16 17:07:40 +00:00
Bruce Momjian
a9591ce66a Change #include's to use <> and "" as appropriate. 1999-07-15 23:04:24 +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
ad4948862c Remove S*I comments from Stephan. 1999-07-13 21:17:45 +00:00
Bruce Momjian
296efd8065 Fix for ACL length problem on different platforms. 1999-07-09 03:28:53 +00:00
Bruce Momjian
4c65382596 Remove QUERY_LIMIT and documenation on same. Change _ALIGN to TYPEALIGN
for Irix.
1999-06-17 15:16:09 +00:00
Bruce Momjian
0c3281ce7c Reversed out Massimo patch. 1999-06-12 14:07:33 +00:00
Bruce Momjian
603e153bb8 I don't like last minute patches before the final freeze, but I believe that
this one could be useful for people experiencing out-of-memory crashes while
executing queries which retrieve or use a very large number of tuples.

The problem happens when storage is allocated for functions results used in
a large query, for example:

  select upper(name) from big_table;
  select big_table.array[1] from big_table;
  select count(upper(name)) from big_table;

This patch is a dirty hack that fixes the out-of-memory problem for the most
common cases, like the above ones. It is not the final solution for the
problem but it can work for some people, so I'm posting it.

The patch should be safe because all changes are under #ifdef. Furthermore
the feature can be enabled or disabled at runtime by the `free_tuple_memory'
options in the pg_options file. The option is disabled by default and must
be explicitly enabled at runtime to have any effect.

To enable the patch add the follwing line to Makefile.custom:

CUSTOM_COPT += -DFREE_TUPLE_MEMORY

To enable the option at runtime add the following line to pg_option:

free_tuple_memory=1

Massimo
1999-06-12 14:05:41 +00:00
Marc G. Fournier
93b57eb533 trace.patch (compilation error)
the gettimeofday doesn't compile under Linux with glibc2 because
        the DST_NONE constant is no more defined. It seems that this code
        (written by me) has always be wrong but for some reason working.

From: Massimo Dal Zotto <dz@cs.unitn.it>
1999-06-05 04:18:09 +00:00
Tom Lane
74e7b58b61 Fix for failure to clean SysCache entry when a relation is deleted
in the same transaction that created it.
1999-06-04 02:19: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
07842084fe pgindent run over code. 1999-05-25 16:15:34 +00:00
Tom Lane
d52a91a5d8 Modify aset.c logic so that blocks requested from malloc get
bigger the more space is used in an allocset.  This reduces the malloc
overhead very substantially on queries that need lots of memory.
1999-05-22 23:19:37 +00:00
Tom Lane
cf1478982c Modify backend switch parsing to prevent 'insecure' switches
from being accepted when they are passed from client connection request.
Get rid of a couple that no longer do anything (like -P).
1999-05-22 17:47:54 +00:00
Jan Wieck
5057010944 Changed debug options:
-d4 now prints compressed trees from nodeToString()
-d5 prints pretty trees via nodeDisplay()

new pg_options: pretty_plan, pretty_parse, pretty_rewritten

Jan
1999-05-11 09:06:35 +00:00
Tom Lane
71d5d95376 Update hash and join routines to use fd.c's new temp-file
code, instead of not-very-bulletproof stuff they had before.
1999-05-09 00:53:22 +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
87d95ca04d Arrange for VACUUM to delete the init file that relcache.c uses
to save a little bit of backend startup time.  This way, the first
backend started after a VACUUM will rebuild the init file with up-to-date
statistics for the critical system indexes.
1999-05-01 19:09:46 +00:00
Thomas G. Lockhart
99e57ee86f Move some useful date/time test macros to here to allow
sharing across files.
1999-04-15 02:24:23 +00:00
Tom Lane
098e043849 Fix CREATE OPERATOR ... LANGUAGE 'internal', which I broke while
making prosrc instead of proname be the link to the actual internal function.
1999-04-09 22:35:43 +00:00
Tom Lane
c537d4295a Modify fmgr so that internal name (compiler name) of a built-in
function is found in prosrc field of pg_proc, not proname.  This allows
multiple aliases of a built-in to all be implemented as direct builtins,
without needing a level of indirection through an SQL function.  Replace
existing SQL alias functions with builtin entries accordingly.
Save a few K by not storing string names of builtin functions in fmgr's
internal table (if you really want 'em, get 'em from pg_proc...).
Update opr_sanity with a few more cross-checks.
1999-03-29 01:30:45 +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
Tom Lane
1e117923aa Revise memutils.h to use alignment information gathered by
configure, instead of having a bunch of crufty platform-specific guesses.
1999-03-25 19:05:19 +00:00
Tom Lane
6febecc569 Clean up att_align calculations so that XXXALIGN macros
need not be bogus.
1999-03-25 03:49:34 +00:00
Bruce Momjian
48ea8b76db Hi,
I have solved some problems with dynamic loading on NT. It is possible
to
run succesfully both trigger and plpgsql regression tests. The patch is
in
the included file "diff".

                        Dan
1999-03-22 16:45:30 +00:00
Bruce Momjian
bd6f98af31 I suggest the following portability patch, which does not
change functionality, but makes the code more ANSI C'ish.
My AIX xlc compiler barfs on all of these. Can someone please
review and apply to current.

 <<port.patch>>
Thanks
Andreas
1999-03-19 18:56:43 +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
Tom Lane
f621b85a2a Fix int8 configure one more time ... prior version didn't
define INT64_FORMAT in all cases.
1999-03-15 01:43:07 +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
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
817a3e6d39 Enclosed below I have a patch to allow a btree index on the int8 type.
I would like some feedback on what the hash function for the int8 hash
function
in the ./backend/access/hash/hashfunc.c should return.

Also, could someone (maybe Tomas Lockhart?) look-over the patch and make
sure
the system table entries are correct?  I've tried to research them as
much as I
could, but some of them are still not clear to me.

Thanks,
-Ryan
1999-03-14 05:09:05 +00:00
Marc G. Fournier
75007a72d6 Have configure check for use of %lld for int64, and if that fails, check for
use of %qd...a more generic solution then having #ifdef __<INSERT OS HERE>__
in the code...
1999-03-08 04:17:33 +00:00
Tom Lane
86c2eadb18 Modify mcxt.h so that it doesn't pull in half of creation. 1999-03-07 23:03:32 +00:00
Tom Lane
6c51355612 Eliminate duplicated code in dt.h 1999-03-06 22:58:11 +00:00
Tom Lane
bcfdc9df04 Repair some pretty serious problems in dynahash.c and
shared memory space allocation.  It's a wonder we have not seen bug
reports traceable to this area ... it's quite clear that the routine
dir_realloc() has never worked correctly, for example.
1999-02-22 06:16:57 +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
7a724a0231 Include some Julian date declarations to share between various date/time
modules. Used to be in dt.c I think.
1999-02-13 04:15:33 +00:00
Jan Wieck
ead64f317b New alloc set code using a memory block pool for small allocations.
Jan
1999-02-06 16:50:34 +00:00
Bruce Momjian
4090d17fee SET_ARGS cleanup 1999-02-02 23:53:26 +00:00
Bruce Momjian
4390b0bfbe Add TEMP tables/indexes. Add COPY pfree(). Other cleanups. 1999-02-02 03:45:56 +00:00
Vadim B. Mikheev
e3a1ab764e READ COMMITTED isolevel is implemented and is default now. 1999-01-29 09:23:17 +00:00
Thomas G. Lockhart
791822e3a7 Clean up leap year support and date/time validation.
Move declarations to allow sharing between modules.
1999-01-20 16:26:45 +00:00
Bruce Momjian
bd8ffc6f3f Hi!
INTERSECT and EXCEPT is available for postgresql-v6.4!

The patch against v6.4 is included at the end of the current text
(in uuencoded form!)

I also included the text of my Master's Thesis. (a postscript
version). I hope that you find something of it useful and would be
happy if parts of it find their way into the PostgreSQL documentation
project (If so, tell me, then I send the sources of the document!)

The contents of the document are:
  -) The first chapter might be of less interest as it gives only an
     overview on SQL.

  -) The second chapter gives a description on much of PostgreSQL's
     features (like user defined types etc. and how to use these features)

  -) The third chapter starts with an overview of PostgreSQL's internal
     structure with focus on the stages a query has to pass (i.e. parser,
     planner/optimizer, executor). Then a detailed description of the
     implementation of the Having clause and the Intersect/Except logic is
     given.

Originally I worked on v6.3.2 but never found time enough to prepare
and post a patch. Now I applied the changes to v6.4 to get Intersect
and Except working with the new version. Chapter 3 of my documentation
deals with the changes against v6.3.2, so keep that in mind when
comparing the parts of the code printed there with the patched sources
of v6.4.

Here are some remarks on the patch. There are some things that have
still to be done but at the moment I don't have time to do them
myself. (I'm doing my military service at the moment) Sorry for that
:-(

-) I used a rewrite technique for the implementation of the Except/Intersect
   logic which rewrites the query to a semantically equivalent query before
   it is handed to the rewrite system (for views, rules etc.), planner,
   executor etc.

-) In v6.3.2 the types of the attributes of two select statements
   connected by the UNION keyword had to match 100%. In v6.4 the types
   only need to be familiar (i.e. int and float can be mixed). Since this
   feature did not exist when I worked on Intersect/Except it
   does not work correctly for Except/Intersect queries WHEN USED IN
   COMBINATION WITH UNIONS! (i.e. sometimes the wrong type is used for the
   resulting table. This is because until now the types of the attributes of
   the first select statement have been used for the resulting table.
   When Intersects and/or Excepts are used in combination with Unions it
   might happen, that the first select statement of the original query
   appears at another position in the query which will be executed. The reason
   for this is the technique used for the implementation of
   Except/Intersect which does a query rewrite!)
   NOTE: It is NOT broken for pure UNION queries and pure INTERSECT/EXCEPT
         queries!!!

-) I had to add the field intersect_clause to some data structures
   but did not find time to implement printfuncs for the new field.
   This does NOT break the debug modes but when an Except/Intersect
   is used the query debug output will be the already rewritten query.

-) Massive changes to the grammar rules for SELECT and INSERT statements
   have been necessary (see comments in gram.y and documentation for
   deatails) in order to be able to use mixed queries like
   (SELECT ... UNION (SELECT ... EXCEPT SELECT)) INTERSECT SELECT...;

-) When using UNION/EXCEPT/INTERSECT you will get:
   NOTICE: equal: "Don't know if nodes of type xxx are equal".
   I did not have  time to add comparsion support for all the needed nodes,
   but the default behaviour of the function equal met my requirements.
   I did not dare to supress this message!

   That's the reason why the regression test for union will fail: These
   messages are also included in the union.out file!

-) Somebody of you changed the union_planner() function for v6.4
   (I copied the targetlist to new_tlist and that was removed and
   replaced by a cleanup of the original targetlist). These chnages
   violated some having queries executed against views so I changed
   it back again. I did not have time to examine the differences between the
   two versions but now it works :-)
   If you want to find out, try the file queries/view_having.sql on
   both versions and compare the results . Two queries won't produce a
   correct result with your version.

regards

    Stefan
1999-01-18 00:10:17 +00:00
Jan Wieck
b5626a2089 Restricted maximum precision for NUMERIC to 1000 digits.
Anything else is CPU overkill.

Jan
1999-01-05 11:12:11 +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
Bruce Momjian
58e539e574 Long awaited port for NetBSD/m68k was finally done by Mr. Mutsuki
Nakajima. Since he is not subscribing the mailing list, I'm posting
his patches by his request.  According to him, he has successfully
compiled and passed the regression test on Mac SE/30 running
NetBSD/m68k. Also, another person has reported that with the patches
PostgreSQL is working on NetBSD/sun3 too.
--
Tatsuo Ishii
1998-12-26 18:15:53 +00:00
Vadim B. Mikheev
3498d878cb SET TRANSACTION ISOLATION LEVEL ...
LOCK TABLE IN ... MODE
...implemented
1998-12-18 09:10:39 +00:00
Vadim B. Mikheev
c13a64d7fb Serialized mode works! 1998-12-16 11:53:55 +00:00
Vadim B. Mikheev
3f7fbf85dc Initial MVCC code.
New code for locking buffer' context.
1998-12-15 12:47:01 +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
9470ab03c9 Define routines and catalog entries for string min()/max() functions.
Extend new type coersion techniques to aggregates.
1998-12-08 06:18:34 +00:00
Vadim B. Mikheev
2435c7d501 New HeapTuple structure/interface. 1998-11-27 19:33:35 +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
Bruce Momjian
1e7c7343c4 Add oid8neq. 1998-10-29 18:07:09 +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
a824add49a Remove unused INET functions for D'Arcy. 1998-10-20 23:03:20 +00:00
Bruce Momjian
eb3e640ea2 New INET functions from D'Arcy J.M. Cain 1998-10-12 04:07:53 +00:00
Bruce Momjian
beac8c1c46 Fix for vacuum and cache use. Fix for BSDI 4.0. 1998-10-12 00:53:42 +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
Tom Lane
c77a29a14e Substantial rewrite of async.c to avoid problems with non-reentrant stdio
and possibly other problems.  Minor changes in xact.c and postgres.c's
main loop to support new handling of async NOTIFY.
1998-10-06 02:40:09 +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
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
4fc3b068ab Remove lld from LONG LONG name 1998-09-11 17:16:11 +00:00
Bruce Momjian
28834b7226 Remove %qd. 1998-09-11 16:43:26 +00:00
Bruce Momjian
a7b5abcbc7 %lld not %Ld 1998-09-10 05:36:00 +00:00
Bruce Momjian
c34ed86ea8 Allow long long on BSDI. 1998-09-10 03:27:09 +00:00
Bruce Momjian
202751921d Alignment cleanup so no more massive switch statements for alignment,
just two macros.
1998-09-07 05:35:48 +00:00
Thomas G. Lockhart
6d62e1da9d Use alternate form for long-long-int to be compatible with AIX.
%Ld worked with gcc, but %lld works with both gcc and AIX.
1998-09-05 01:19:38 +00:00
Bruce Momjian
d318315200 > Yikes, that is certainly not standard C. I have never seen that
before.
> Looks like a GNU-ism.  I nice one, but still a GNU-ism.

Sorry, I didn't know it is a GNU extension. I have written this patch
which should fix the problem. Let me know if you still have problems.

Massimo Dal Zotto
1998-09-03 02:20:30 +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
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
Marc G. Fournier
96c4212f99 cvs add'd two files for the tprintf() patch... 1998-08-25 21:43:47 +00:00
Marc G. Fournier
82555376a1 missed adding a new include file 1998-08-25 21:29:16 +00:00
Bruce Momjian
07ae591c87 Attached is a patch that uses autoconf to determine whether there
is a working 64-bit-int type available.

In playing around with it on my machine, I found that gcc provides
perfectly fine support for "long long" arithmetic ... but sprintf()
and sscanf(), which are system-supplied, don't work :-(.  So the
autoconf test program does a cursory test on them too.

If we find that a lot of systems are like this, it might be worth
the trouble to implement binary<->ASCII conversion of int64 ourselves
rather than relying on sprintf/sscanf to handle the data type.

			regards, tom lane
1998-08-23 22:25:54 +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
Bruce Momjian
8ed36c3dba More op_class cleanup. 1998-08-11 14:32:03 +00:00
Bruce Momjian
22b370e6ce cleanup. 1998-08-11 05:09:30 +00:00
Bruce Momjian
d9be0ff432 MergeSort was sometimes called mergejoin and was confusing. Now
it is now only mergejoin.
1998-08-04 16:44:31 +00:00
Vadim B. Mikheev
be8300b18f Use Snapshot in heap access methods. 1998-07-27 19:38:40 +00:00
Bruce Momjian
683f399391 Change atttypmod from int16 to int32, for Thomas. 1998-07-12 21:29:40 +00:00
Thomas G. Lockhart
bad339827e Add int8 8-byte integer type. 1998-07-08 14:10:30 +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
27db9ecd0b Fix macros that were not properly surrounded by parens or braces. 1998-06-15 18:40:05 +00:00
Thomas G. Lockhart
345b0f6b99 Rewrite JROUND macro to multiply by 1e6 rather than divide by 1e-6
and vica versa for the next operation.
This is reputed to fix inline math optimization troubles in glibc-2.0.x.
Regression tests still pass on libc/i686 machine.  Patch suggested by Matt.
1998-05-31 17:08:35 +00:00
Thomas G. Lockhart
3984f0eeb2 Add conversion functions between "name" and other string types. 1998-05-29 13:37:29 +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
9afe03355a Make lines more visible to the user. 1998-05-09 22:44:38 +00:00
Thomas G. Lockhart
14257ee2c6 Add bit flags to support timezonehour and minute in data retrieval. 1998-05-09 22:43:50 +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
0d203b745d Re-apply Darren's char2-16 removal code. 1998-04-26 04:12:15 +00:00
Bruce Momjian
4cbfeef912 Inline some small functions called for every row. 1998-04-24 14:43:33 +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
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
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
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
0b4620b575 Quick cleanups 1998-02-23 18:43:13 +00:00
Marc G. Fournier
6c7c6d0c05 From: Jan Wieck <jwieck@debis.com>
The diff looks so simple and easy. But to find it wasn't fun.

    It must have been there for a long time. What happened:

    When a tuple in one of some central catalogs was updated, the
    referenced  relation  got flushed, so it would be reopened on
    the next access (to reflect new  triggers,  rules  and  table
    structure changes into the relation cache).

    Some  data  (the  tupleDescriptor e.g.) is used in the system
    cache too. So when a relation is subject to the system cache,
    this  must know too that a cached system relation got flushed
    because the tupleDesc data gets freed during the flush!

    For the GRANT/REVOKE on pg_class it was  slightly  different.
    There  is some local data in inval.c that gets initialized on
    the first invalidation of a tuple in some  central  catalogs.
    This  needs a SysCache lookup in pg_class. But when the first
    of all commands is a GRANT on pg_class,  exactly  the  needed
    tuple is the one actually invalidated. So I added little code
    snippets that the initialization of the  local  variables  in
    inval.c will already happen during InitPostgres().
1998-02-23 17:44:24 +00:00
Vadim B. Mikheev
f0e7e2faa4 ExecReScan for Unique & Sort nodes. 1998-02-23 06:28:16 +00:00
Bruce Momjian
edd3668895 Atttypmod cleanup. 1998-02-13 19:46:22 +00:00
Marc G. Fournier
2a07e65dcd From: Zeugswetter Andreas SARZ <Andreas.Zeugswetter@telecom.at>
Only occurrs in
src/include/storage/s_lock.h:#if defined(__AIX)
src/include/utils/dt.h:#if defined(__AIX)
src/include/utils/nabstime.h:#if defined(__AIX)

Simply delete one underscore, only occurs once per file, so no patch.
1998-02-13 17:12:08 +00:00
Bruce Momjian
0386a50f31 Pass around typmod as int16. 1998-02-10 16:04:38 +00:00
Thomas G. Lockhart
93d80d3359 Define boolean functions and operators for lseg <, <=, <>, >=, >.
Define functions and operators for closest point to lseg on box,
 to line on lseg, to lseg on lseg.
Define function and operator for length of lseg.
Change length operator from '??' to '@-@'
 (currently defined for path and lseg).
1998-02-03 16:01:59 +00:00
Marc G. Fournier
feb5a2cfd6 Fix for various aix related 'mis-defines'
From: Darren King <darrenk@insightdist.com>
1998-02-03 02:09:08 +00:00
Marc G. Fournier
68c6ddbe8f Fix for ltoa() problem pointed out by Stan Brown <stanb@awod.com> 1998-02-02 03:11:37 +00:00
Bruce Momjian
7229513943 Fix prototypes so they don't look like function definitions. 1998-01-24 22:50:57 +00:00
Bruce Momjian
412a5e6539 Parser cleanup.
Add lock to i386 asm.
1998-01-20 05:05:08 +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
Bruce Momjian
4bad5be7bc Fix SCO and change index name. 1998-01-11 21:03:10 +00:00
Bruce Momjian
679d39b9c8 Goodbye ABORT. Hello ERROR for all errors. 1998-01-07 21:07:04 +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
9db64857e0 Move variable.c to commands/ and aclchk.c to catalog/. 1998-01-05 18:43:18 +00:00
Bruce Momjian
0d9fc5afd6 Change elog(WARN) to elog(ERROR) and elog(ABORT). 1998-01-05 03:35:55 +00:00
Thomas G. Lockhart
cc19151e3b Add substring function for text based on oracle_compat package but
closer to standard behavior.
Substitute "text *" for "struct varlena *" in declarations.
1998-01-01 05:42:40 +00:00
Thomas G. Lockhart
0c714ea9ae Lengthen some time conversion routine names now that longer names
(> 16 characters) are allowed in pg_proc (thanks Bruce!).
1997-12-23 19:55:51 +00:00
Thomas G. Lockhart
5af05c0a59 Move declarations for timespan2tm() and tm2timespan() from dt.c to here. 1997-12-17 23:19:28 +00:00
Thomas G. Lockhart
a58825a467 Add declarations for text, bpchar, and varchar length functions.
Remove declarations in builtins.h duplicated in dt.h.
Change a few return type declarations to use "type *"
 rather than "struct ...".
1997-12-16 15:55:17 +00:00
Bruce Momjian
598e86f3b3 Cleanup up include files. 1997-11-26 01:14:33 +00:00
Bruce Momjian
195f78e43c More archive cleanup. 1997-11-21 19:12:41 +00:00
Bruce Momjian
e9e1ff226f Remove all time travel stuff. Small parser cleanup. 1997-11-20 23:24:03 +00:00
Thomas G. Lockhart
680ef08511 Add DTK_DOY to help decode day of year fields. 1997-11-17 16:39:58 +00:00
Bruce Momjian
4e9df155f0 Add new \df psql option and oid8types() function. 1997-11-15 16:32:25 +00:00
Vadim B. Mikheev
32cd09ac6d Good Bye, Time Travel! 1997-11-02 15:27:14 +00:00
Thomas G. Lockhart
cc1b420cfd Add routines istrue() and isfalse() to directly evaluate boolean type. 1997-10-30 16:45:12 +00:00
Vadim B. Mikheev
7bff4c5078 Now we are able to CREATE PROCEDURAL LANGUAGE (Thanks, Jan). 1997-10-28 15:11:45 +00:00
Thomas G. Lockhart
60fee0d67c Add conversion routines for int2, int4, and oid to and from text.
Change a few routine names to ensure <= 16 characters in name
 to fit correctly into pg_proc.
1997-10-25 05:40:43 +00:00
Vadim B. Mikheev
78351f422b Fix for backward cursors with ORDER BY. 1997-10-15 06:36:36 +00:00
Thomas G. Lockhart
070d494464 Clean up function declarations for the boolean type package
to use bool as the type for arguments and return values.
1997-10-09 05:07:25 +00:00
Bruce Momjian
4a98c5763e Back out inclusion of postgres.h. 1997-09-25 16:52:23 +00:00
Bruce Momjian
2f4275327e Massive examples fix from Nicola Bernardelli 1997-09-25 16:35:52 +00:00
Thomas G. Lockhart
aae2420e8b Add point_ne() comparison routine. 1997-09-20 16:25:28 +00:00
Thomas G. Lockhart
d0ab9c3f81 Add tinterval comparison routines. 1997-09-20 16:24:39 +00:00
Thomas G. Lockhart
2b83160dca Add integer/money arithmetic from Darren King. 1997-09-20 16:23:47 +00:00
Vadim B. Mikheev
a6e0803a7f No more SortTuplesInTree... 1997-09-18 14:42:35 +00:00
Vadim B. Mikheev
bbe2c10c14 Addded to Psortstate:
lt_tupcount - number of tuples in struct leftist *Tuples
	lasttuple   - last tuple put to disk by createfirstrun()
1997-09-18 05:42:01 +00:00
Vadim B. Mikheev
f3e9cf9c6b Fix pfree problem. 1997-09-15 14:29:01 +00:00
Bruce Momjian
59f6a57e59 Used modified version of indent that understands over 100 typedefs. 1997-09-08 21:56:23 +00:00
Bruce Momjian
075cede748 Add typdefs to pgindent run. 1997-09-08 20:59:27 +00:00
Bruce Momjian
319dbfa736 Another PGINDENT run that changes variable indenting and case label indenting. Also static variable indenting. 1997-09-08 02:41:22 +00:00
Bruce Momjian
1ccd423235 Massive commit to run PGINDENT on all *.c and *.h files. 1997-09-07 05:04:48 +00:00
Thomas G. Lockhart
b647a27cf5 Add comparision routines to support indices on datetime and timespan. 1997-09-04 18:44:29 +00:00
Vadim B. Mikheev
444369e7b2 struct Trigger changed 1997-09-04 13:26:45 +00:00
Vadim B. Mikheev
6084c915d0 Triggers added to Relation 1997-09-01 08:13:22 +00:00
Bruce Momjian
021778eed3 We store Cash/money as int of size 4, so make it an int rather than a long. 1997-08-22 07:13:01 +00:00
Bruce Momjian
0ab2921290 Change time function names to be more consistent, and check for zero divides, from Michael Reifenberg. 1997-08-21 23:57:00 +00:00
Vadim B. Mikheev
ac3d7b3146 + extern double *box_area(BOX *box); 1997-08-21 01:40:30 +00:00
Bruce Momjian
11ac1bf268 More NOT_USEDs 1997-08-20 14:54:35 +00:00
Bruce Momjian
1d8bbfd2e7 Make functions static where possible, enclose unused functions in #ifdef NOT_USED. 1997-08-19 21:40:56 +00:00
Bruce Momjian
42c0cd33a2 I think I finally got psort working for all cases. 1997-08-06 07:02:49 +00:00
Bruce Momjian
cc24b846dd psort cleanups. 1997-08-06 05:38:46 +00:00
Bruce Momjian
f5f366e188 Allow internal sorts to be stored in memory rather than in files. 1997-08-06 03:42:21 +00:00
Thomas G. Lockhart
e89d139dbe Add new routines.
Change definition for isreltime().
Change some names of #define constants to avoid conflicts with the yacc parser.
1997-07-29 16:16:14 +00:00
Bruce Momjian
8d25436d70 mkLinux patches from Tatsuo Ishii. 1997-07-29 14:09:11 +00:00
Thomas G. Lockhart
495fdfba98 Rearrange DTK_x constants.
Define constants to allow day of week decoding.
Add new datetime and timespan routines.
1997-07-01 00:25:30 +00:00
Thomas G. Lockhart
45409f0cdd Remove code not previously enabled with USE_NEW_DATE and USE_NEW_TIME
#defines.
1997-06-23 15:03:45 +00:00
Thomas G. Lockhart
742425447d Drop internal routines for formatting time output. Use default formatter.
Add timezone info to abstime2tm().
1997-06-23 14:58:51 +00:00
Thomas G. Lockhart
9af564ada6 Add parser category for "DST" Daylight Savings Time qualifier on time zones. 1997-06-20 17:15:00 +00:00
Vadim B. Mikheev
39c73eff63 Definition for RelationForgetRelation(). 1997-06-04 09:01:49 +00:00
Thomas G. Lockhart
4bd4a55b98 Add upgradepath(), isoldpath(), upgradepoly() and revertpoly() to allow
upgrading from existing pre-v6.1 path and polygon geometric data types.
1997-06-03 14:11:28 +00:00
Thomas G. Lockhart
3887d41b13 Put parens around macro arguments for safety per D'Arcy's suggestion. 1997-06-03 14:07:24 +00:00
Thomas G. Lockhart
0828204538 Enable new date and time definitions to allow Solaris and Irix -O2 compilation.
Move date and time field type labels to less than 32 to allow use as masks.
1997-05-23 05:10:03 +00:00
Marc G. Fournier
5e7c0a0b9a From: Darren King <aixssd!darrenk@abs.net>
Subject: [PATCHES] DROP AGGREGATE patch/fix.


Here's a patch that fixes the DROP AGGREGATE command to delete
the desired aggregate for a specific type.
1997-05-22 00:17:24 +00:00
Vadim B. Mikheev
b0dfe8e38e Define FREE(x) as pfree. 1997-05-20 11:37:33 +00:00
Thomas G. Lockhart
9fd868d16a Rename new float and int conversion routines to avoid conflicts with
system calls on AIX (and probably other machines too).
1997-05-14 04:35:10 +00:00
Thomas G. Lockhart
407cd4ee24 Add a few type conversion functions.
Pass an additional argument for date/time formatting to better handle timezones.
1997-05-11 15:13:49 +00:00
Thomas G. Lockhart
36d18351aa Change dummy array dimensions from [0] to [1] to keep non-gcc compilers happy.
No real change in the support code is required since the actual size
 of the structures is calculated using offsetof() rather than sizeof().
1997-05-06 07:24:42 +00:00
Thomas G. Lockhart
0a95a17da2 Change mixed-case routines to lower-case for case-insensitive SQL.
Add mixed-case #define synonyms to avoid changing more source code.
Add comparison operators for boolean.
Add aggregate min() and max() for datetime and timespan.
1997-04-27 19:24:16 +00:00
Marc G. Fournier
094ec2d3f3 More timezone patches by Thomas:
Here are patches which should help fix timezone problems in the
datetime and abstime code. Also, I repatched varlena.c to add in
some comments and a little error checking on top of Vadim's earlier
repairs. There are slight mods to the circle data type to have the
distance operator between circles measure the distance between
closest points rather than between centers.
1997-04-25 18:40:50 +00:00
Marc G. Fournier
9e2a87b62d Major patch from Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
OK, here are a passel of patches for the geometric data types.
These add a "circle" data type, new operators and functions
for the existing data types, and change the default formats
for some of the existing types to make them consistant with
each other. Current formatting conventions (e.g. compatible
with v6.0 to allow dump/reload) are supported, but the new
conventions should be an improvement and we can eventually
drop the old conventions entirely.

For example, there are two kinds of paths (connected line segments),
open and closed, and the old format was

'(1,2,1,2,3,4)' for a closed path with two points (1,2) and (3,4)
'(0,2,1,2,3,4)' for an open path with two points (1,2) and (3,4)

Pretty arcane, huh? The new format for paths is

'((1,2),(3,4))' for a closed path with two points (1,2) and (3,4)
'[(1,2),(3,4)]' for an open path with two points (1,2) and (3,4)

For polygons, the old convention is

'(0,4,2,0,4,3)' for a triangle with points at (0,0),(4,4), and (2,3)

and the new convention is

'((0,0),(4,4),(2,3))' for a triangle with points at (0,0),(4,4), and (2,3)

Other data types which are also represented as lists of points
(e.g. boxes, line segments, and polygons) have similar representations
(they surround each point with parens).

For v6.1, any format which can be interpreted as the old style format
is decoded as such; we can remove that backwards compatibility but ugly
convention for v7.0. This will allow dump/reloads from v6.0.

These include some updates to the regression test files to change the test
for creating a data type from "circle" to "widget" to keep the test from
trashing the new builtin circle type.
1997-04-22 17:35:09 +00:00
Vadim B. Mikheev
d94c7fc4c5 1. Declaration
static const char *num_word(Cash value);
moved to cash.c.
2. 'extern ' added to funcs prototypes.
1997-04-18 02:59:26 +00:00
Marc G. Fournier
88d740462f From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: [HACKERS] Money integration patches

Here are patches to integrate the money data type. I have included
some math and aggregate functions and have made the locale support optional
by #ifdef USE_LOCALE bracketing of functions.

Modules affected are:
builtins.h.patch
cash.c.patch
cash.h.patch
main.c.patch
pg_aggregate.h.patch
pg_operator.h.patch
pg_proc.h.patch
pg_type.h.patch

I changed the data type to be pass-by-reference rather than by-value
to pave the way for a larger internal representation (64-bit ints?).
Also, I changed the tabbing of cash.c and cash.h to match most of
the other Postgres source code files (4 space indent, 8 spaces == 1 tab).

The locale stuff should be tested under another convention (Russian?)
but I don't know what the correct results should be so perhaps someone
else can give them a try. Will update docs and regression tests in
the next few days.
1997-04-15 17:41:44 +00:00
Marc G. Fournier
4999f002e6 Add in D'Arcy's cash code
pg_proc.h still needs modifying, but this gets it in there so that we can
get around any compiler bugs.  Will try and get the pg_proc.h entries done
up later tonight...
1997-04-09 08:36:21 +00:00
Marc G. Fournier
2ab34dfe1a From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: [HACKERS] More date time functions

Here are some additional patches mostly related to the date and time
data types. It includes some type conversion routines to move between
the different date types and some other date manipulation routines such
as date_part(units,datetime).

I noticed Edmund Mergl et al's neat trick for getting function overloading
for builtin functions, so started to use that for the date and time stuff.
Later, if someone figures out how to get function overloading directly
for internal C code, then we can move to that technique.

These patches include documentation updates (don't faint!) for the built-in
man page. Doesn't yet include mention of timestamp, since I don't know
much about it and since it may change a bit to become a _real_ ANSI timestamp
which would include parser support for the declaration syntax (what do you
think, Dan?).

The patches were developed on the 970330 release, but have been rebuilt
off of the 970402 release. The first patch below is to get libpq to compile,
on my Linux box, but is not related to the rest of the patches and you can
choose not to apply that one at this time. Thanks in advance, scrappy!
1997-04-02 18:36:24 +00:00
Marc G. Fournier
28454c216b From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: Re: [HACKERS] abstime "now" broken

Yes, I broke 'now' :( with an attempt at a bug fix involving
servers running in the UTC/GMT timezone. These patches fix
the problem, and have been tested in GMT (+00 hours),
PST (-08), and NZT (+12) timezones which exercized the code for
various cases including across day boundaries.  btw, this code
fixes the same type of problem for 'today', 'yesterday', 'tomorrow',
for DATETIME, ABSTIME, DATE and TIME types.

The bugfix itself is quite small, but I have accumulated other
changes in the datetime data type and include them here also.
One set of changes involves printing ISO-formatted dates and
is in response to the helpful information from Kurt Lidl regarding
ANSI SQL dates. I'll send another e-mail sometime soon discussing
more issues he has raised...
1997-03-28 07:13:21 +00:00
Marc G. Fournier
070381482f From: "D'Arcy J.M. Cain" <darcy@druid.net>
Subject: [HACKERS] backend/utils/adt/timestamp.c

Back to this timezone stuff.  The struct tm has a field (tm_gmtoff) which
is the offset from UTC (GMT is archaic BTW) in seconds.  Is this the
value you are looking for when you use timezone?  Note that this applies
to NetBSD but it does not appear to be in either ANSI C or POSIX.  This
looks like one of those things that is just going to have to be hand
coded for each platform.

Why not just store the values in UTC and use localtime instead of
gmtime when retrieving the value?

Also, you assume the time is returned as a 4 byte integer.  In fact,
there is not even any requirement that time be an integral value.  You
should use time_t here.

The input function seems unduly restrictive.  Somewhere in the sources
there is an input function that allows words for months.  Can't we do
the same here?

There is a standard function, difftime, for subtracting two times.  It
deals with cases where time_t is not integral.  There is, however, a
small performance hit since it returns a double and I don't believe
there is any system currently which uses anything but an integral for
time_t.  Still, this is technically the correct and portable thing to do.

The returns from the various comparisons should probably be a bool.
1997-03-25 09:25:33 +00:00
Marc G. Fournier
dfe0475362 From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: [HACKERS] More patches for date/time

I have accumulated several patches to add functionality to the datetime
and timespan data types as well as to fix reported porting bugs on non-BSD
machines. These patches are:

dt.c.patch              - add datetime_part(), fix bugs
dt.h.patch              - add quarter and timezone support, add prototypes
globals.c.patch         - add time and timezone variables
miscadmin.h.patch       - add time and timezone variables
nabstime.c.patch        - add datetime conversion routine
nabstime.h.patch        - add prototypes
pg_operator.h.patch     - add datetime operators, clean up formatting
pg_proc.h.patch         - add datetime functions, reassign conflicting date OIDs
pg_type.h.patch         - add datetime and timespan data types

The dt.c and pg_proc.h patches are fairly large; the latter mostly because I tried
to get some columns for existing entries to line up.
1997-03-25 08:11:24 +00:00
Marc G. Fournier
b5e16b1869 Resync the source tree, commit some things that were missing (pqcomprim.c) and
bring in Thomas's updates for the date/time code...
1997-03-18 16:36:50 +00:00
Marc G. Fournier
791c075852 Date/Time updates from Thomas... 1997-03-14 23:34:16 +00:00
Marc G. Fournier
071484c5d8 From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] timestamp type

OK, last one.  This patch adds an ANSI SQL 'timestamp' type.
1997-03-12 21:28:14 +00:00
Marc G. Fournier
5dde558ce6 From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] linux/alpha patches

These patches lay the groundwork for a Linux/Alpha port.  The port doesn't
actually work unless you tweak the linker to put all the pointers in the
first 32 bits of the address space, but it's at least a start.  It
implements the test-and-set instruction in Alpha assembly, and also fixes
a lot of pointer-to-integer conversions, which is probably good anyway.
1997-03-12 21:13:19 +00:00
Marc G. Fournier
e4949f9fe5 From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] better access control error messages

This patch replaces the 'no such class or insufficient privilege' with
distinct error messages that tell you whether the table really doesn't
exist or whether access was denied.
1997-03-12 20:48:48 +00:00
Bruce Momjian
b913dd1f9e Add prototypes for oracle-compat functions. Rename geo-*.c adt to geo_*.c 1997-03-09 20:41:02 +00:00
Marc G. Fournier
83978e1ea7 This is a set of single row character functions, defined for the datatype
text, which are supposed to behave exactly as their Oracle counterparts.

From: Edmund Mergl <E.Mergl@bawue.de>
1997-03-04 05:32:26 +00:00
Bruce Momjian
6eb0525185 Prevent under/over flow of float8 constants in parser. Small regression fix. 1997-02-19 20:11:05 +00:00
Bruce Momjian
31c8e94b34 Remove WIN32 defines. They never worked. 1997-02-14 04:19:07 +00:00
Bruce Momjian
cb6cb7745d Here's the final set of patches to 6.0 (sup'd on 27/12/96) that allow a full
gmake of the code without interruption.

There's also some tidy-up of the MAXPATHLEN stuff based on the assumption that
all supported platforms have MAXPATHLEN defined in <sys/param.h>.

(The only unknowns for the above are AIX and IRIX5.)
1996-12-28 02:13:05 +00:00
Bryan Henderson
2697c27923 sigjmp_buf/jmp_buf is backwards, so backend doesn't compile. 1996-12-10 07:04:22 +00:00
Bryan Henderson
9c0afeabb7 More stuff to make it compile on various ports. 1996-11-27 08:16:44 +00:00
Bryan Henderson
46d58fba33 Make it compile on Ultrix. Thanks Erik Bertelson. 1996-11-26 03:20:35 +00:00
Bruce Momjian
b3ce105b31 Add prototype for new datetime functions. 1996-11-16 04:59:10 +00:00
Marc G. Fournier
fb3b9d7661 Fix a comment that wasn't commente'd out
Pointed out by: Erik Bertelsen <erik@sockdev.uni-c.dk>
1996-11-14 20:06:39 +00:00
Bruce Momjian
aaeef4d17d All external function definitions now have prototypes that are checked. 1996-11-10 03:06:38 +00:00
Bruce Momjian
1d0e308395 Added new include file. 1996-11-09 05:48:28 +00:00
Marc G. Fournier
b49d41884f Add prototype for: int DebugFileOpen() 1996-11-06 10:15:25 +00:00
Marc G. Fournier
0b3cb80e03 finally, this directory is (should be!) totally clean 1996-11-04 11:51:27 +00:00
Marc G. Fournier
434201d8d7 another pass through.
Note.  all include files that have been hit so far have had extraneous
       include files cleaned out and are reduced to...the lowest common
       "include file", based on 'cc -Wall -I. test.c', where test.c is:

#include "postgres.h"
#include "<top of branches>" (ie. top of branches this time was utils/fcache2.h)
1996-11-04 08:53:07 +00:00
Marc G. Fournier
63482946c7 More cleanups (this one will most likely break under Win32, if anyone is
working on it)
1996-11-04 08:14:05 +00:00
Marc G. Fournier
82400d4c50 Next, based on utils/catcache.h 1996-11-04 07:59:39 +00:00
Marc G. Fournier
5a5f9420e5 Another series started from utils/builtins.h 1996-11-04 07:46:06 +00:00
Marc G. Fournier
d93d3c843a -Wall based cleanup of include files, based from acl.h, and everything
that it depends on
1996-11-04 07:18:46 +00:00
Bruce Momjian
7e42f4814d Removed PORTNAME_. Use OS version only. 1996-11-04 04:00:56 +00:00
Marc G. Fournier
ff36ebc922 More cleans of the inter-dependencies in the #include files 1996-11-03 12:13:35 +00:00
Marc G. Fournier
0c960e7fc0 More include file cleanups 1996-11-03 08:17:38 +00:00
Marc G. Fournier
3516eda61c Okay, following Bryan's (and others) suggestions...cleaning up the
include files properly...yet, slowly...
1996-11-01 09:31:17 +00:00
Marc G. Fournier
6d4c760eb5 Include file cleanup:
Based on include files require by htup.h, as:

	access/htup.h
		storage/itemptr.h
			storage/block.h
			storage/off.h
		utils/nabstime.h
			<time.h>
1996-11-01 09:19:11 +00:00
Marc G. Fournier
99412aef23 remove:
#include "postgres.h"
	#include "c.h"
1996-10-31 09:51:30 +00:00
Bruce Momjian
3d7fe6c97c Added needed include file. 1996-10-31 05:58:01 +00:00
Marc G. Fournier
20b4c46e26 Fixes: Errors when PQexec() in backend creates temp
relations and transaction is aborted

Submitted by: wieck@sapserv.debis.de (Jan Wieck)
1996-10-24 07:55:54 +00:00
Marc G. Fournier
f36b2560a4 Major code cleanups from D'arcy (-Wall -Werror) 1996-10-23 07:42:13 +00:00
Marc G. Fournier
2b5a8bc38b More include files cleaned up 1996-10-20 06:35:27 +00:00
Marc G. Fournier
42dd813494 Hopefully that cleans up the cruft from rel.h 1996-10-19 04:31:45 +00:00
Marc G. Fournier
7bb98fd618 step by step...file by file... 1996-10-19 04:16:04 +00:00
Marc G. Fournier
f697bf3b85 and another 1996-10-19 04:06:48 +00:00
Marc G. Fournier
1054097464 More cleanups of the include files
- centralizing to simplify the -I's required to compile
1996-08-28 01:59:28 +00:00