Commit Graph

673 Commits

Author SHA1 Message Date
Tom Lane 3fb6f1347f Replace cryptic 'Unknown kind of return type' messages with something
hopefully a little more useful.
2003-06-15 17:59:10 +00:00
Bruce Momjian a647e30ba3 New patch with corrected README attached.
Also quickly added mention that it may be a qualified schema name.

Rod Taylor
2003-06-12 08:02:57 +00:00
Bruce Momjian 310c084921 Add Linux restart --- Slawomir Sudnik
Add "-l $PGLOG" for restart --- Darko Prenosil
2003-06-12 02:02:24 +00:00
Bruce Momjian 9243664dd4 This patch updates pg_autovacuum in several ways:
* A few bug fixes
* fixes solaris compile and crash issue
* decouple vacuum analyze and analyze thresholds
* detach from tty (dameonize)
* improved logging layout
* more conservative default configuration
* improved, expanded and updated README

please apply and 1st convenience, or before code freeze which ever comes
first :-)

At this point I think I have brought pg_autovacuum and its client side
design as far as I think it should go.  It works, keeping file sizes in
check, helps performance and give the administrator a fair amount
flexibility in configuring it.

Next up is to do the FSM based design that is integrated into the back
end.

p.s. Thanks to Christopher Browne for his help.

Matthew T. O'Connor
2003-06-12 01:36:44 +00:00
Tom Lane 6a276b7bfd Update expected file to match new _int.sql. 2003-06-11 19:43:36 +00:00
Bruce Momjian a237dd2b30 Add missing intarray files. 2003-06-11 19:31:05 +00:00
Bruce Momjian 47d5c3d5e7 Changes:
1 intarray: bugfix for int[]-int[] operation
2 intarray: split _int.c to several files (_int.c now is unused)
3 ntarray (gist__intbig_ops opclass): use special type for index storage
4 ltree (gist__ltree_ops opclass), intarray (gist__intbig_ops): optimize
GiST's
penalty and picksplit interface functions, now use Hemming distance.

Teodor Sigaev
2003-06-11 18:44:15 +00:00
Tom Lane bd48e09f2a Remove platform-specific executable; does not belong in distribution. 2003-06-11 14:02:57 +00:00
Tatsuo Ishii 412893b416 Fix uninitialized memory bug
Add support for PGHOST, PGPORT, PGUSER environment variables
2003-06-10 09:07:15 +00:00
Tom Lane 5666462f2e Ensure that in all flex lexers that are part of the backend, a
yy_fatal_error() call results in elog(ERROR) not exit().  This was
already fixed in the main lexer and plpgsql, but extend same technique
to all the other dot-l files.  Also, on review of the possible calls
to yy_fatal_error(), it seems safe to use elog(ERROR) not elog(FATAL).
2003-05-29 22:30:02 +00:00
Tom Lane fc8d970cbc Replace functional-index facility with expressional indexes. Any column
of an index can now be a computed expression instead of a simple variable.
Restrictions on expressions are the same as for predicates (only immutable
functions, no sub-selects).  This fixes problems recently introduced with
inlining SQL functions, because the inlining transformation is applied to
both expression trees so the planner can still match them up.  Along the
way, improve efficiency of handling index predicates (both predicates and
index expressions are now cached by the relcache) and fix 7.3 oversight
that didn't record dependencies of predicate expressions.
2003-05-28 16:04:02 +00:00
Bruce Momjian 98b6f37e47 Make debug_ GUC varables output DEBUG1 rather than LOG, and mention in
docs that CLIENT/LOG_MIN_MESSAGES now controls debug_* output location.
Doc changes included.
2003-05-27 17:49:47 +00:00
Tom Lane f45df8c014 Cause CHAR(n) to TEXT or VARCHAR conversion to automatically strip trailing
blanks, in hopes of reducing the surprise factor for newbies.  Remove
redundant operators for VARCHAR (it depends wholly on TEXT operations now).
Clean up resolution of ambiguous operators/functions to avoid surprising
choices for domains: domains are treated as equivalent to their base types
and binary-coercibility is no longer considered a preference item when
choosing among multiple operators/functions.  IsBinaryCoercible now correctly
reflects the notion that you need *only* relabel the type to get from type
A to type B: that is, a domain is binary-coercible to its base type, but
not vice versa.  Various marginal cleanup, including merging the essentially
duplicate resolution code in parse_func.c and parse_oper.c.  Improve opr_sanity
regression test to understand about binary compatibility (using pg_cast),
and fix a couple of small errors in the catalogs revealed thereby.
Restructure "special operator" handling to fetch operators via index opclasses
rather than hardwiring assumptions about names (cleans up the pattern_ops
stuff a little).
2003-05-26 00:11:29 +00:00
Tom Lane bf45bff004 Repair quoting sloppiness, lack of schema awareness in reindexdb. 2003-05-19 01:00:12 +00:00
Tom Lane 86f5fcfeb7 Fix failure when uniq-ifying an array of zero elements.
Teodor Sigaev
2003-05-16 18:49:51 +00:00
Tom Lane bcfeca5856 Check calling context for connectby_text(), per Joe Conway. 2003-05-16 06:07:51 +00:00
Tom Lane 78b08584b4 Fix various recent build and regression-test problems in contrib/.
Includes fixes from Joe Conway.
2003-05-14 03:27:22 +00:00
Tom Lane f85f43dfb5 Backend support for autocommit removed, per recent discussions. The
only remnant of this failed experiment is that the server will take
SET AUTOCOMMIT TO ON.  Still TODO: provide some client-side autocommit
logic in libpq.
2003-05-14 03:26:03 +00:00
Tom Lane de28dc9a04 Portal and memory management infrastructure for extended query protocol.
Both plannable queries and utility commands are now always executed
within Portals, which have been revamped so that they can handle the
load (they used to be good only for single SELECT queries).  Restructure
code to push command-completion-tag selection logic out of postgres.c,
so that it won't have to be duplicated between simple and extended queries.
initdb forced due to addition of a field to Query nodes.
2003-05-02 20:54:36 +00:00
Bruce Momjian baf6c8d21d Please, apply patch for contrib/ltree to current CVS and 7.3.2
CHANGES

Mar 28, 2003
    Added finctions index(ltree,ltree,offset), text2ltree(text),
                    ltree2text(text)

Teodor Sigaev
2003-03-31 20:53:45 +00:00
Tom Lane bb3c00ee28 Regression output didn't get updated to match recent commit. 2003-03-28 17:24:28 +00:00
Bruce Momjian 54f7338fa1 This patch implements holdable cursors, following the proposal
(materialization into a tuple store) discussed on pgsql-hackers earlier.
I've updated the documentation and the regression tests.

Notes on the implementation:

- I needed to change the tuple store API slightly -- it assumes that it
won't be used to hold data across transaction boundaries, so the temp
files that it uses for on-disk storage are automatically reclaimed at
end-of-transaction. I added a flag to tuplestore_begin_heap() to control
this behavior. Is changing the tuple store API in this fashion OK?

- in order to store executor results in a tuple store, I added a new
CommandDest. This works well for the most part, with one exception: the
current DestFunction API doesn't provide enough information to allow the
Executor to store results into an arbitrary tuple store (where the
particular tuple store to use is chosen by the call site of
ExecutorRun). To workaround this, I've temporarily hacked up a solution
that works, but is not ideal: since the receiveTuple DestFunction is
passed the portal name, we can use that to lookup the Portal data
structure for the cursor and then use that to get at the tuple store the
Portal is using. This unnecessarily ties the Portal code with the
tupleReceiver code, but it works...

The proper fix for this is probably to change the DestFunction API --
Tom suggested passing the full QueryDesc to the receiveTuple function.
In that case, callers of ExecutorRun could "subclass" QueryDesc to add
any additional fields that their particular CommandDest needed to get
access to. This approach would work, but I'd like to think about it for
a little bit longer before deciding which route to go. In the mean time,
the code works fine, so I don't think a fix is urgent.

- (semi-related) I added a NO SCROLL keyword to DECLARE CURSOR, and
adjusted the behavior of SCROLL in accordance with the discussion on
-hackers.

- (unrelated) Cleaned up some SGML markup in sql.sgml, copy.sgml

Neil Conway
2003-03-27 16:51:29 +00:00
Bruce Momjian cb1672e9f8 Rename README in autovacuum code to match Makefile. 2003-03-23 20:16:06 +00:00
Bruce Momjian e0d043b94d please apply attached patch to current CVS.
btree_gist now supports int2 !
Thanks Janko Richter for contribution.
2003-03-20 18:59:18 +00:00
Bruce Momjian bd18c50ba8 I have updated my pg_autovacuum program (formerly pg_avd, the name
changed as per discussion on the patches list).

This version should be a good bit better.  It addresses all the issues
pointed out by Neil Conway. Vacuum and Analyze are now handled
separately.  It now monitors for xid wraparound.  The number of database
connections and queries has been significantly reduced compared the
previous version.  I have moved it from bin to contrib.  More detail on
the changes are in the TODO file.

I have not tested the xid wraparound code as I have to let my AthlonXP
1600 run select 1 in a tight loop for approx. two days in order to
perform the required 500,000,000 xacts.

Matthew T. O'Connor
2003-03-20 18:14:46 +00:00
Bruce Momjian 64d0b8b05f Attached is an update to contrib/tablefunc. It implements a new hashed
version of crosstab. This fixes a major deficiency in real-world use of
the original version. Easiest to undestand with an illustration:

Data:
-------------------------------------------------------------------
select * from cth;
  id | rowid |        rowdt        |   attribute    |      val
----+-------+---------------------+----------------+---------------
   1 | test1 | 2003-03-01 00:00:00 | temperature    | 42
   2 | test1 | 2003-03-01 00:00:00 | test_result    | PASS
   3 | test1 | 2003-03-01 00:00:00 | volts          | 2.6987
   4 | test2 | 2003-03-02 00:00:00 | temperature    | 53
   5 | test2 | 2003-03-02 00:00:00 | test_result    | FAIL
   6 | test2 | 2003-03-02 00:00:00 | test_startdate | 01 March 2003
   7 | test2 | 2003-03-02 00:00:00 | volts          | 3.1234
(7 rows)

Original crosstab:
-------------------------------------------------------------------
SELECT * FROM crosstab(
   'SELECT rowid, attribute, val FROM cth ORDER BY 1,2',4)
AS c(rowid text, temperature text, test_result text, test_startdate
text, volts text);
  rowid | temperature | test_result | test_startdate | volts
-------+-------------+-------------+----------------+--------
  test1 | 42          | PASS        | 2.6987         |
  test2 | 53          | FAIL        | 01 March 2003  | 3.1234
(2 rows)

Hashed crosstab:
-------------------------------------------------------------------
SELECT * FROM crosstab(
   'SELECT rowid, attribute, val FROM cth ORDER BY 1',
   'SELECT DISTINCT attribute FROM cth ORDER BY 1')
AS c(rowid text, temperature int4, test_result text, test_startdate
timestamp, volts float8);
  rowid | temperature | test_result |   test_startdate    | volts
-------+-------------+-------------+---------------------+--------
  test1 |          42 | PASS        |                     | 2.6987
  test2 |          53 | FAIL        | 2003-03-01 00:00:00 | 3.1234
(2 rows)

Notice that the original crosstab slides data over to the left in the
result tuple when it encounters missing data. In order to work around
this you have to be make your source sql do all sorts of contortions
(cartesian join of distinct rowid with distinct attribute; left join
that back to the real source data). The new version avoids this by
building a hash table using a second distinct attribute query.

The new version also allows for "extra" columns (see the README) and
allows the result columns to be coerced into differing datatypes if they
are suitable (as shown above).

In testing a "real-world" data set (69 distinct rowid's, 27 distinct
categories/attributes, multiple missing data points) I saw about a
5-fold improvement in execution time (from about 2200 ms old, to 440 ms
new).

I left the original version intact because: 1) BC, 2) it is probably
slightly faster if you know that you have no missing attributes.

README and regression test adjustments included. If there are no
objections, please apply.

Joe Conway
2003-03-20 06:46:30 +00:00
Bruce Momjian ee303739d3 Just some fixups to a couple contrib directories I was trying out.
. replace CREATE OR REPLACE AGGREGATE with a separate DROP and CREATE
. add DROP for all CREATE OPERATORs
. use IMMUTABLE and STRICT instead of WITH (isStrict)
. add IMMUTABLE and STRICT to int_array_aggregate's accumulator function

Gregory Stark
2003-03-20 04:39:27 +00:00
Bruce Momjian 900fa3d0f5 The attatched patch fixes a memory error with contrib/dbmirror/pending.c
when running it with older(Pre 7.3.x) versions of Postgresql.

Backpatched to 7.3.X.

Steven Singer
2003-03-20 03:58:13 +00:00
Tom Lane e4704001ea This patch fixes a bunch of spelling mistakes in comments throughout the
PostgreSQL source code.

Neil Conway
2003-03-10 22:28:22 +00:00
Tom Lane aa60eecc37 Revise tuplestore and nodeMaterial so that we don't have to read the
entire contents of the subplan into the tuplestore before we can return
any tuples.  Instead, the tuplestore holds what we've already read, and
we fetch additional rows from the subplan as needed.  Random access to
the previously-read rows works with the tuplestore, and doesn't affect
the state of the partially-read subplan.  This is a step towards fixing
the problems with cursors over complex queries --- we don't want to
stick in Materialize nodes if they'll prevent quick startup for a cursor.
2003-03-09 02:19:13 +00:00
Bruce Momjian 71e1f531d3 Please apply patches for contrib/ltree.
ltree_73.patch.gz - for 7.3 :
        Fix ~ operation bug: eg '1.1.1' ~ '*.1'

ltree_74.patch.gz - for current CVS
    Fix ~ operation bug: eg '1.1.1' ~ '*.1'
    Add ? operation
    Optimize index storage

Last change needs drop/create all ltree indexes, so only for 7.4

Teodor Sigaev
2003-02-19 03:50:09 +00:00
Bruce Momjian 4efbbd7318 We just released new version of contrib/btree_gist
(7.3 and current CVS) with support of int8, float4, float8
in addition to int4. Thanks Janko Richter for contribution.

Oleg Bartunov
2003-02-19 03:46:00 +00:00
Bruce Momjian 9ccaaf676f The attached patches change earthdistance to use the new cube functions
in one of the earth functions so that latitude and longitude to
cartesian coordinates conversion will be more accurrate. (Previously
a text string was built to provide as input which limited the accuracy
to the number of digits printed.)

The new functions were included in a recent patch to contrib/cube that has not
as yet been accepted as of yet.

I also added check constraints to the domain 'earth' since they are now
working in 7.4.

Bruno Wolff III
2003-02-13 05:31:06 +00:00
Bruce Momjian 80b3513d57 The attached patch provides cube with 4 functions for building cubes
directly from float8 values. (As opposed to converting the values to
strings
and then parsing the strings.)
The functions are:
cube(float8) returns cube
cube(float8,float8) returns cube
cube(cube,float8) returns cube
cube(cube,float8,float8) returns cube

Bruno Wolff III
2003-02-13 05:26:50 +00:00
Tom Lane 9d00798720 Tweak bison build rules so that we get the same error messages from
bison 1.875 and later as we did from earlier bison releases.  Eventually
we will probably want to adopt the newer message spelling ... but not yet.
Per recent discussion on pgpatches.
Note: I didn't change the build rules for bootstrap, ecpg, or plpgsql
grammars, since these do not affect regression test results.
2003-01-31 20:58:00 +00:00
Bruce Momjian d14c64c4a3 This patch fixes an incorrect statement and makes a few cleanups to
contrib/fulltextindex/README.fti

Backpatched to 7.3.X too.

Neil Conway
2003-01-15 16:45:17 +00:00
Tom Lane 59779c81ba Add missing #include <getopt.h>. 2003-01-09 18:27:39 +00:00
Tom Lane 2e98da5246 Call timestamp_in with proper arguments, per gripe from Mark Halliwell. 2003-01-09 07:10:07 +00:00
Bruce Momjian 3e40ff58c5 Upgrade to my2pg 1.9 2003-01-07 22:18:43 +00:00
Bruce Momjian a24104eb5e Upgrade to even newer ora2pg 2.0. 2003-01-07 22:17:14 +00:00
Bruce Momjian ffab4fdf24 Upgrade to ora2pg 1.10. Backpatch to 7.3.X. 2003-01-07 22:15:56 +00:00
Tom Lane 30a800a0e9 Update for new we-always-have-getopt_long approach. 2003-01-07 21:42:38 +00:00
Hiroshi Inoue 9ab7ab5196 Add casts between lo and oid. 2002-12-31 10:22:03 +00:00
Bruce Momjian 1868b0be44 Small fix in documentation and some examples of usage. Please, apply to
7.3 and current CVS

Oleg Bartunov
2002-12-27 14:10:29 +00:00
Tom Lane 3a4f7dde16 Phase 3 of read-only-plans project: ExecInitExpr now builds expression
execution state trees, and ExecEvalExpr takes an expression state tree
not an expression plan tree.  The plan tree is now read-only as far as
the executor is concerned.  Next step is to begin actually exploiting
this property.
2002-12-13 19:46:01 +00:00
Bruce Momjian 8358302ded This patch fixes minor bugs in dictionary generator in contrib/tsearch
(contrib/tsearch/makedict/makedict.pl)

[ Backpatched to 7.3.]

Teodor Sigaev
2002-12-13 05:50:18 +00:00
Bruce Momjian bc6625970c Following patch avoids removing oids in the temporary table from the
temporary table.

Kenji Sugita
2002-12-10 01:57:16 +00:00
Bruce Momjian b842726fc7 I've simplified the Darwin/Mac OS X startup script I submitted earlier
in the year. This version has only the two files required by the Darwin
startup bundle design. Plus the sh script now uses Darwin-standard
functions to start up PostgreSQL, and it checks for the presence of a
variable in /etc/hostconfig, as do other Darwin startup scripts.

I suggest that a new directory be created,
contrib/start-scripts/darwin, and that these two files be put into it.
Folks who want to use the script can read the comments inside it to
figure out how to use it.

David Wheeler
2002-12-09 21:26:09 +00:00
Bruce Momjian a2bd3e2085 Thank you very much, you catch it :). This bug had a long life, because it
exists if and only if locale of postmaster
was a different from C (or ru_RU.KOI8-R).

Please, apply patch for current CVS & 7.3.1

Magnus Naeslund(f) wrote:
> Ok, I nailed the bug, but i'm not sure what the correct fix is.
> Attached tsearch_morph.diff that remedies this problem by avoiding it.
> Also there's a debug aid patch if someone would like to know how i
> finally found it out :)
>
> There problem in the lemmatize() function is that GETDICT(...) returned
> a value not handled (BYLOCALE).
> The value (-1) and later used as an index into the dicts[] array.
> After that everything went berserk stack went crazy somehow so trapping
> the fault sent me to the wrong place, and every time i read the value it
> was positive ;)
>
> So now i just return the initial word passed to the lemmatize function,
> because i don't know what to do with it.

Magnus Naeslund
2002-12-06 05:15:02 +00:00
Bruce Momjian 87cba401a4 Some time ago John Gray <jgray@azuli.co.uk> and myself worked out and
tested a patch to contrib/xml where the existing code was causing
postgres to crash when it encountered & entities in the XML. I've
enclosed a patch that John came up with to correct this problem. It
patches against 7.3 and will apply on 7.2x if the elog WARNING calls
are changed to elog NOTICE.

Michael Richards
2002-12-06 03:44:14 +00:00