Commit Graph

1098 Commits

Author SHA1 Message Date
Bruce Momjian
31cce21fb0 Fix bushy plans. Cleanup. 1999-02-18 00:49:48 +00:00
Bruce Momjian
c82ca4c158 Re-enable bushy plans. Vadim want them. 1999-02-16 00:41:03 +00:00
Bruce Momjian
e6bf7b4d93 rename 1999-02-15 05:56:07 +00:00
Bruce Momjian
56bb23a8fe optimizer rename 1999-02-15 05:50:02 +00:00
Bruce Momjian
50034a852d optimizer rename 1999-02-15 05:28:10 +00:00
Bruce Momjian
c5449d5354 otherrels is now unjoined_rels 1999-02-15 05:21:12 +00:00
Bruce Momjian
82682ff31f optimizer rename 1999-02-15 03:59:28 +00:00
Bruce Momjian
ba2883b264 Remove duplicate geqo functions, and more optimizer cleanup 1999-02-15 03:22:37 +00:00
Bruce Momjian
61aa825876 Optimizer rename. 1999-02-14 04:57:02 +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
ba71b81966 Remove equivalence between datetime and float8. Led to nothin' but trouble. 1999-02-13 05:25:54 +00:00
Thomas G. Lockhart
02e85e7e5f Add routines to convert between int8 and text/varchar types.
Fix output type for int8out, but I don't think it matters.
1999-02-13 04:19:54 +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
Bruce Momjian
ad4b27ac3f Optimizer cleanup. 1999-02-12 17:25:05 +00:00
Bruce Momjian
c0d17c7aee JoinPath -> NestPath for nested loop. 1999-02-12 06:43:53 +00:00
Bruce Momjian
3fdb9bb9c7 Fix optimizer and make faster. 1999-02-12 05:57:08 +00:00
Bruce Momjian
6de25f09b1 Optimizer cleanup. 1999-02-11 17:00:49 +00:00
Bruce Momjian
d244df95db More optimizer speedups. 1999-02-11 14:59:09 +00:00
Bruce Momjian
dbd80c97f4 Optimizer fix for samekeys() and cost fixes for longer optimizer keys. 1999-02-11 04:08:44 +00:00
Tom Lane
403b3eff79 Include <varargs.h> on SunOS. (Does any other platform need it??) 1999-02-11 01:36:55 +00:00
Bruce Momjian
9dbb0efb0b Optmizer cleanup 1999-02-10 21:02:50 +00:00
Bruce Momjian
f859c81c18 Rename Path.keys to Path.pathkeys. Too many 'keys' used for other things. 1999-02-10 03:52:54 +00:00
Bruce Momjian
318e593f03 Rename Temp to Noname for noname tables. 1999-02-09 17:03:14 +00:00
Bruce Momjian
fe35ffe7e0 Major optimizer improvement for joining a large number of tables. 1999-02-09 03:51:42 +00:00
Jan Wieck
be948af2e8 Added LIMIT/OFFSET functionality including new regression test for it.
Removed CURRENT keyword for rule queries and changed rules regression
accordingly. CURRENT has beed announced to disappear in v6.5.

Jan
1999-02-08 14:14:32 +00:00
Bruce Momjian
54e5d25666 Optimizer cleanup. 1999-02-08 04:29:25 +00:00
Tom Lane
5212ef8e46 Correct definition of srandom() --- it takes unsigned int not int. 1999-02-07 22:04:57 +00:00
Jan Wieck
ef590e101e Changed ExecConstraints() and ExecRelCheck() to cache the constraints
qualification expression trees in the execution state. Prevents from
memory exhaustion on INSERT, UPDATE or COPY to tables that have CHECK
constraints. Speedup against the variant using freeObject() is more than
factor 2.

Jan
1999-02-07 16:17:14 +00:00
Bruce Momjian
a553760845 Optimizer cleanup. 1999-02-06 17:29:30 +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
6e2edaf4b8 Optimizer cleanup. 1999-02-05 19:59:31 +00:00
Bruce Momjian
ce3afccf7f More optimizer cleanups. 1999-02-04 03:19:11 +00:00
Bruce Momjian
18fbe4142f More optimizer renaming HInfo -> HashInfo. 1999-02-04 01:47:02 +00:00
Bruce Momjian
8d9237d485 Optimizer rename ClauseInfo -> RestrictInfo. Update optimizer README. 1999-02-03 20:15:53 +00:00
Bruce Momjian
4090d17fee SET_ARGS cleanup 1999-02-02 23:53:26 +00:00
Bruce Momjian
a7ad43cd18 Included patches make some enhancements to the multi-byte support.
o allow to use Big5 (a Chinese encoding used in Taiwan) as a client
  encoding. In this case the server side encoding should be EUC_TW

o add EUC_TW and Big5 test cases to the regression and the mb test
  (contributed by Jonah Kuo)

o fix mistake in include/mb/pg_wchar.h. An encoding id for EUC_TW was
  not correct (was 3 and now is 4)

o update documents (doc/README.mb and README.mb.jp)

o update psql helpfile (bin/psql/psqlHelp.h)

--
Tatsuo Ishii
t-ishii@sra.co.jp
1999-02-02 18:51:40 +00:00
Bruce Momjian
8e958b8a38 Fix create_rule is->as. 1999-02-02 17:46:17 +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
Jan Wieck
28d8b42ca5 Speedup of PL/pgSQL by calling ExecEvalExpr() directly
instead of SPI_execp() for simple expressions.

Jan
1999-01-27 16:15:22 +00:00
Tom Lane
422221c90d Another SELECT speedup: extract OIDs of column print functions
only once per SELECT, not once per tuple.  10% here, 10% there,
pretty soon you're talking about real speedups ...
1999-01-27 00:36:28 +00:00
Bruce Momjian
1401f63dd1 Agg/Aggreg cleanup and datetime.sql patch. 1999-01-25 18:02:28 +00:00
Vadim B. Mikheev
247b3f9054 SELECT FOR UPDATE is implemented... 1999-01-25 12:01:19 +00:00
Tom Lane
d03e98737c Replace typtoout() and gettypelem() with a single routine,
so that fetching an attribute value needs only one SearchSysCacheTuple call
instead of two redundant searches.  This speeds up a large SELECT by about
ten percent, and probably will help GROUP BY and SELECT DISTINCT too.
1999-01-24 05:40:49 +00:00
Tom Lane
77f5428244 Fix a couple little problems with signed vs. unsigned
characters ...
1999-01-24 02:47:15 +00:00
Bruce Momjian
17467bb7fb Rename Aggreg to Aggref. 1999-01-24 00:28:37 +00:00
Bruce Momjian
598a4e15dd Remove unused Choose node. 1999-01-23 23:28:09 +00:00
Tom Lane
e6725d1574 Add explicit buffering in backend libpq, to compensate for
buffering lost by not going through stdio anymore for client I/O.
1999-01-23 22:27:29 +00:00
Bruce Momjian
c91dbcc5c7 The following patch finishes primary key support. Previously, when
a field was labelled as a primary key, the system automatically
created a unique index on the field.  This patch extends it so
that the index has the indisprimary field set.  You can pull a list
of primary keys with the followiing select.

SELECT pg_class.relname, pg_attribute.attname
    FROM pg_class, pg_attribute, pg_index
    WHERE pg_class.oid = pg_attribute.attrelid AND
        pg_class.oid = pg_index.indrelid AND
        pg_index.indkey[0] = pg_attribute.attnum AND
        pg_index.indisunique = 't';

There is nothing in this patch that modifies the template database to
set the indisprimary attribute for system tables.  Should they be
changed or should we only be concerned with user tables?

D'Arcy
1999-01-21 22:48:20 +00:00
Vadim B. Mikheev
12be3e08f1 FOR UPDATE is in parser & rules. 1999-01-21 16:08:55 +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
909c519733 Add missing Windows files. 1999-01-18 12:43:55 +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
Tom Lane
00a420d53c Add description of ELOG_TIMESTAMPS and USE_SYSLOG options,
per Massimo Dal Zotto.
1999-01-17 20:58:03 +00:00
Bruce Momjian
7a6b562fdf Apply Win32 patch from Horak Daniel. 1999-01-17 06:20:06 +00:00
Tom Lane
7fab608205 Add configure test to see whether vsnprintf() is present,
separately from snprintf() --- HPUX, for one, has snprintf but not
vsnprintf.  Fix a minor typo in snprintf.c, too.
1999-01-17 03:22:52 +00:00
Tom Lane
21badba151 Replace direct inclusions of c.h with inclusion of postgres.h,
to ensure that config.h is included as well.
1999-01-17 03:04:57 +00:00
Tom Lane
4e34686a36 Apply Magnus Hagander's followup patch to correct
out-of-sync routine prototypes ... the system doesn't compile without this ...
1999-01-17 01:45:42 +00:00
Marc G. Fournier
d8b96ade81 From: Magnus Hagander <mha@sollentuna.net>
Here's another patch for the libpq backend areas. This patch removes all
usage of "FILE *" on the communications channel. It also cleans up the
comments and headers in the pqcomm.c file - a lot of things were either
missing or incorrect. Finally, it removes a couple of unused functions
(leftovers from the time of shared code between the libpq backend and
frontend).
1999-01-12 12:49:52 +00:00
Marc G. Fournier
3b3ffc8d97 From: Magnus Hagander <mha@sollentuna.net>
Here is a first patch to cleanup the backend side of libpq.
This patch removes all external dependencies on the "Pfin" and "Pfout" that
are declared in pqcomm.h. These variables are also changed to "static" to
make sure.
Almost all the change is in the handler of the "copy" command - most other
areas of the backend already used the correct functions.
This change will make the way for cleanup of the internal stuff there - now
that all the functions accessing the file descriptors are confined to a
single directory.
1999-01-11 03:56:11 +00:00
Vadim B. Mikheev
dfa23f5e41 SELECT FOR UPDATE syntax 1999-01-05 15:46:25 +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
Bruce Momjian
da361ee24b Add max oid display, rather than returning just a dash for the last entry. 1998-12-31 20:09:49 +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
2b8736bac6 Fix for deadlock detection timeout. 1998-12-29 18:30:33 +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
Bruce Momjian
2be1eccec7 Fix for version, update to 6.5. 1998-12-25 02:20:12 +00:00
Jan Wieck
d7171601a3 Changed TypeName.typmod to int32 - atttypmod is of that size
Jan
1998-12-21 12:50:29 +00:00
Bruce Momjian
b8d5f02e4e I have ported PostgreSQL 6.4 to Cobalt Qube running Linux 2.0.33 with
MIPS cpu (I think it's R4000). I have tested the patches on LinuxPPC
and FreeBSD. I believe they do not harm other platforms.
--
Tatsuo Ishii
1998-12-18 17:25:41 +00:00
Jan Wieck
eeff2c94be Fixed nodeToString() to put out "<>" for NULL strings again.
More cleanups to appendStringInfo() usage in node/outfuncs.c.

Jan
1998-12-18 14:45:09 +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
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
Marc G. Fournier
7c3b7d2744 Initial attempt to clean up the code...
Switch sprintf() to snprintf()
Remove any/all #if 0 -or- #ifdef NOT_USED -or- #ifdef FALSE sections of
	code
1998-12-14 05:19:16 +00:00
Thomas G. Lockhart
3a52e3f3a2 Add routines and synonyms to help with single-byte char type handling.
Fix one usage of substr() which mapped to the "Oracle compatibility" funcs
 rather than the more recent (and closer to SQL92) function in varlena.c.
Add more DESC() entries for conversion functions.
1998-12-13 23:45:22 +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
Tom Lane
a10b38f255 Use standard AC_PROG_INSTALL macro to search for install program,
instead of our own halfway-there code.  Add AC_STRUCT_TIMEZONE call
to check whether tm_zone exists in struct tm.  Revise reading of template
file so that templates can define any variables they feel like (and,
indeed, can execute arbitrary shell code) rather than being constrained
to a fixed set of variable names.
1998-12-13 20:03:07 +00:00
Bruce Momjian
0ad5d2a3a8 Change Size from unsigned int to size_t. 1998-12-13 03:44:38 +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
Thomas G. Lockhart
bedd04a551 Implement CASE expression. 1998-12-04 15:34:49 +00:00
Tom Lane
19740e2fff Portability fixes found needed for SunOS 4.1.x:
SunOS has tas(), but not memmove or strerror, and its sprintf() doesn't
return int.  Also, older versions of GNU Make don't like rules with
empty left-hand sides...
1998-11-30 00:30:05 +00:00
Tom Lane
b10a719777 Use autoconf to determine whether system has POSIX signals,
instead of relying on port's os.h to tell us.  (Needed for HPUX
where system major version is not enough info.)
configure unsets USE_TK if X libraries not found.
doc/Makefile uses gzcat or zcat as found by autoconf.
1998-11-29 05:30:25 +00:00
Vadim B. Mikheev
2435c7d501 New HeapTuple structure/interface. 1998-11-27 19:33:35 +00:00
Vadim B. Mikheev
1f00f0dc2e Added indxqualorig to IndexScan: fix for using indices in OR. 1998-11-22 10:45:09 +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
2e18525dbe s_lock patch from Ryan. 1998-10-31 02:06:08 +00:00
Tom Lane
c6338530f6 oid8neq => oid8ne 1998-10-29 19:03:50 +00:00
Thomas G. Lockhart
9b24e7fa40 Fix discrepency in "@" operator for point and path. 1998-10-29 18:10:23 +00:00
Bruce Momjian
1e7c7343c4 Add oid8neq. 1998-10-29 18:07:09 +00:00
Tom Lane
4038dc0ee2 Fix a veritable boatload of errors in oprcom, oprnegate,
oprlsortop and oprrsortop links.  There's still a bug involving
conflicting definitions for point @ path, but I'm not taking
responsibility for deciding which one is right...
1998-10-29 04:22:52 +00:00
Bruce Momjian
cec42339fc Remove bad pg_operator entry, found by Tom Lane. 1998-10-29 04:04:17 +00:00
Bruce Momjian
1adacc7d1e This looks like a wrong entry in one of the system tables. Any ideas
which one it is, and how to correct this ?

lseg_eq -> lseq_neq

Guido Weber
1998-10-28 16:00:08 +00:00
Bruce Momjian
e3b06a871b s_lock aix patch. 1998-10-28 15:58:34 +00:00
Bruce Momjian
0ebb238035 backslash for portability, from Andreas Zeugswetter 1998-10-27 17:47:51 +00:00
Marc G. Fournier
82a9c9cf38 Missed one more required file... 1998-10-27 04:42:59 +00:00
Bruce Momjian
33c4072dbc INET/CIDR cleanup from D'Arcy. 1998-10-22 20:40:50 +00:00
Bruce Momjian
002657f7ed Add LIMIT syntax for Jan. 1998-10-22 13:52:24 +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
7787d75d78 Fix indexing for INET / CIDR. 1998-10-22 05:29:24 +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
f9ee08499f Cleanup of \df for INET/CIDR. 1998-10-21 21:14:20 +00:00
Bruce Momjian
524f4b2d10 The patch does 2 things:
Fixes  a  bug  in  the rule system that caused a crashing
        backend when a join-view with calculated column  is  used
        in subselect.

        Modifies  EXPLAIN to explain rewritten queries instead of
        the plain SeqScan on a view. Rules can produce very  deep
MORE

Jan.
1998-10-21 16:21:29 +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
8cec4cf91b New QUERY_LIMIT set command. 1998-10-14 05:10:12 +00:00
Marc G. Fournier
4fff1dada7 From: Peter Gucwa <pg@softcomputer.com>
Here are patches needed to complie under AIX 4.2.
I changed configure.in, pqcomm.c, config.h.in, and fe-connect.c.
Also I had to install flex because lex did not want to translate pgc.l.
1998-10-13 20:44:49 +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
Tom Lane
60fee725b8 Do not enable TCL_ARRAYS feature by default, because it
is wrong and dangerous unless you are using contrib/string.  We really
need a thorough look at the issue of making the backend and the FE/BE
protocols completely 8-bit-clean for string data, but that's a task
for some future release.
1998-10-08 23:31:20 +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
Thomas G. Lockhart
effb32c307 Add a few items to support an integrated build of the ODBC interface. 1998-10-07 06:39:30 +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
Tom Lane
9e23ab9b5c Add configure test to make sure fcntl(SETLK) is available,
and make backend/libpq/pqcomm.c only try to lock the socket file when
the call exists.  Also, change open-RDONLY to open-WRONLY; at least
on my platform, you can't get a write lock on a file you didn't open
for writing.
1998-10-06 02:31:42 +00:00
Tom Lane
280acf0904 hash.h's use of BSHIFT conflicts with <sys/param.h> on my
system.  Finally got tired of looking at the compiler warning messages.
BSHIFT isn't all that useful, so I just took out the macro.
1998-10-04 20:19:08 +00:00
Bruce Momjian
18af384bb7 Unixware patches from Billy G. Allie. 1998-10-04 15:38:58 +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
9b21a18cee the following little patch adds array references to query
parameters. With it applied a function like

    CREATE FUNCTION getname(oid8, int4) RETURNS name AS
        'SELECT typname FROM pg_type WHERE oid = $1[$2]'
        LANGUAGE 'sql';

    is possible. Mainly I need this to enable array references in
    expressions for PL/pgSQL. Complete regression test ran O.K.

Jan
1998-10-02 16:23:07 +00:00
Bruce Momjian
9b7c6ee00b Fixes for Irix from Robert Bruccoleri 1998-10-02 15:38:04 +00:00
Bruce Momjian
731ea8076f Here's the new diff for getting the NS32K assembly code into the
spin-locks.  Notice that it's now inline assembler in s_lock.h,
rather than seperate code in s_lock.c.  It also shrank a little
bit...  Just rip out the S_LOCK() define and insert the tas() inline
function.  Please let me know if there are any problems with it.

Jon Buller
1998-10-02 15:23:08 +00:00
Bruce Momjian
c17b2d1b16 Fix for constbyval. 1998-10-01 22:51:22 +00:00
Tom Lane
d33bbb5b1f Get rid of some long-dead code that thinks NOTIFY is passed to the
planner/optimizer/executor.  It isn't.
Besides, most of the removed code consists of comments about how
it's not right.
1998-10-01 02:04:01 +00:00
Tom Lane
92edd4233e Make HP-PA S_UNLOCK a little faster and less dependent on unspecified compiler codegen details.
Make default S_LOCK macro more robust against syntax mistakes.
(I cleared these changes with David Gould a few days ago.)
1998-10-01 01:53:50 +00:00
Bruce Momjian
f52e7346ea MB patches from Tatsuo Ishii 1998-09-25 01:46:25 +00:00
Bruce Momjian
a3c5a3cb2f Cleanup for oid8[] from Tatsuo Ishii. 1998-09-22 20:28:15 +00:00
Bruce Momjian
25a64f7519 Fix for \z formatting from Tom Lane. 1998-09-21 02:25:29 +00:00
Bruce Momjian
4a9da7e5c4 NS32K lock patch reversed. 1998-09-18 17:18:41 +00:00
Bruce Momjian
33554989c0 Fix for NS32K machine. 1998-09-18 05:36:24 +00:00
Bruce Momjian
0fc8bce760 Fix for \df. 1998-09-18 04:43:20 +00:00
Bruce Momjian
3700981108 Add new make_oidjoin_check utility and template1_check.sql. Fix some
pg_operator problems.
1998-09-14 01:14:49 +00:00
Thomas G. Lockhart
f1bcb171e8 Remove remnant from obsolete char16 data type. 1998-09-13 14:29:06 +00:00
Bruce Momjian
6ee06b0fd3 Irix lock fix from Robert Bruccoleri 1998-09-12 16:07:53 +00:00
Bruce Momjian
4fc3b068ab Remove lld from LONG LONG name 1998-09-11 17:16:11 +00:00
Bruce Momjian
f1ab71ec5f The attached patches fix the following problems:
1.  The UnixWare tas macro was reformatted (by indent or it like?) which caused
    it to break.  The asm macro construct is very particular about the %mem
    construct -- it has to start in column 1.

2.  When compiling libpq++, g++ was used even if configure found the C++ com-
    piler to be CC.

3.  When compiling libpq++, '-Wno-error' was added to CXXFLAGS, even if the
    compiler wasn't g++.

Billy G. Allie
1998-09-11 16:56:24 +00:00
Bruce Momjian
28834b7226 Remove %qd. 1998-09-11 16:43:26 +00:00
Bruce Momjian
a752e322a3 %lld fix. 1998-09-11 14:10:53 +00:00
Bruce Momjian
4da5714ced long long cleanup 1998-09-10 21:10:51 +00:00
Vadim B. Mikheev
36ef34d73c Added attributes for primary/unique/foreign keys... 1998-09-10 15:32:32 +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
6f84e86d69 Fix for macro for AIX. 1998-09-08 15:24:11 +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
Bruce Momjian
e15807f410 BTW, in catalog/pg_type.h:
#define Anum_pg_index_indisunique               8

I think this should be 9.

Tatsuo Ishii
1998-09-06 04:49:51 +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
fcecc5ca1e [Part #1: Type: text/plain, Encoding: 7bit, Size: 59]
I will be cleaning this up more before the Oct 1 deadline.

David Hartwig.  AND/OR fix.
1998-09-03 02:34:35 +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
Bruce Momjian
a060d5bedf Hello!
Here is a new patch for libpq, to make it work on Win32 again (since
the latest modifications broke it a little).

Please also add the file "libpq.rc" to the interfaces/libpq directory.
This will allow version-stamping of the generated DLL file, so that
automatic install programs (and interested users) can determine
the version of the file.  The file is currently set as "prerelease".
Before the release, somebody should change the line "FILEFLAGS
VS_FF_PRERELEASE" to "FILEFLAGS 0".  That information should probably
go into toos\RELEASE_CHANGES.

The patch is against the cvs as of ~ 1998-08-26 14:30 CEST.


//Magnus
1998-08-29 04:05:46 +00:00
Bruce Momjian
50ad4a70b9 Make 'name' type int aligned, like char/varchar. 1998-08-27 05:06:57 +00:00
Bruce Momjian
4166f73997 Fix 'd ' should be 'd'. 1998-08-27 01:04:23 +00:00
Bruce Momjian
823c393b9f Fix problem where attbyval was wrong for xid types. 1998-08-26 17:12:12 +00:00
Bruce Momjian
d394d06d7a Fix atttypmod alignment again, and re-enable ecpg. 1998-08-26 16:43:54 +00:00
Bruce Momjian
e2b0911564 Fix atttypmod to be int32 in system catalogs. Oops. 1998-08-26 05:51:24 +00:00
Bruce Momjian
093beb3560 Make attalign match type alignment. 1998-08-26 05:22:58 +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
f62d1253ef From: Massimo Dal Zotto <dz@cs.unitn.it>
>       these patches define the UNLISTEN sql command. The code already
>       existed but it was unknown to the parser. Now it can be used
>       like the listen command.
>       You must make clean and delete gram.c and parser.h before make.
1998-08-25 21:37:08 +00:00
Marc G. Fournier
53d7d47302 From: Massimo Dal Zotto <dz@cs.unitn.it>
> sinval.patch
>
>       fixes a problem in SI cache which causes table overflow if some
>       backend is idle for a long time while other backends keep adding
>       entries.
>       It uses the new signal handling implemented in tprintf.patch.
>       I have also increacasesed the max number of backends from 32 to 64
>       and the table size from 1000 to 5000.
>       I don't know if anybody is working on SI, but until another
>       solution is found this patch fixes the problem. I have received
>       messages from other people reporting the same problem which I
>       fixed many months ago.
1998-08-25 21:31:20 +00:00
Marc G. Fournier
82555376a1 missed adding a new include file 1998-08-25 21:29:16 +00:00
Marc G. Fournier
8e9d69d6ac From: Massimo Dal Zotto <dz@cs.unitn.it>
> sequence.patch
>
>       adds the missing setval command to sequences. Owner of sequences
>       can now set the last value to any value between min and max
>       without recreating the sequence. This is useful after loading
>       data from external files.
1998-08-25 21:25:46 +00:00
Marc G. Fournier
88b17d9c56 From: Massimo Dal Zotto <dz@cs.unitn.it>
> ps-status.patch
>
>       macros for ps status, used by postgres.c and utility.c.
>       Unfortunately ps status is system dependent and the current
>       code doesn't work on linux. The use of macros confines system
>       dependency to into one file (ps-status.h). Users of other
>       operating systems should check this code and submit new macros.
1998-08-25 21:24:12 +00:00
Marc G. Fournier
7dbcf31be2 From: Massimo Dal Zotto <dz@cs.unitn.it>
lock.patch

        I have rewritten lock.c cleaning up the code and adding better
        assert checking I have also added some fields to the lock and
        xid tags for better support of user locks. There is also a new
        function which returns an array of pids owning a lock.
        I'm using this code from over six months and it works fine.
1998-08-25 21:20:32 +00:00
Marc G. Fournier
1acf0d85fe From: Massimo Dal Zotto <dz@cs.unitn.it>
config.patch

        remove old defines no more used in the code.
1998-08-25 21:17:11 +00:00
Marc G. Fournier
1a5fb65463 From: Massimo Dal Zotto <dz@cs.unitn.it>
assert.patch

        adds a switch to turn on/off the assert checking if enabled at compile
        time. You can now compile postgres with assert checking and disable it
        at runtime in a production environment.
1998-08-25 21:04:41 +00:00
Thomas G. Lockhart
e0e461e1a3 Add is_sequence flag to ColumnDef structure. Used to implement SERIAL type. 1998-08-25 15:09:31 +00:00
Bruce Momjian
0fc13f582a Make sure resdomno for update/insert match attribute number for
rewrite system.  Restructure parse_target to make it easier to
understand.
1998-08-25 03:17: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
c0b01461db o note that now pg_database has a new attribuite "encoding" even
if MULTIBYTE is not enabled. So be sure to run initdb.

o these patches are made against the latest source tree (after
Bruce's massive patch, I think) BTW, I noticed that after running
regression, the oid field of pg_type seems disappeared.

	regression=> select oid from pg_type; ERROR:  attribute
	'oid' not found

this happens after the constraints test. This occures with/without
my patches. strange...

o pg_database_mb.h, pg_class_mb.h, pg_attribute_mb.h are no longer
used, and shoud be removed.

o GetDatabaseInfo() in utils/misc/database.c removed (actually in
#ifdef 0). seems nobody uses.

t-ishii@sra.co.jp
1998-08-24 01:14:24 +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
a738478ad8 Here are additional patches for the UnixWare 7 port.
Summary of changes:

In pqcomm.h, use the SUN_LEN macro if it is defined to calculate
the size of the sockaddr_un structure.

In unixware.h, drop the use of the UNIXWARE macro.  Everything can
be handled with the USE_UNIVEL_CC and DISABLE_COMPLEX_MACRO macros.

In s_lock.h, remove the reference to the UNIXWARE macro (see above).

In the unixware template, add the YFLAGS:-d line.

In various makefile templates, add (or cleanup) unixware and univel
port specific information.

-- Billy G. Allie
1998-08-22 04:24:41 +00:00
Bruce Momjian
bd5aaca391 Vacuum fix. Was modifying cache. 1998-08-19 19:59:49 +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
Marc G. Fournier
338c54cbc1 From: Jan Wieck <jwieck@debis.com>
Hi,

    as  proposed here comes the first patch for the query rewrite
    system.

  <for details, see archive dated Mon, 17 Aug 1998>
1998-08-18 00:49:04 +00:00
Thomas G. Lockhart
4b11e394bc Remove single-argument trim() function from table.
Never seen because the parser frontend converts all trim() calls to
 btrim(), ltrim(), and rtime() calls before execution.
1998-08-15 06:47:39 +00:00
Thomas G. Lockhart
94f42ed389 Include OID as a built-in type. 1998-08-14 16:07:00 +00:00
Bruce Momjian
c7fe2543b8 fix typo. 1998-08-11 22:39:33 +00:00
Bruce Momjian
024d5f74ba index strategy cleanup 1998-08-11 19:32:39 +00:00
Bruce Momjian
79c8d2e3a0 Change owner from oid to int4 type. 1998-08-11 18:28:49 +00:00
Bruce Momjian
8ed36c3dba More op_class cleanup. 1998-08-11 14:32:03 +00:00
Bruce Momjian
22cc0e1645 Remove NOBTREE defines, and make findoidlinks handle regproc. 1998-08-11 05:32:46 +00:00
Bruce Momjian
22b370e6ce cleanup. 1998-08-11 05:09:30 +00:00
Bruce Momjian
2d32d909b5 Cleanup optimizer function names and clarify code. 1998-08-10 02:26:40 +00:00
Bruce Momjian
a08dc16c47 New pgindent. 1998-08-09 04:59:10 +00:00
Bruce Momjian
af5fde7491 Make large objects their own relkind type. Fix dups in pg_class_mb
files.  Fix sequence creation hack for relkind type.
1998-08-06 05:13:14 +00:00
Marc G. Fournier
a1627a1d64 From: David Hartwig <daybee@bellatlantic.net>
I have attached a patch to allow GROUP BY and/or ORDER BY function or
expressions.  Note worthy items:

1. The expression or function need not be in the target list.
Example:
            SELECT  name FROM foo GROUP BY lower(name);

2.   Simplified the grammar to use expressions only.

3.  Cleaned up earlier patch in this area to make use of existing
utility functions.

3.  Reduced some of the members in the SortGroupBy parse node.   The
original data members were redundant with the new expression node.
(MUST do a "make clean" now)

4.  Added a new parse node "JoinUsing".   The JOIN USING clause was
overloading this SortGroupBy structure.   With the afore mentioned
reduction of members, the two clauses lost all their commonality.

5.  A bug still exist where, if a function or expression is GROUPed BY,
and an aggregate function does not include a attribute from the
expression or function, the backend crashes.   (or something like
that)   The bug pre-dates this patch.    Example:

    SELECT lower(a) AS lowcase, count(b) FROM foo GROUP BY lowcase;
                 *** BOOM  ***

    --Also when not in target list
    SELECT  count(b) FROM foo GROUP BY lower(a);
                *** BOOM  AGAIN ***
1998-08-05 04:49:19 +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
Bruce Momjian
439a2af0bc Update mark/reset index code for multiple indexes, (OR code).
Thanks for Vadim for fixes.
1998-08-03 19:41:35 +00:00
Marc G. Fournier
0668aa8817 Adrian Hall reported a problem to me that snprintf() doesn't exist in, at
least, Solaris 2.5.1.  We use it in backend/utils/adt/int8.c.

Add a check to configure so that we see if it exists or not, and, if not,
compile in snprintf.c from backend/port, which was taken from, and falls under
the same Berkeley license as us, the FreeBSD libc/stdio ...
1998-08-01 19:30:29 +00:00
Vadim B. Mikheev
0d78e8c112 Lmgr cleanup, new locking modes for LLL. 1998-08-01 15:26:38 +00:00