Commit Graph

673 Commits

Author SHA1 Message Date
Bruce Momjian fae2f14cdd It looks like the problem was introduced when the "SET autocommit" and
"SET search_path"  commands were added to the beginning of the script.

The attatched patch should fix the problem. It probably should be
applied  against the 7.3 and 7.4 branches.

Steven Singer
2002-12-05 21:03:51 +00:00
Tom Lane 565dcdf77f Fix off-by-one bug in usage check. 2002-12-03 07:12:18 +00:00
Tom Lane dfebfc1bc8 Fix script name in README. 2002-12-02 00:29:01 +00:00
Tom Lane b168915643 Fix dependency generation for multicolumn foreign keys. From Adam Buraczewski. 2002-12-02 00:28:29 +00:00
Tom Lane fd89de5156 Add note that scaling factor should be >= # of clients. 2002-11-27 19:26:10 +00:00
Bruce Momjian 46f4ed4921 Allocate proper length for sprintf string, from Tatsuo. 2002-11-26 03:08:00 +00:00
Tom Lane 11d337185d Fix inappropriate quoting in dblink. From Joe Conway. 2002-11-23 18:59:25 +00:00
Bruce Momjian c464212421 When I made the cube(text) function for 7.3, I neglected to add a
matching create cast command. The attached diff adds a create cast as
assignment to cube.sql.in .

Bruno Wolff III
2002-11-23 03:50:50 +00:00
Bruce Momjian 4987ca2d88 This is a patch to make cube output work like double precision output
with regard to the extra_float_digits setting.

Since builtins.h was already included, I just deleted the extern
statement (and accompaning comments).

 Bruno Wolff III
2002-11-23 03:50:21 +00:00
Tom Lane 1f1c332381 Remove inappropriate double-quoting in connectby() code; adjust
regression test to avoid using VALUE as a name.  From Joe Conway.
2002-11-23 01:54:09 +00:00
Tom Lane 95c9c22633 Fix a dozen or so places that were passing unpredictable data strings
as elog format strings.  Hai-Chen Tu pointed out the problem in
contrib/dbmirror, but it wasn't the only such error.
2002-11-22 16:25:32 +00:00
Bruce Momjian eeec0a6775 Fix elog in dbmirror to use %s.
Hai-Chen Tu
2002-11-22 16:04:41 +00:00
Bruce Momjian 728fa75edc OpenSSL 0.9.6g in Debian/unstable stopped working with pgcrypto. This
is pgcrypto bug as it assumed too much about inner workings of OpenSSL.

Following patch stops pgcrypto using EVP* functions for ciphers and lets
it manage ciphers itself.

This patch supports Blowfish, DES and CAST5 algorithms.

Marko Kreen
2002-11-15 02:54:44 +00:00
Tom Lane 3e8c4c7a73 Improve warning messages from tsearch trigger function; clean up some
casting infelicities.  Allow char(n) fields to be indexed.  Per
Bjoern Metzdorf.
2002-11-14 20:10:00 +00:00
Bruce Momjian 9b12ab6d5d Add new palloc0 call as merge of palloc and MemSet(0). 2002-11-13 00:39:48 +00:00
Bruce Momjian 75fee4535d Back out use of palloc0 in place if palloc/MemSet. Seems constant len
to MemSet is a performance boost.
2002-11-11 03:02:20 +00:00
Bruce Momjian 8fee9615cc Merge palloc()/MemSet(0) calls into a single palloc0() call. 2002-11-10 07:25:14 +00:00
Bruce Momjian a5715eecb6 Clean up format of SQL. 2002-11-08 20:22:12 +00:00
Bruce Momjian 4c1383efd1 The attached patch defines functions for getting distances between
points on the surface of the earth and locating points within a
specified distance using an index based on the contrib/cube package. The
new functions are all of language type sql. A couple of bugs in the old
earthdistance function based on the point datatype are fixed. A
regression test has been added for both sets of functions. The README
file has been updated to include documentation on the new stuff. There
are comments about how this package is also useful for Astronomers.

Bruno Wolff III
2002-11-08 20:20:22 +00:00
Tom Lane df7201c3c5 Remove no-longer-needed inclusions to improve backward compatibility
with older bison versions.
2002-11-07 06:06:17 +00:00
Tom Lane fc9814d17e Remove GPL file pursuant to relicensing. 2002-11-06 22:23:08 +00:00
Bruce Momjian 5a87147173 Change dbmirror lincense to BSD. 2002-11-06 17:50:53 +00:00
Tom Lane 3f435f9e99 Remove extraneous semicolons after routine bodies. These don't bother
gcc, but some other compilers don't like 'em.
2002-11-04 17:14:29 +00:00
Tom Lane bfccacf3f8 Fix dblink regression test so that it works when repeated: don't
create a second database, just loop back to 'regression'.  Patch
from Joe Conway 10/22/02.
2002-11-03 04:52:09 +00:00
Bruce Momjian 08e8c8a574 Use sed rather than perl for reindexdb. 2002-11-03 01:20:06 +00:00
Tom Lane 776d9651e1 Make it possible to run 'make installcheck' in contrib when building
outside the source tree.
2002-11-02 00:16:21 +00:00
Tom Lane 6423a8eef6 Fix contrib/rserv to install successfully when built outside source tree.
(Not that it will actually work with 7.3, I fear.)
2002-11-01 23:45:37 +00:00
Tom Lane c87867f47b Ooops, forgot to fix contrib regression tests for WARNING/NOTICE change. 2002-11-01 23:44:34 +00:00
Tom Lane 97915fcd14 Need -I. to build outside source tree. 2002-11-01 23:23:29 +00:00
Tom Lane e9e919f4ee Fix incorrect subdir value. 2002-11-01 23:16:52 +00:00
Tom Lane cab9437a43 Arrange to compile flex output files as inclusions into other files
(usually bison output files), not as standalone files.  This hack
works around flex's insistence on including <stdio.h> before we are
able to include postgres.h; postgres.h will already be read before
the compiler starts to read the flex output file.  Needed for largefile
support on some platforms.
2002-11-01 22:52:34 +00:00
Tom Lane 1e970dcee8 Ooops, forgot to fix contrib regression tests for WARNING/NOTICE change. 2002-11-01 22:46:04 +00:00
Tom Lane 5936055d46 Avoid use of inline functions that are not declared static. Needed to
conform to C99's brain-dead notion of how inline functions should work.
2002-10-31 19:11:48 +00:00
Tom Lane 3518fbe86f Add missing semicolons to a few PG_FUNCTION_INFO_V1 calls. 2002-10-26 15:01:01 +00:00
Peter Eisentraut 0bd223291f Update build system. 2002-10-22 20:03:09 +00:00
Bruce Momjian b825a8f025 When I removed the cube based stuff from eathdistance I accidentally
left a reference to cube in a comment in the regression test (that also
shows up in the expected output). This doesn't cause any real problem,
but people who read the comment might be confused. Attached is a diff to
remove the reference.

Bruno Wolff III
2002-10-21 20:33:21 +00:00
Peter Eisentraut de9d7f4bd5 Add DLLIMPORT declarations needed by contrib modules. 2002-10-21 18:57:35 +00:00
Peter Eisentraut 0530d7a24b Need sys/param.h for endianness macros. 2002-10-21 18:56:30 +00:00
Peter Eisentraut 6adf38ac8c Might need to link with -lcrypt. 2002-10-21 18:55:10 +00:00
Bruce Momjian e5cf1a8a26 SET autocommit no longer needed in /contrib because pg_regress.sh does
it automatically now on regression session startup.
2002-10-21 01:42:14 +00:00
Bruce Momjian 20d31fd609 Completely remove /contrib/retep, with Peter's approval; now on Source
Forge.
2002-10-21 00:35:41 +00:00
Bruce Momjian 9c7cd8ba15 First step to removing /contrib/retep, with Peter Mount's approval. 2002-10-21 00:12:46 +00:00
Tom Lane 4d1aaedac0 Fix core dump recently introduced into pgbench. 2002-10-20 19:38:10 +00:00
Bruce Momjian 8e6b5c8b27 It includes
-Support for mirroring tables in different Schema's
-Improved documentation for compiling with 7.1.x and 7.2.x
-Fixes a buffer overrun bug.

Steven Singer
2002-10-19 02:16:40 +00:00
Bruce Momjian 5214f09b27 Clean up for dblink autocommit OFF handling. 2002-10-18 19:11:27 +00:00
Bruce Momjian aa4c702eac Update /contrib for "autocommit TO 'on'".
Create objects in public schema.

Make spacing/capitalization consistent.

Remove transaction block use for object creation.

Remove unneeded function GRANTs.
2002-10-18 18:41:22 +00:00
Bruce Momjian 4c59afaee6 This trivial patch fixes a bunch of spelling mistakes in the
contrib/dbmirror/README.dbmirror doc file.

Neil Conway
2002-10-14 04:27:25 +00:00
Bruce Momjian 8031b066fa Update README for oid2name. 2002-10-12 19:15:09 +00:00
Bruce Momjian 0215dc9b0f Well, this patch makes Makefile for contrib/rserv use the
contrib/contrib-global.mk library and _generally_ behave like
   Makefiles for other contrib modules.
   Besides it fixes Perl's interpolation of $libdir variable, which
   should be passed to backend instead. This patch is done against
   PostgreSQL 7.3b2

   Besides, I want to thank Peter Eisentraut for his very friendly and
   helpful attitude and politely ask him to check whether contrib
   modules actually continue to work after he implements another
   major change to their build process.

Alexey Borzov
2002-10-09 16:23:55 +00:00
Tatsuo Ishii 9a2e9c6804 Avoid PQisBusy/PQconsumeInput busy loop in case of PQisBusy returning
false. per Tom Lane's suggestion. See:

Subject: Suggested change to pgbench
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tatsuo Ishii <t-ishii@sra.co.jp>
Cc: pgsql-patches@postgreSQL.org
Date: Sun, 06 Oct 2002 12:37:27 -0400

for more details.
2002-10-07 05:10:02 +00:00
Tom Lane 9886a46e76 Restore NOTICEs that were mistakenly removed from triggers regression
test expected output.  Tweak contrib/spi Makefile so that refint.so is
by default built with appropriate NOTICE support for regression testing.
2002-10-03 18:40:02 +00:00
Bruce Momjian 0a85eea07e It's just a cosmetic change, fixes the help screen. Should be applied in
/contrib/vacuumlo

Mario Weilguni
2002-10-03 17:20:39 +00:00
Bruce Momjian e654065f11 This is small README fix for contrib/intarray. Thank you.
Teodor Sigaev
2002-10-03 17:16:31 +00:00
Bruce Momjian a62873d279 The attached adds a bit to the contrib/tablefunc regression test for
behavior of connectby() in the presence of infinite recursion. Please
apply this one in addition to the one sent earlier.

Joe Conway
2002-10-03 17:15:36 +00:00
Bruce Momjian 620dddf88a > The previous patch fixed an infinite recursion bug in
> contrib/tablefunc/tablefunc.c:connectby. But, other unmanageable error
> seems to occur even if a table has commonplace tree data(see below).
>
> I would think the patch, ancestor check, should be
>
>   if (strstr(branch_delim || branchstr->data || branch_delim,
>                        branch_delim || current_key || branch_delim))
>
> This is my image, not a real code. However, if branchstr->data includes
> branch_delim, my image will not be perfect.

Good point. Thank you Masaru for the suggested fix.

Attached is a patch to fix the bug found by Masaru. His example now
produces:

regression=# SELECT * FROM connectby('connectby_tree', 'keyid',
'parent_keyid', '11', 0, '-') AS t(keyid int, parent_keyid int, level
int,
branch text);
  keyid | parent_keyid | level |  branch

-------+--------------+-------+----------
     11 |              |     0 | 11
     10 |           11 |     1 | 11-10
    111 |           11 |     1 | 11-111
      1 |          111 |     2 | 11-111-1
(4 rows)

While making the patch I also realized that the "no show branch" form of
the  function was not going to work very well for recursion detection.
Therefore  there is now a default branch delimiter ('~') that is used
internally, for  that case, to enable recursion detection to work. If
you need a different  delimiter for your specific data, you will have to
use the "show branch" form  of the function.

Joe Conway
2002-10-03 17:11:12 +00:00
Bruce Momjian 603f601269 Attached is a patch to contrib/dbmirror that fixes a bug that was
causing  the postmaster to crash when the trigger was running on a table
without a  primary key.

I've also updated the docs to explicitly say that tables need primary
keys.

Steven Singer
2002-09-26 05:24:30 +00:00
Tom Lane 691aefcf42 Shouldn't be here ... 2002-09-25 14:27:16 +00:00
Bruce Momjian df88a3cfc5 Install proper earthdistance file, regression passes. 2002-09-25 13:04:48 +00:00
Bruce Momjian 65bf5a39e0 Add missing earthdistance regression test files. 2002-09-25 03:46:04 +00:00
Bruce Momjian 87eb561c88 Add earthdistance regression file. 2002-09-24 20:09:33 +00:00
Tom Lane c99f820053 Tweak dblink functions to use int4 arguments instead of int2,
to avoid having to write explicit casts.  From Joe Conway.
2002-09-23 18:03:32 +00:00
Tom Lane c5a09067d8 Remove extraneous | ... while bison 1.28 doesn't object, newer versions
do.
2002-09-22 21:51:18 +00:00
Tom Lane fce573ae16 I haven't seen any objections, so here is a patch. It removes "#define
YYERROR_VERBOSE" from contrib/cube and contrib/seg, and adjusts the expected
output accordingly. Hopefully this will consistently pass across multiple
bison versions.

Joe Conway
2002-09-22 20:08:51 +00:00
Bruce Momjian ec63143f81 Tiny patch fixing small documentation typo.
Oleg Bartunov
2002-09-20 03:54:21 +00:00
Bruce Momjian 24bebf0b72 I have included fixes to declare some floating point constants as double
instead of int, change the calculation method to use the haversine
formula
which is more accurrate for short distances, added a grant to public for
geo_distance and added a regression test.

I will resubmit the earth distance stuff based on cube after 7.3 is
released.

Bruno Wolff III
2002-09-20 03:47:22 +00:00
Bruce Momjian 1336ecb332 This grants execute privileges to public for the fti() function. Should
we go through and give all the contribs grants?

Christopher Kings-Lynne
2002-09-20 03:42:39 +00:00
Bruce Momjian 9152bebfe4 Add 'adddepend' script to handle pre-7.3 object dependencies. 2002-09-18 20:38:59 +00:00
Tatsuo Ishii 6bea242750 Add GRANT EXECUTE ON FUNCTION 2002-09-18 06:38:29 +00:00
Tom Lane cd7a3b6c0d Simplify handling of second database for dblink tests. 2002-09-14 22:00:59 +00:00
Tom Lane b66ba36be9 Clean up mess from duplicate patches. 2002-09-14 21:32:38 +00:00
Tom Lane d724c314da The attached adds GRANTs to PUBLIC for dblink functions, removes the
non-standard regression test, and adds standard installcheck regression test
support.

The test creates a second database (regression_slave) and drops it again, in
order to avoid the cheesy-ness of connecting back to the same database ;-)

Joe Conway
2002-09-14 20:28:54 +00:00
Tom Lane c0edc53a36 The attached adds GRANTs to PUBLIC for contrib/fuzzystringmatch.
Joe Conway
2002-09-14 19:56:01 +00:00
Tom Lane bd04184b11 Attached is a patch to fix some recently raised issues that exist in
contrib/tablefunc. Specifically it replaces the use of VIEWs (for needed
composite type creation) with use of CREATE TYPE. It also performs GRANT
EXECUTE ON FUNCTION foo() TO PUBLIC for all of the created functions. There
was also a cosmetic change to two regression files.

Joe Conway
2002-09-14 19:53:59 +00:00
Tom Lane d3ebc1ae4a Fix portability bug in get_normal_pair (RAND_MAX != MAX_RANDOM_VALUE).
Also try to improve readability and performance.
2002-09-14 19:32:54 +00:00
Bruce Momjian e57ab04565 This is a comprehensive set of diffs (versus current CVS) that replaces those
attached to the same message with the Earth Distance patches.
Recent changes include changing the subscript in one place I forgot
in the previous bugfix patch. A couple of added regression tests, which
should help catch this mistake if it reappears.
I also put in a limit of 100 dimensions in cube_large and cube_in to
prevent making it easy to create very large cubes. Changing one define
in cubedata.h will raise the limit if some needs more dimensions.

Bruno Wolff III
2002-09-12 00:26:00 +00:00
Bruce Momjian eb5bf51372 > intarray and ltree both seem to be mapping their own declarations onto
> arrays using largely-similar code.  But while intarray fails its
> regression test, I find ltree still passes.  So I'm confused about what
> that code is really doing and don't want to touch it.

Please, apply attached patch, it solves the problem.

Teodor Sigaev
2002-09-12 00:24:46 +00:00
Bruce Momjian f490dbe594 > Now I'm testing connectby() in the /contrib/tablefunc in 7.3b1, which would
> be a useful function for many users.   However, I found the fact that
> if connectby_tree has the following data, connectby() tries to search the end
> of roots without knowing that the relations are infinite(-5-9-10-11-9-10-11-)
.
> I hope connectby() supports a check routine to find infinite relations.
>
>
> CREATE TABLE connectby_tree(keyid int, parent_keyid int);
> INSERT INTO connectby_tree VALUES(1,NULL);
> INSERT INTO connectby_tree VALUES(2,1);
> INSERT INTO connectby_tree VALUES(3,1);
> INSERT INTO connectby_tree VALUES(4,2);
> INSERT INTO connectby_tree VALUES(5,2);
> INSERT INTO connectby_tree VALUES(6,4);
> INSERT INTO connectby_tree VALUES(7,3);
> INSERT INTO connectby_tree VALUES(8,6);
> INSERT INTO connectby_tree VALUES(9,5);
>
> INSERT INTO connectby_tree VALUES(10,9);
> INSERT INTO connectby_tree VALUES(11,10);
> INSERT INTO connectby_tree VALUES(9,11);    <-- infinite
>

The attached patch fixes the infinite recursion bug in
contrib/tablefunc/tablefunc.c:connectby found by Masaru Sugawara.

test=# SELECT * FROM connectby('connectby_tree', 'keyid',
'parent_keyid', '2', 4, '~') AS t(keyid int, parent_keyid int, level
int, branch text);
  keyid | parent_keyid | level |   branch
-------+--------------+-------+-------------
      2 |              |     0 | 2
      4 |            2 |     1 | 2~4
      6 |            4 |     2 | 2~4~6
      8 |            6 |     3 | 2~4~6~8
      5 |            2 |     1 | 2~5
      9 |            5 |     2 | 2~5~9
     10 |            9 |     3 | 2~5~9~10
     11 |           10 |     4 | 2~5~9~10~11
(8 rows)

test=# SELECT * FROM connectby('connectby_tree', 'keyid',
'parent_keyid', '2', 5, '~') AS t(keyid int, parent_keyid int, level
int, branch text);
ERROR:  infinite recursion detected

I implemented it by checking the branch string for repeated keys
(whether or not the branch is returned). The performance hit was pretty
minimal -- about 1% for a moderately complex test case (220000 record
table, 9 level tree with 3800 members).

Joe Conway
2002-09-12 00:19:44 +00:00
Bruce Momjian 5dd74c0f21 The attached small patch fixes the cause of the regression test failure
for contrib/intarray.

The cause was that the library uses its own function to construct a new
array, new_intArrayType, and that function did not set the new array
struct attribute elemtype.

Joe Conway
2002-09-12 00:15:33 +00:00
Bruce Momjian 6fff9a7475 The attached removes the current non-standard file
"contrib/tablefunc/tablefunc-test.sql", and adds a standard regression
test suite to contrib/tablefunc.

Joe Conway
2002-09-12 00:14:40 +00:00
Tom Lane 497baca6b5 Fix compile warning. 2002-09-05 21:19:13 +00:00
Tom Lane 8d7904f526 Fix bit-rotted reference to GetUserName() ...
it's GetUserNameFromId() now.
2002-09-05 21:13:03 +00:00
Tom Lane bed4f65499 Fix breakage introduced by careless snprintf patching. 2002-09-05 21:09:54 +00:00
Tom Lane fb473bc6fa Fix unsafe macro definitions (which were producing incorrect code,
leading to compile warnings).
2002-09-05 21:08:26 +00:00
Tom Lane da2e0ddeb4 Remove compile warnings, ensure consistent build environment for
largefile usage.
2002-09-05 21:01:16 +00:00
Tom Lane f2a242f988 Fix compile warning. 2002-09-05 20:57:00 +00:00
Tom Lane fcbe62ee51 findoidjoins and tsearch are not broken anymore. 2002-09-05 20:53:45 +00:00
Tom Lane 5d1c8a3b07 Fix compile errors. 2002-09-05 20:51:39 +00:00
Tom Lane d7e654ff79 findoidjoins is updated for schemas, does not use libpgeasy.
From Joe Conway.
2002-09-05 19:57:32 +00:00
Peter Eisentraut 012288d565 Commenting out doesn't work, so move the broken modules out of the list. 2002-09-05 18:40:33 +00:00
Peter Eisentraut 337da0678a Assorted fixes for Cygwin:
Eliminate the mysterious games that the Cygwin build plays with the linker
flag variables.  DLLLIBS is gone, use SHLIB_LINK like everyone else.
Detect cygipc in configure, after the linker flags are set up, otherwise
configure might not work at all.

Make sure everything is covered by make clean.

Fix the build of the new conversion procedure modules.

Add new DLLIMPORT markers where required.

Finally, the compiler complains if we use an explicit
-I/usr/local/include, so don't do that.  Curiously, -L/usr/local/lib is
still necessary.
2002-09-05 18:28:46 +00:00
Tom Lane edc71eced0 Remove include of libpq-int.h --- dblink.c should not be (and was not)
depending on libpq internals.
2002-09-05 00:56:35 +00:00
Tom Lane 52c9d25933 Be careful to include postgres.h *before* any system headers, to ensure
that the right flavors of largefile-related definitions are seen.
Most of these changes are probably unnecessary, but better safe than
sorry.
2002-09-05 00:43:07 +00:00
Peter Eisentraut be475f92cd Fix compile warning. 2002-09-04 22:51:23 +00:00
Peter Eisentraut f9b7ba2871 Disable findoidjoins while it doesn't compile. 2002-09-04 22:50:43 +00:00
Bruce Momjian e50f52a074 pgindent run. 2002-09-04 20:31:48 +00:00
Tatsuo Ishii 5e3a28f4de Refrect changes made by Tom Lane 2002-09-04 02:54:59 +00:00
Peter Eisentraut 77f7763b55 Remove all traces of multibyte and locale options. Clean up comments
referring to "multibyte" where it really means character encoding.
2002-09-03 21:45:44 +00:00
Tom Lane e167510a4f Clean out cruft left by nonstandard test procedure. 2002-09-03 04:01:05 +00:00
Tom Lane 74cbe50439 last-minute CreateTemplateTupleDesc fixes. 2002-09-03 04:00:37 +00:00
Bruce Momjian a02780ffd0 Add missing dblink files. 2002-09-02 06:32:41 +00:00