Commit Graph

2742 Commits

Author SHA1 Message Date
Thomas G. Lockhart 3c2d74d2af Add new operators and functions for geometric types.
Add text concatenation operator and function.
Add text trim function for SQL92 support.
1997-07-29 16:17:52 +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 07f0647808 Ensure double alignment for time and arrays of circles. 1997-05-26 16:55:23 +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 57f55032ff Add type conversion functions between floats and integers.
Include some additional path functions which were coded but omitted here.
Add translation and rotation/scaling operators for some geometric types.
Fix bugs in some geometry comparison operator declarations.
1997-05-11 15:19:33 +00:00
Thomas G. Lockhart 6e27af13eb Rename LOread() and LOwrite() to loread() and lowrite() to allow use by
case-insensitive SQL parser.
1997-05-06 07:20:53 +00:00
Thomas G. Lockhart 1d1c9ff211 Change mixed-case routines to lower-case in pg_proc.h
Add comparison operators for boolean.
Add aggregate min() and max() for datetime and timespan.
Fix duplicate OID in pg_proc.h
1997-04-27 19:22:45 +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
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 9d5c0af586 From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: [HACKERS] Aggregate function patches

Here are the aggregate function patches I originally sent in last December.
They fix sum() and avg() behavior for ints and floats when NULL values are
involved.

I was waiting to resubmit these until I had a chance to write a v6.0->v6.1
database upgrade script to ensure that existing v6.0 databases which have
not been reloaded for v6.1 do no break with the new aggregate behavior.
These scripts are included below. It's OK with me if someone wants to do
something different with the upgrade strategy, but something like this
was discussed a few weeks ago.

Also, there were a couple of small items which cropped up in doing a clean
install of 970403 (actually 970402 + 970403 changes since the full 970403
tar file appears to be damaged or at least suspect). They are the first
two patches below and can be omitted if desired (although I think they
aren't dangerous :).
1997-04-03 19:56:47 +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
Vadim B. Mikheev 46d11f314f New relkind ('S') for sequence relations.
New funcs (nextval & currval) in pg_proc.h
1997-04-02 03:29:37 +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
Vadim B. Mikheev 5d4e3a7511 Added #define NullValueRegProcedure and #define NonNullValueRegProcedure -
is in use by btree now.
1997-03-24 07:32:38 +00:00
Vadim B. Mikheev 8157c833aa Fix index_create for multi-column indices 1997-03-19 07:36:35 +00:00
Marc G. Fournier 4b4ac7c159 oracle_compat.c fixed for function overloading...
By: From: Edmund Mergl <mergl@nadia.s.bawue.de>
1997-03-16 20:40:52 +00:00
Marc G. Fournier bd2c53c2a9 Remove overloaded functions until we can figure out how to get them to work
properly...
1997-03-16 01:16:31 +00:00
Marc G. Fournier 078633e729 Re-oid the oracle_compat functions
Add new "overloaded" oracle_compat functions (see man oracle_compat)
1997-03-15 06:13:12 +00:00
Marc G. Fournier 9e4798ea0d A couple of development scripts by Dan to detect unused and duplicate
oids
1997-03-15 06:03:08 +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 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 abeaabef2e Restored original pg_type/pg_attribute defaults. Regression fixes. 1997-01-14 01:42:38 +00:00
Bruce Momjian 0567d7edb0 Remove octal character constants and convert to decimal constants 1997-01-10 20:44:41 +00:00
Bruce Momjian 90ff767d14 I found the following bugs in the version 6.0 (dated 961229).
At least the first two should be fixed before the final release of 6.0.

1)      There is a mismatch between the type declared in the catalog for
        the input/output attributes of pg_type and the actual type of
        values stored in the table.  The type of typinput, typoutput,
        typsend and typreceive are declared oid (26) while the values are
        regproc (24).  The error was there also in previous versions but
        nobody noticed it until an Assert has been added in ExecEvalVar.
        The effect is that it is now impossible to replace the typoutput
        of existing data types with new procs.

2)      The identd hba fails after the first time because the data read
        from the identd socket is not zero-terminated and strlen reports
        an incorrect length if the stack contains garbage, which usually
        happens after the first connection has been made.

3)      The new initdb wants to create itself the data directory. This
        implies that the parent directory must be writable by postgres and
        this may not always be desirable.  A better solution would be to
        allow the directory to be created by root and then filled by initdb.
        It would also nice to have some reasonable default for PGLIB and
        PGDATA like the previous version did.  This applies also to the
        postmaster executable.
1997-01-10 17:40:07 +00:00
Bryan Henderson 79729c0e5e Add comments defining "typelem" column of pg_type. 1996-12-09 01:23:51 +00:00
Marc G. Fournier 8abc490181 Features added:
* Wrote max(date) and min(date) aggregates
* Wrote operator "-" for date; date - date yields number of days
  difference
* Wrote operator+(date,int) and operator-(date,int); the int is the
  number of days.  Each operator returns a new date.


By: Tom Tromey <tromey@creche.cygnus.com>
1996-11-14 21:39:14 +00:00
Marc G. Fournier 07a65b2255 Commit of a *MAJOR* patch from Dan McGuirk <djm@indirect.com>
Changes:

        * Unique index capability works using the syntax 'create unique
          index'.

        * Duplicate OID's in the system tables are removed.  I put
          little scripts called 'duplicate_oids' and 'find_oid' in
          include/catalog that help to find and remove duplicate OID's.
          I also moved 'unused_oids' from backend/catalog to
          include/catalog, since it has to be in the same directory
          as the include files in order to work.

        * The backend tries converting the name of a function or aggregate
          to all lowercase if the original name given doesn't work (mostly
          for compatibility with ODBC).

        * You can 'SELECT NULL' to your heart's content.

        * I put my _bt_updateitem fix in instead, which uses
          _bt_insertonpg so that even if the new key is so big that
          the page has to be split, everything still works.

        * All literal references to system catalog OID's have been
          replaced with references to define'd constants from the catalog
          header files.

        * I added a couple of node copy functions.  I think this was a
          preliminary attempt to get rules to work.
1996-11-13 20:56:15 +00:00
Bruce Momjian aaeef4d17d All external function definitions now have prototypes that are checked. 1996-11-10 03:06:38 +00:00
Marc G. Fournier 026387013e Secondly, small problem when trying to create a MAX/MIN aggregate in 1.09.
>From the create_aggregate man page...

"The arguments to state-transition-function-1 must be
(stype1,basetype), and its return value must be stype1."

create aggregate MIN (sfunc1 = int2smaller,
                      basetype = int2,
                      stype1 = int2);

will fail becase int2smaller and int2larger are in pg_proc
as returning an int4.  Can't happen since both args have to
be int2.

From: Darren King <aixssd!ceodev!darrenk@abs.net>
1996-11-08 01:08:37 +00:00
Marc G. Fournier 1d0dd471fa Okay...this pretty much cleans out the include files.
I'm able to get through a 'make' of the backend with no errors except
the occasional 'might not be initialized error', which is nothing major,
just annoying.

Have a few patches from D'Arcy to incorporate, but am waiting until I can
get a clean compile first, which I'm hoping to have before bed, or sometime
tomorrow.
1996-11-06 10:31:02 +00:00
Marc G. Fournier 8544daf645 Another one bites the dust 1996-11-06 07:05:18 +00:00
Marc G. Fournier dc0e256902 clean this one 1996-11-05 11:23:43 +00:00
Marc G. Fournier 6608278ea4 these ones have their dependencies cleaned up 1996-11-05 10:37:16 +00:00
Marc G. Fournier d1e9a76131 Another run through.
This gets us a clean compile of 'common' and 'gist' with *clean* #include
files
1996-11-05 08:18:44 +00:00
Marc G. Fournier d2746c65b5 Make sure all the cleaned includes are commited 1996-11-04 12:12:52 +00:00
Marc G. Fournier d46d53387f Not sure if this is the right place, but add a prototype for
Bryan's superuser() function
1996-11-03 23:49:07 +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 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 f44acab12c Include dependencies based on tupdesc.h, as:
access/tupdesc.h
	catalog/pg_attribute.h
	nodes/pg_list.h
		nodes/nodes.h
	access/attnum.h
1996-11-01 09:22:37 +00:00
Marc G. Fournier 99412aef23 remove:
#include "postgres.h"
	#include "c.h"
1996-10-31 09:51:30 +00:00
Marc G. Fournier c6979925ea its coming... 1996-10-19 04:24:57 +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