Commit Graph

4198 Commits

Author SHA1 Message Date
Bruce Momjian a03b817373 Const fixes from D'Arcy. 1999-02-04 03:20:39 +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 9322950aa4 Cleanup of source files where 'return' or 'var =' is alone on a line. 1999-02-03 21:18:02 +00:00
Bruce Momjian 3982368a4e The libpq function PQfnumber does not handle case-insensitive
comparisons correctly. The psql monitor converts all table and field
names to lower case. If the PQfnumber function is called with a mixed
case name, it will always return -1.

Bahman Rafatjoo
1999-02-03 20:19:10 +00:00
Bruce Momjian 8d9237d485 Optimizer rename ClauseInfo -> RestrictInfo. Update optimizer README. 1999-02-03 20:15:53 +00:00
Jan Wieck f3a6b38e32 Sort node for ORDER BY is suppressed if choosen index scan will
allways present tuples in the requested order.

Jan
1999-02-03 19:31:24 +00:00
Tom Lane 724119a979 Modify int8 to not depend on sscanf(), and fix configure's test
for int8 support.  configure now checks only snprintf() for int8 support,
not sprintf and sscanf as it used to.  The reason for doing this is that
if we are supplying our own snprintf code (which does handle long long int),
we now only need working long long support in the compiler not in the
platform's C library.  I have verified that int8 now passes regression test
on HPUX 9, and I think it should work on SunOS 4.1.* and other older
platforms if gcc is used.
1999-02-03 00:18:53 +00:00
Bruce Momjian 4090d17fee SET_ARGS cleanup 1999-02-02 23:53:26 +00:00
Bruce Momjian f1b7823471 Make GEQO use dependent on table and index count. 1999-02-02 20:30:18 +00:00
Bruce Momjian eb3415538e OK I found it,
I search in the planner for the '\xFF' appending.
Finally I found in MakeIndexable() in gram.y

Attach a patch which removes the "<=" test in USE_LOCALE,
might make some queries a bit slower for us "locale-heads",
BUT correct result is more important.

        regards,
--
-----------------
Göran Thyni
1999-02-02 19:20:54 +00:00
Bruce Momjian 2163d9e33e Add missing mb files. 1999-02-02 19:04:43 +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 8358a8f6a0 psql help fix. 1999-02-02 18:41:17 +00:00
Bruce Momjian 1b907ab8f5 Fix for psql help create table. 1999-02-02 18:39:23 +00:00
Bruce Momjian 8e958b8a38 Fix create_rule is->as. 1999-02-02 17:46:17 +00:00
Jan Wieck 7ab88a16a1 Fixed failed assertion happening in multiple action rules
when parsestate in makeRangeTable() already contains an
opened p_target_relation.

Jan
1999-02-02 12:57:51 +00:00
Bruce Momjian 4390b0bfbe Add TEMP tables/indexes. Add COPY pfree(). Other cleanups. 1999-02-02 03:45:56 +00:00
Jan Wieck 7fc75517df Fixed growing of backend due to not pfree()'d data on COPY FROM
Fixed growing of backend if BEFORE DELETE trigger returns heap tuple
different from trigtuple.

Jan
1999-02-01 20:25:55 +00:00
Vadim B. Mikheev 072be47202 Initialize es_snapshot. 1999-02-01 13:33:27 +00:00
Tom Lane 757f403451 Tighten coding in samekeys(). Pretty braindead change,
but it saves almost 10% of the runtime in Charles Hornberger's optimizer
example, so what the heck ...
1999-02-01 04:20:50 +00:00
Marc G. Fournier 6ca2bf6534 freebsd4.0 needed to be added to configure... 1999-02-01 02:52:23 +00:00
Marc G. Fournier 91fed81c77 From: Michael Meskes <Michael.Meskes@usa.net>
+
+ Wed Jan 27 12:42:22 CET 1999
+
+       - Fixed bug that caused ecpg to lose 'goto' information.
+       - Set ecpg version to 2.4.7
+
+ Fri Jan 29 18:03:52 CET 1999
+
+       - Fixed bug that caused 'enum' to be rejected in pure C code.
+       - Fixed bug that caused function names to be translated to lower case.
+       - Set ecpg version to 2.4.8
+
1999-01-31 19:56:28 +00:00
Marc G. Fournier f7c4ec5085 From: D'Arcy J.M. Cain <darcy@druid.net>
The following patch does two things.

 - Clarifies what the effect of allowing users to add new users (Thet
   become super-users.)
 - Makes the default database for the new user if they are not allowed
   to and the user agrees to create it.
1999-01-31 05:04:25 +00:00
Tom Lane 36c1895533 Fix postmaster to not try to start more than MaxBackendId children,
per patch from Tatsuo Ishii
1999-01-30 20:04:37 +00:00
Vadim B. Mikheev bfa6d510b3 Small fix for READ COMMITTED isolevel. 1999-01-29 13:24:36 +00:00
Vadim B. Mikheev aaef7beb79 Hope that execMain.c good merged.
Fix for BEFORE ROW UPDATE triggers: result tuple may be different
(due to concurrent update) from one initially produced by top level plan.
1999-01-29 11:56:01 +00:00
Vadim B. Mikheev 1d41e88568 Trying to fix bad merging... 1999-01-29 10:15:09 +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 3e2f87f3f3 Changed qualification of pg_views and pg_tables to directly
check if a rewrite rule on SELECT exists/not exists instead
of asking pg_get_viewdef() function.

Jan
1999-01-28 15:28:40 +00:00
Jan Wieck 51e8a1d390 New prebuilt versions of gram.c and scan.c for the mixed case
identifier support.

Jan
1999-01-28 11:50:42 +00:00
Jan Wieck c42b959fb3 Partial support for mixed case in PL/pgSQL.
Left are identifiers that contain non-alnum/_ chars.
So e.g. whitespaces in identifiers are still not
supported.

Jan
1999-01-28 11:48:31 +00:00
Tom Lane b946244c1c Quick fix for subplan-related crash. 1999-01-27 16:48:20 +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
Bruce Momjian d611ccb874 fix for aggregates 1999-01-27 16:15:01 +00:00
Marc G. Fournier 2ae5d51668 From: Tatsuo Ishii <t-ishii@sra.co.jp>
Included patches fix a portability problem of unsetenv() used in
6.4.2 multi-byte support. unsetenv() is only avaliable on FreeBSD and
Linux so I decided to replace with putenv().
1999-01-27 01:18:23 +00:00
Tom Lane e27f8791f9 Turns out it's easy to cache the fmgr function lookup
result, too ... another little bit of speed for SELECT.
1999-01-27 01:11:43 +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 36693c0525 More agg cleanup. 1999-01-26 23:32:04 +00:00
Marc G. Fournier 38a5bda208 primary key support cleanups from D'Arcy... 1999-01-26 14:38:52 +00:00
Bruce Momjian 692a65e6ff pgindent file. 1999-01-26 05:57:14 +00:00
Marc G. Fournier 2ee522954d From: Peter T Mount <peter@retep.org.uk>
This implements some of the JDBC2 methods, fixes a bug introduced into the
JDBC1 portion of the driver, and introduces a new example, showing how to
use the CORBA ORB thats in Java2 with JDBC.

The Tar file contains the new files, the diff the changes to the others.
CHANGELOG is separate as I forgot to make a .orig ;-)
1999-01-25 21:22:06 +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 443e24beb7 Tighten coding of fmgr_isbuiltin() ... managed to speed it up
by about 10% which seems to be good for half a percent or so of a SELECT.
1999-01-25 00:44:53 +00:00
Tom Lane 49b6be244c Tighten coding of inner loops in nocachegetattr ...
seems to have improved speed of routine by 5% or so ...
1999-01-24 22:53:25 +00:00
Tom Lane 18577547d4 Use heap_attisnull, rather than heap_getattr, for a small
but useful speedup.
1999-01-24 22:50:58 +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
Tom Lane 157349e3af Improper addition of NaN/Infinity recognition to float8in()
was causing it not to detect out-of-range float values, as evidenced by
failure of float8 regression test.  I corrected that logic and also
modified expected float8 results to account for new error message
generated for out-of-range inputs.
1999-01-24 00:12:59 +00:00
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
Tom Lane 13c7c183f7 Fix unportable test syntax in regression script. 1999-01-23 21:36:00 +00:00
Bruce Momjian 598b628b27 Fix for intersect FOR UPDATE check. 1999-01-22 19:35:54 +00:00
Bruce Momjian 15871b48c4 Relcache Size fix. 1999-01-22 18:47:37 +00:00
Bruce Momjian 753c9cb9dd Fix for Size sizeof in cache code. 1999-01-22 16:49:25 +00:00
Marc G. Fournier 8135140a3e |From: "D'Arcy" "J.M." Cain <darcy@druid.net>
|
|The following patch just prevents a warning from being generated because
|the data type isn't specified.
1999-01-22 13:28:50 +00:00
Bruce Momjian 03155dc764 It seems that SPI_prepare() doesn't work well in some cases.
Pawel Pierscionek [pawel@astercity.net] reported about the
following case 1([SQL] drop table in pgsql).
Michael Contzen [mcontzen@dohle.com] reported about the
following case 2(PL/PGSQL bug using aggregates).
You can find it from pgsql-hackers archive.

1. PL/pgSQL can't execute UTILITY commands.
   SPI_prepare() doesn't copy(save) the utilityStmt member of
   Query type nodes,because copyObject() is not implemented
   for nodes of (Create/Destroy etc)Stmt type.

2. Aggregates in PL/pgSQL cause wrong results.

...
   It's a list including Aggreg type nodes which exist in
   TargetList(i.e Aggreg type nodes are common to aggs
   member list and TargetList).
   AFAIC the common pointer is not copied to the same
   pointer by copyObject() function.
   In my patch I reconstruct aggs member node from
   new(copied) Agg type node.
   Is it proper to use set_agg_tlist_references() function to
   reconstruct aggs member node for Agg type nodes ?

Thanks.

Hiroshi Inoue
Inoue@tpf.co.jp
1999-01-21 22:55:41 +00:00
Bruce Momjian 289a826dab Here is a new version of my patch for allowing pg_dump to DROP schema
elements prior to CREATEing new ones.  It is under control of the -c
command line option (with the default being status quo).

The DROP TRIGGER portion still needs implementation.  Anyone able to
help clarify what exactly the CREATE TRIGGER portion does so I can fix
this?

Again, I have tried this with tables/indexes/sequences, but do not
have other schema elements in my database.  As a result, I am not 100%
convinced that I got the syntax correct in all cases (but think I did,
nonetheless).  If anyone can check the other cases, I'd appreciate it.

Cheers,
Brook

[I added manual page and sgml additions for the new -c option.]
1999-01-21 22:53:37 +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
Marc G. Fournier cdbaec771c From: Michael Meskes <Michael.Meskes@usa.net>
See attached file. Now accepts "exec sql whenever sqlwarning".
1999-01-21 20:01:34 +00:00
Vadim B. Mikheev 1f37905681 Copy RowMark node (it's for (-:)) FOR UPDATE). 1999-01-21 16:38:36 +00:00
Vadim B. Mikheev 12be3e08f1 FOR UPDATE is in parser & rules. 1999-01-21 16:08:55 +00:00
Bruce Momjian c8ae6afd13 Update gram.c. 1999-01-20 22:31:07 +00:00
Bruce Momjian 2a6081235c Add Intersect check. 1999-01-20 19:48:13 +00:00
Thomas G. Lockhart 1ace93c46c Fix "Y-2K" problem with two-digit BC dates being corrected by two millenia.
They are not corrected now.
Allow the date type to accept BC dates.
Share more date/time validation declarations through dt.h.
1999-01-20 16:29:39 +00:00
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
Thomas G. Lockhart 974757f19a Add a set of braces to clarify conditional nesting.
gcc complained about ambiguities.
1999-01-20 16:24:59 +00:00
Bruce Momjian 0347dcc860 Okay, I've updated the ecpg parser yet again. Unfortunately it has one
remaining shift/reduce conflict. But the very same conflict is in gram.y, so
I don't dig into it very much now.

Anyway, I just saw that there were minor changes made to ecpg by others. Now
I like that but I would prefer if I was told about that. Otherwise my
version numbering and Changelog maintaining might break. Or simply change
these too. :-)

Also I had to add #include <errno.h> to  backend/libpq/pqcomprim.c to be
able to compile postgresql.

Patch is attached. Since my resubscription process is still not finished
yet, I still send them here.

Michael
1999-01-18 17:17:06 +00:00
Bruce Momjian 909c519733 Add missing Windows files. 1999-01-18 12:43:55 +00:00
Bruce Momjian d3423daaee Fix cfor typos. 1999-01-18 06:46:33 +00:00
Bruce Momjian fd7b963316 Fix for typo in gram.y 1999-01-18 06:32:27 +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 52065cf347 Clean up trivial compiler warning from gcc. 1999-01-17 21:53:32 +00:00
Tom Lane d1a391c332 Reverse out yesterday's patch from Horak Daniel, since
it fails to compile on any machine without a <features.h> header.
If this header is actually necessary on Windows, perhaps an #if test
is in order.
1999-01-17 21:44:46 +00:00
Tom Lane be94d8fb1e Keep Tcl from getting confused if backend closes connection
when a notify is installed.
1999-01-17 21:14:33 +00:00
Tom Lane 5d2cf6af9e TCL_ARRAYS option patches from Massimo Dal Zotto 1999-01-17 21:12:55 +00:00
Tom Lane f134a1a90a Add missing variable, per Massimo. 1999-01-17 21:05:23 +00:00
Tom Lane 740c9da76d fixes to lock debugging macros from Massimo Dal Zotto 1999-01-17 20:59:56 +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 bce901af7d Win32 new files. 1999-01-17 06:27:05 +00:00
Bruce Momjian 7a6b562fdf Apply Win32 patch from Horak Daniel. 1999-01-17 06:20:06 +00:00
Bruce Momjian 298682d9e0 As the email posted to the announce and interfaces list, attached is a tar
file containing the latest version of the JDBC driver, allowing it to be
compiled and used under JDK 1.2 and later.

NB: None (well almost none) of the new methods actually do anything. This
release only handles getting it to compile and run. Now this is done, I'll
start working on implementing the new stuff.

Now this tar file replaces everything under src/interfaces/jdbc. I had to
do it this way, rather than diffs, because most of the classes under the
postgresql subdirectory have moved to a new directory under that one, to
enable the support of the two JDBC standards.

Here's a list of files in the tar file. Any file not listed here (in the
postgresql directory) will have to be deleted, otherwise it could cause
the driver to fail:

Peter Mount
1999-01-17 04:51:59 +00:00
Tom Lane 4a6285ee44 Improve error message when connect() call fails:
report kernel's errno value.
1999-01-17 03:37:19 +00:00
Bruce Momjian 4deb20f4ce Fix for missing NAN. 1999-01-17 03:28:37 +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 cd6bc85aa2 Remove uses of MSG_WAITALL temporarily, since it doesn't
seem to be portable (HPUX doesn't like it, anyway).  Also, clean up
StreamConnection(), which was mis-coded to assume that the address
family field is already set when it's called.
1999-01-17 03:10:23 +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
Tom Lane 46ced3429b Re-insert %.sl rule into Makefile.hpux ... seems it is not
quite as unused as I thought ... how embarrassing.
1999-01-17 00:18:59 +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
Thomas G. Lockhart 6d5d673ca8 Be more careful to check input string lengths as well as values
when deciding whether a field is a year field.  Assume *anything* longer
 than 2 digits (if it isn't a special-case doy) is a valid year.
 This should fix the "Y1K" and "Y10K" problems
  pointed out by Massimo recently.
Check usage of BC to require a positive-valued year; before just used it
 to flip the sign of the year without checking. This led to problems
 near year zero.
Allow a 5 digit "concatenated date" of 2 digit year plus day of year.
Do 2->4 digit year correction for 6 and 5 digit "concatenated dates".
 Somehow forgot this originally. Guess not many folks use it...
1999-01-10 17:20:54 +00:00
Thomas G. Lockhart c715788681 Handle "NaN" and "Infinity" for input values.
I think NAN is already guaranteed to be there from Jan's work on NUMERIC,
 but perhaps HUGE_VAL needs some #ifndef's in the same place.
Should also include "-Infinity" as -HUGE_VAL sometime; not there yet.
1999-01-10 17:13:06 +00:00
Byron Nikolaidis 0b644ad332 Update 06-40-0004 -- Add Bookmark support! 1999-01-08 18:24:45 +00:00
Bruce Momjian 97b88f1c15 Sorry for posting it here again, but I haven't corrected my
subscriptions
yet. It's just a small patch to ecpg to keep it in sync with gram.y.

Michael
1999-01-07 19:11:18 +00:00
Byron Nikolaidis a1164a2508 Update 06-40-0003 1999-01-06 20:44:08 +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
Jan Wieck 814c8495a7 Removed precision restriction in numeric_round() causing
overflow error on high precision calculations where temporary
huge precision is required.

Jan
1999-01-05 11:10:45 +00:00
Byron Nikolaidis 8aad28da2d Mini Update #2 -- final fixes for buffer lengths, null buffers, truncation 1999-01-05 00:32:21 +00:00
Jan Wieck 1bbe55c79f Just one more bugfix - this time in cmp_abs (cannot imagine that
taking a logarithm with a 400 digit precision worked with that bug
in place).

Jan
1999-01-04 17:51:58 +00:00
Jan Wieck c1855793df Fixed backend crashing bug in apply_typmod()
Jan
1999-01-04 12:53:23 +00:00
Jan Wieck e3a5ac283b Little fix for round() function
Jan
1999-01-04 11:20:33 +00:00
Bruce Momjian 936d89e9e0 Fix NAN code. 1999-01-03 05:30:47 +00:00
Bruce Momjian 6fd29f2c01 Fix for NAN generation. 1999-01-03 02:40:12 +00:00
Bruce Momjian f0fbd7b87e Some security, since we now have vsnprintf, I remade an old patch
with some extra ugly sprintfs fixed. More work in this area is
   needed still.

Göran Thyni
1999-01-01 04:48:49 +00:00
Bruce Momjian d8ae7ffb2f Fix for no platform NAN. 1999-01-01 04:17:13 +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
Thomas G. Lockhart 4d56dbd678 Change ordering of HAVE_TM_ZONE and HAVE_INT_TIMEZONE code blocks
to give HAVE_TM_ZONE priority. This fixes glibc2 machines and any other
 machine which passes both tests in configure.
Repair HAVE_TM_ZONE code which stuffs tm structure with date type values.
 Same problems as were originally there before v6.1, but never noticed.
Thanks to Oleg for nagging :)
1998-12-31 16:30:59 +00:00
Byron Nikolaidis 2d74bf8843 uncomment MYLOG to prevent warnings in compile 1998-12-31 00:26:44 +00:00
Byron Nikolaidis bc9bab0390 Mini update to fix SQLGetInfo to work properly (truncation, NULL) 1998-12-31 00:26:06 +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 6059c5a141 Update for deadlock detection. 1998-12-29 19:32:08 +00:00
Bruce Momjian 06c120e67e Update for deadlock timer. 1998-12-29 18:36:29 +00:00
Bruce Momjian 2b8736bac6 Fix for deadlock detection timeout. 1998-12-29 18:30:33 +00:00
Bruce Momjian f659ec545f Fix for deadlock timer timeout. 1998-12-29 18:29:18 +00:00
Byron Nikolaidis 550de5db2c Minor fixes to compile on unix for v6-40-0002 1998-12-29 14:59:30 +00:00
Byron Nikolaidis 6d7735e7f0 Update for version 6-40-0002 and re-merge Thomas' changes. 1998-12-29 01:49:58 +00:00
Bruce Momjian d73cf044f6 autoconf 1998-12-28 05:41:51 +00:00
Bruce Momjian dfe4304879 Fix for current dir not in path, from stan's report. 1998-12-28 05:37:50 +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
Bruce Momjian cb6331901c Fix for snprintf and long long unsigned. 1998-12-24 05:28:50 +00:00
Thomas G. Lockhart 18bdefa23f Fix reference to null pointer when no aggregate function candidates
are available. Problem reported by David Sauer <davids@iol.cz>.
Modify information in resulting error message to indicate both agg name
 and data type.
1998-12-23 14:38:40 +00:00
Bruce Momjian 5afe8d3478 Add subversion mention 1998-12-23 14:35:42 +00:00
Marc G. Fournier e237194b72 From: Michael Meskes <Michael.Meskes@usa.net>
+
+Wed Dec  9 11:24:54 MEZ 1998
+
+       - Synced preproc.y with gram.y and the keywords.c files to add CASE
+         statement.
+
+Tue Dec 22 14:16:11 CET 1998
+
+       - Synced preproc.y with gram.y for locking statements.
+       - Set version to 2.4.5
1998-12-22 18:50:56 +00:00
Jan Wieck d7171601a3 Changed TypeName.typmod to int32 - atttypmod is of that size
Jan
1998-12-21 12:50:29 +00:00
Marc G. Fournier 1adb6a9d18 finished cleaning up outnodes.c ... 1998-12-20 07:13:36 +00:00
Bruce Momjian 3cd3be92ff Fix deadlock so it only checks once. 1998-12-18 19:45:38 +00:00
Bruce Momjian 99603f8578 Add pgaccess Makefile. 1998-12-18 17:54:42 +00:00
Bruce Momjian 3d39ea7341 Here are descriptions:
- the first patch is just to preven listing the perl warning in the
  make output unless it is actually emitted by the make.  this may
  prevent new users from being confused by the warning in their output

- the second patch (to 2 files) just enables building/installing
  pgaccess if TCL and TK are available.  a Makefile is created to do
  this, but you may wish to change the heading information in it since
  I just copied another Makefile to use as a template.

I hope these make it into 6.4.1.

Cheers,
Brook
1998-12-18 17:53:22 +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
Bruce Momjian c7da80bb9a Missed a few files. 1998-12-18 07:09:26 +00:00
Bruce Momjian 03f1648872 Attached is a patch with some fixes that (I think that) should go into
6.4.1. Here is the list:

- The type int8 now works. In fact, the bug(s) were in
src/backend/port/snprintf.c, so int8 is probably broken in every platform
that hasn't a native snprintf/vsnprintf. The type itself worked as
expected, only the output was wrong. Anyway, this patch should be checked
in other platforms.

- The regression tests for int2 and int4, which were broken due to
differences in the error messages, are fixed.

- The regression test for float8, which was broken in the reference
platform, is also fixed. I don't know if the new file (float8-OSF1.out)
will work on other platforms, but it might be worth to try it.

- Two new template files are provided (alpha_cc, which includes
optimization, and alpha_gcc), and src/templates/.similar is updated
accordingly. src/templates/alpha should be removed from the distribution.
*IMPORTANT NOTE*: I don't know if you can use gcc to compile postgres;
I've written the alpha_gcc file because alpha_cc has some flags that are
specific to DEC C.

- There is a (very basic) Digital Unix specific FAQ in
doc/FAQ_DigitalUnix.

--
-------------------------------------------------------------------
Pedro José Lobo Perea                   Tel:    +34 91 336 78 19
1998-12-18 07:08:03 +00:00
Bruce Momjian 9d6f0606c5 Fix for HAVE_LONG bug in snprintf.c. 1998-12-18 07:03:06 +00:00
Bruce Momjian 6b7cf13200 Fix for snprintf with long long's, define problem. 1998-12-18 06:59:39 +00:00
Marc G. Fournier 597205c353 From: Keith Parks <emkxp01@mtcc.demon.co.uk>
Looks like :vartypmod got transmuted to %vartypmod in an editing session.
1998-12-17 13:09:52 +00:00
Bruce Momjian e9491eb91c Upgrade to Pygress 2.2. 1998-12-17 01:43:04 +00:00
Vadim B. Mikheev c13a64d7fb Serialized mode works! 1998-12-16 11:53:55 +00:00
Marc G. Fournier 54c3e65242 Oops, sorry...meant to commit the patch from Thomas for tzn->CTZName 1998-12-15 15:28:57 +00:00
Vadim B. Mikheev 83f558afdd tzn undeclared in FreeBSD, commented out. 1998-12-15 15:10:03 +00:00
Vadim B. Mikheev 3f7fbf85dc Initial MVCC code.
New code for locking buffer' context.
1998-12-15 12:47:01 +00:00
Marc G. Fournier c5a27161a1 More cleanups ... this is one big file *sigh* 1998-12-15 04:00:46 +00:00
Marc G. Fournier 3b8854ff93 Correct some typos... 1998-12-15 02:32:57 +00:00
Marc G. Fournier c1bc907f01 More cleanups of appendStringInfo() function calls... 1998-12-15 02:24:15 +00:00
Bruce Momjian 66d64b727f Compilation of libpq for Win32 breaks on 6.4, because of a change that I
missed before the release. It's simply a symbol that is undefined. This
patch defines this symbol in "win32.h", so it should have no effect on any
other platforms. It should go into 6.4.1 if possible, since compilation is
completely broken without it.

I am also attaching a patch for the "win32.mak" file - it leaves a file
behind when doing "make clean" after the library is built on Visual C++ 6.0.
This is not at all as urgent, but I don't see it breaking here, so I think
it might as well go in there too?

//Magnus
1998-12-14 15:05:27 +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 df1468e251 Many more cleanups... 1998-12-14 06:50:32 +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
Bruce Momjian ffb90a01fd Current multi-byte related codes have a bug with SQL_ASCII
support. Included patches will solve it and should be applied to
both trees.  Also, it fix the problem with \c command of psql when
switching different encoding databases.

Regression tests passed.
--
Tatsuo Ishii
t-ishii@sra.co.jp
1998-12-14 04:59:58 +00:00
Thomas G. Lockhart 4140c2f30e Add support for the CASE statement in the rewrite handling.
Allows (at least some) rules and views.
Still some trouble (crashes) with target CASE columns spanning tables,
 but lots now works.
1998-12-14 00:02:17 +00:00
Thomas G. Lockhart 2b189aa953 Improve CASE statement support.
Try to label CASE columns for a SELECT if not specified with an AS clause.
1998-12-13 23:56:44 +00:00
Thomas G. Lockhart 44cf948467 Fix up error messages when looking up functions and operators to not
make the sometimes misleading claim that more than one candidate was
 identified. Now say "Unable to identify...".
1998-12-13 23:54:40 +00:00
Thomas G. Lockhart 1a8790f7eb Use the new implicit type coersion techniques for matching up types
between columns and DEFAULT clauses.
1998-12-13 23:50:58 +00:00
Thomas G. Lockhart 23cebf11b6 Clean up error messages associated with rules and views.
Fix parser error message when an operator is not found
 to not explicitly claim that there is more than one.
1998-12-13 23:49:18 +00:00
Tom Lane e3909672f1 Build pltcl.so correctly on platforms that want dependent
shared libraries to be listed in the link command.
1998-12-13 23:46:49 +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 e18d900da4 Adjust handling of data type names to suppress double quotes
unless necessary.
Label internal bpchar types as "character" and varchar types as
 "character varying" to be less Postgres-specific. These types map to
 the SQL92 definitions anyway.
Redefine g_force_quotes to be the local variable force_quotes.
Pass this as an argument to fmtId().
These should help with handling the single-byte internal "char" type.
1998-12-13 23:41:32 +00:00
Thomas G. Lockhart 239564e9ef Add routines to help with single-byte (internal) character type support. 1998-12-13 23:36:48 +00:00
Thomas G. Lockhart f9f4004b7c Switch around conditional code so that HAVE_TM_ZONE takes precedence
over HAVE_INT_TIMEZONE. This may help out linux/glibc2 and Dec Alpha.
Included #error precompiler macros to catch cases where neither is defined
 but USE_POSIX_TIME is (shouldn't happen). Hopefully this isn't just
 a gcc-ism.
1998-12-13 23:34:17 +00:00
Tom Lane e791d86012 Partial fix for vendor-cc-versus-gcc incompatibility on HPUX:
prefer aCC as c++ compiler if hpux_cc is selected as template.
Doesn't solve the problem if you have g++ and not aCC, however...
1998-12-13 20:05:16 +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 26a23e33db Add enable_plpgsql from Oliver. 1998-12-13 05:22:58 +00:00
Bruce Momjian 2d11676999 Cleanup patch from Oleg. 1998-12-13 05:14:53 +00:00
Bruce Momjian afded8add3 Fix for lo_import crash. 1998-12-13 05:07:50 +00:00
Bruce Momjian 31d825ba07 While investigating a user's complaint, I have found some memory
destructions in 6.4 source using purify.

(1) parser/gram.y:fmtId()

It writes n+3 bytes into n+1 byte-long memory area if mixed case or
non-ascii identifiers given.

(2) catalog/index.c:

ATTRIBUTE_TUPLE_SIZE bytes are allocated but
sizeof(FormData_pg_attribute) bytes are written. Note that
ATTRIBUTE_TUPLE_SIZE is smaller than
sizeof(FormData_pg_attribute). (for example, on solaris 2.6,

Tatsuo Ishii
1998-12-13 04:37:51 +00:00
Bruce Momjian 589f5aa241 I have a simple patch about the treatment of functions.
But it may be self-satisfied.
Please check my patch at the end of this posting.

Case 1. executor evaluates functions twice

Hiroshi Inoue
Inoue@tpf.co.jp
1998-12-13 04:16:51 +00:00
Bruce Momjian b693983004 New ecpg man page. 1998-12-13 03:53:56 +00:00
Bruce Momjian 0ad5d2a3a8 Change Size from unsigned int to size_t. 1998-12-13 03:44:38 +00:00
Bruce Momjian ecdf95f6d6 This patch fixes the undefined (according to C) and erroneous (under
Digital Uni x with both DEC cc and gcc) behaviour of modifying an
lvalue on the left side an d then using it on the right side of an
assignment. Since this code modifies the
 dbname parameter, it was changing, for example, "dbname=template1"
 into "dbname =emplate1".

David Smith Programmer P
1998-12-13 02:50:20 +00:00
Bruce Momjian 5c431eb1f2 Included patches should fix following problems in the muti-byte
enabled PostgreSQL 6.4.

o binary cursor does not work
o pg_dumpall produces incorrect create database statemnt

Tatsuo Ishii
t-ishii@sra.co.jp
1998-12-12 22:04:09 +00:00
Bruce Momjian 439ef85b0d Fix prototype for 64-bit platforms. 1998-12-12 21:30:57 +00:00
Bruce Momjian 4c87f79854 Update to pgaccess 0.93. 1998-12-12 21:15:40 +00:00
Bruce Momjian 0d5a08f769 Add stdio for NULL define. 1998-12-12 19:57:51 +00:00
Thomas G. Lockhart 053004a80b Clean up a few elog() messages for aggregates and functions. 1998-12-08 06:20:48 +00:00
Thomas G. Lockhart 53b476798a Define routines and catalog entries for string min()/max() functions.
Extend new type coersion techniques to aggregates.
Clean up a few elog() messages.
1998-12-08 06:19:15 +00:00
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
Tom Lane 84107b419e Fix coredumping bug in pg_dump -z; also eliminate memory leaks
in the ACL code, and spell "GRANT RULE" correctly.
Apply patch from Oliver Elphick to not dump inherited constraints.
Apply patch from Constantin Teodorescu to dump table definitions with a
readable layout.
1998-12-05 22:09:57 +00:00
Thomas G. Lockhart 6a7fdf2592 These data types were removed before the last release. 1998-12-04 15:52:45 +00:00
Thomas G. Lockhart 47e506fb8f Include test for CASE expression. 1998-12-04 15:36:51 +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
Tom Lane 92eacaf523 Change exp() behavior to generate error on underflow rather
than silently returning zero on some machines.  Correct float8 regress test
to agree.  Also fix pow() overflow/underflow check to work correctly on
HPUX.
1998-11-29 01:57:59 +00:00
Tom Lane 67531c42bd Portability fix for old SunOS releases: realloc(NULL, ...)
doesn't work there.
1998-11-29 01:53:54 +00:00
Tom Lane 79fcde48b2 Portability fix for old SunOS releases: fflush(NULL)
doesn't work there.  Fortunately the postmaster only has stdout and
stderr to flush.
1998-11-29 01:51:56 +00:00
Tom Lane 9e0e148a83 pq_getstr didn't handle buffer overrun correctly; it would
fail to consume the rest of the input string, and worse it would write
one more byte than it should into the buffer, probably resulting in coredump.
Fortunately there's a correct implementation next door in pqcomprim.c.
1998-11-29 01:47:42 +00:00
Vadim B. Mikheev 971175fa0c New HeapTuple structure/interface. 1998-11-27 20:09:56 +00:00
Vadim B. Mikheev 6beba218d7 New HeapTuple structure/interface. 1998-11-27 19:52:36 +00:00
Vadim B. Mikheev 2435c7d501 New HeapTuple structure/interface. 1998-11-27 19:33:35 +00:00
Jan Wieck 07ffc4628e Fixed bug in the unknown module. Module still tried to call
builtin SPI commands by their old SPI_* names. New names are spi_*.

Jan - 11/23/1998
1998-11-23 16:50:54 +00:00
Tom Lane 6fef1a26cc modify configure so that template/.similar entries can be
selected when they match a prefix of the  value.  The previous method,
which stripped all version data from  and then tried to match that
against .similar entries, was entirely useless when .similar contained
several entries for different version numbers of a single OS name.
1998-11-23 04:40:58 +00:00
Vadim B. Mikheev 34680930d5 Fix using indices in OR.
EXPLAIN all indices used.
1998-11-22 10:48:45 +00:00
Vadim B. Mikheev 1f00f0dc2e Added indxqualorig to IndexScan: fix for using indices in OR. 1998-11-22 10:45:09 +00:00
Marc G. Fournier 056ba12881 Updating and addign files... 1998-11-19 02:39:51 +00:00