Commit Graph

10447 Commits

Author SHA1 Message Date
Bruce Momjian 15b95cf872 Allow SSL to work withouth client-side certificate infrastructure. 2002-09-26 04:41:55 +00:00
Tom Lane 8a6fab412e Remove ShutdownBufferPoolAccess exit callback, and do the work in
ProcKill instead, where we still have a PGPROC with which to wait on
LWLocks.  This fixes 'can't wait without a PROC structure' failures
occasionally seen during backend shutdown (I'm surprised they weren't
more frequent, actually).  Add an Assert() to LWLockAcquire to help
catch any similar mistakes in future.  Fix failure to update MyProcPid
for standalone backends and pgstat processes.
2002-09-25 20:31:40 +00:00
Barry Lind 7bf1c8b0ad Applied patch from Aaron Mulder (ammulder@alumni.princeton.edu) that fixes
jdbc datasource support for jdk1.4/jdbc3

 Modified Files:
 	jdbc/build.xml jdbc/org/postgresql/Driver.java.in
 	jdbc/org/postgresql/jdbc2/optional/BaseDataSource.java
 	jdbc/org/postgresql/jdbc2/optional/PGObjectFactory.java
 	jdbc/org/postgresql/jdbc2/optional/PooledConnectionImpl.java
 	jdbc/org/postgresql/jdbc2/optional/PoolingDataSource.java
 	jdbc/org/postgresql/test/jdbc2/optional/BaseDataSourceTest.java
 	jdbc/org/postgresql/test/jdbc2/optional/OptionalTestSuite.java
 	jdbc/org/postgresql/test/jdbc3/Jdbc3TestSuite.java
 Added Files:
 	jdbc/org/postgresql/jdbc3/Jdbc3ConnectionPool.java
 	jdbc/org/postgresql/jdbc3/Jdbc3ObjectFactory.java
 	jdbc/org/postgresql/jdbc3/Jdbc3PooledConnection.java
 	jdbc/org/postgresql/jdbc3/Jdbc3PoolingDataSource.java
 	jdbc/org/postgresql/jdbc3/Jdbc3SimpleDataSource.java
 	jdbc/org/postgresql/test/jdbc2/optional/PoolingDataSourceTest.java
 	jdbc/org/postgresql/test/jdbc3/Jdbc3ConnectionPoolTest.java
 	jdbc/org/postgresql/test/jdbc3/Jdbc3PoolingDataSourceTest.java
 	jdbc/org/postgresql/test/jdbc3/Jdbc3SimpleDataSourceTest.java
 	jdbc/org/postgresql/test/util/MiniJndiContext.java
 	jdbc/org/postgresql/test/util/MiniJndiContextFactory.java
2002-09-25 07:01:31 +00:00
Tom Lane c6367df506 Change default privileges for languages and functions to be PUBLIC USAGE
and PUBLIC EXECUTE, respectively.  Per discussion about easing updates
from prior versions.
2002-09-24 23:14:25 +00:00
Tom Lane e92bec2844 Update some obsolete comments and column descriptions. 2002-09-24 21:26:44 +00:00
Peter Eisentraut 12bb3679db Remove useless O_DIROPEN stuff. 2002-09-24 20:20:10 +00:00
Peter Eisentraut 8c3ab663ab Tweak conversion names to follow the established naming scheme, and
document that scheme.
2002-09-24 20:14:59 +00:00
Tom Lane 83fd58dff0 Add missing correction of sublevelsup when pulling up a subquery.
Fixes problem with cases like
SELECT * FROM foo t WHERE NOT EXISTS (SELECT remoteid FROM
(SELECT f1 as remoteid FROM foo WHERE f1 = t.f1) AS t1)
2002-09-24 18:38:23 +00:00
Tom Lane 233ecca7c9 Further thinking about heap_mark4update: in HeapTupleSelfUpdated case,
executor should not return the tuple as successfully marked, because in
fact it's been deleted.  Not clear that this case has ever been seen
in practice (I think you'd have to write a SELECT FOR UPDATE that calls
a function that deletes some row the SELECT will visit later...) but we
should be consistent.  Also add comments to several other places that
got it right but didn't explain what they were doing.
2002-09-23 22:57:44 +00:00
Peter Eisentraut 0d3be98ae9 Move PyGreSQL usage documentation from README into DocBook. Some other
editing.
2002-09-23 21:10:13 +00:00
Tom Lane 5fa3418304 Disallow VACUUM, ANALYZE, TRUNCATE on temp tables belonging to other
backends.  Given that temp tables now store data locally in the local
buffer manager, these things are not going to work safely.
2002-09-23 20:43:41 +00:00
Bruce Momjian f9a1ea6fa7 Obviously noone has ever tested the doubling of availiable result ids
up to
reaching the hard limit. After opening 16(=current REST_START value)
results via pg_exec, the next pg_exec tries to find an empty slot
forever :-( . In PgSetResultId file pgtclId.c in the for loop there
has to be done a break, if res_max ist reached. The piece of code
should look like
        if (resid == connid->res_max)
        {
            resid = 0;
            break;   /* the break as to be added */
        }

now everything works (double available results after reaching
RES_START up to reaching RES_HARD_MAX)

Gerhard Hintermayer
2002-09-23 01:43:23 +00:00
Tom Lane bc1088c28a Get rid of bogus use of heap_mark4update in reindex operations (cf.
recent bug report).  Fix processing of nailed-in-cache indexes;
it appears that REINDEX DATABASE has been broken for months :-(.
2002-09-23 00:42:48 +00:00
Tom Lane df3e7b3a51 In UpdateStats(), don't bother to update the pg_class row if it already
contains the correct statistics.  This is a partial solution for the
problem of allowing concurrent CREATE INDEX commands: unless they commit
at nearly the same instant, the second one will see the first one's
pg_class updates as committed, and won't try to update again, thus
avoiding the 'tuple concurrently updated' failure.
2002-09-22 23:03:58 +00:00
Tom Lane 1d01d484c1 Remove commas for compatibility with newer releases of bison. 2002-09-22 21:56:47 +00:00
Tom Lane 67ddac35db Remove commas for compatibility with newer bisons. 2002-09-22 21:54:31 +00:00
Tom Lane 0582874506 Remove commas from %type and %token lists, for compatibility with newer
versions of bison.
2002-09-22 21:44:43 +00:00
Peter Eisentraut 2972fd5d83 Translation updates, some messages tweaked. 2002-09-22 20:57:21 +00:00
Tom Lane 3503f19eeb RelationClearRelation must reset rd_targblock and update rd_nblocks
even when dealing with a nailed-in-cache relation; otherwise, following
VACUUM truncation of a system catalog, other backends might have
unreasonably large values of these fields.
2002-09-22 20:56:28 +00:00
Tom Lane 286fb25243 Make \dS work more like it used to, viz, show only system objects. 2002-09-22 20:44:22 +00:00
Tom Lane 0b620e33db server_min_messages and friends should have valid values at bootup. 2002-09-22 19:52:38 +00:00
Tom Lane c328b6dd8b Replace pg_attribute.attisinherited with attislocal and attinhcount
columns, to allow more correct behavior in multiple-inheritance cases.
Patch by Alvaro Herrera, review by Tom Lane.
2002-09-22 19:42:52 +00:00
Tom Lane 9946b83ded Bring SIMILAR TO and SUBSTRING into some semblance of conformance with
the SQL99 standard.  (I'm not sure that the character-class features are
quite right, but that can be fixed later.)  Document SQL99 and POSIX
regexps as being different features; provide variants of SUBSTRING for
each.
2002-09-22 17:27:25 +00:00
Tom Lane ac355d558e Move most of the error checking for foreign-key constraints out of
parse analysis and into the execution code (in tablecmds.c).  This
eliminates a lot of unreasonably complex code that needed to have two
or more execution paths in case it was dealing with a not-yet-created
table column vs. an already-existing one.  The execution code is always
dealing with already-created tables and so needs only one case.  This
also eliminates some potential race conditions (the table wasn't locked
between parse analysis and execution), makes it easy to fix the gripe
about wrong referenced-column names generating a misleading error message,
and lets us easily add a dependency from the foreign-key constraint to
the unique index that it requires the referenced table to have.  (Cf.
complaint from Kris Jurka 12-Sep-2002 on pgsql-bugs.)

Also, third try at building a deletion mechanism that is not sensitive
to the order in which pg_depend entries are visited.  Adding the above-
mentioned dependency exposed the folly of what dependency.c had been
doing: it failed for cases where B depends on C while both auto-depend
on A.  Dropping A should succeed in this case, but was failing if C
happened to be visited before B.  It appears the only solution is two
separate walks over the dependency tree.
2002-09-22 00:37:09 +00:00
Tom Lane e303a2dbe8 Add last-ditch defense against attempts to compile datetime code with
-ffast-math.
2002-09-21 19:52:41 +00:00
Tom Lane eb3adab568 Provide an upgrade strategy for dump files containing functions declared
with OPAQUE.  CREATE LANGUAGE, CREATE TRIGGER, and CREATE TYPE will all
accept references to functions declared with OPAQUE --- but they will
issue a NOTICE, and will modify the function entries in pg_proc to have
the preferred type-safe argument or result types instead of OPAQUE.
Per recent pghackers discussions.
2002-09-21 18:39:26 +00:00
Tom Lane 7233aae50b Fix PPC s_lock operations to work correctly on multi-CPU machines.
Need 'isync' during TAS and 'sync' during S_UNLOCK.
2002-09-21 00:14:05 +00:00
Tom Lane b2735fcd52 Performance improvement for MultiRecordFreeSpace on large relations ---
avoid O(N^2) behavior.  Problem noted and fixed by Stephen Marshall <smarshall@wsicorp.com>,
with some help from Tom Lane.
2002-09-20 19:56:01 +00:00
Tom Lane 316d4e29b2 Code review for check-domain-constraints-in-COPY patch. Do correct thing
when default expression for a domain is being used.  Avoid repetitive
catalog lookups.
2002-09-20 16:56:02 +00:00
Tom Lane 4e5c2a8d52 Update regression expected results for to_char() change. 2002-09-20 16:44:55 +00:00
Bruce Momjian 5d115bb548 Change domain patch to COERCE_IMPLICIT_CAST, per Tom. 2002-09-20 15:43:03 +00:00
Bruce Momjian a1199e0c4c Fix compile error from Rod's patch. 2002-09-20 15:29:44 +00:00
Bruce Momjian c27d95e25d The patch fix bug described in TODO:
* to_char(0,'FM999.99') returns a period, to_char(1,'FM999.99') does not

Karel Zak
2002-09-20 03:57:09 +00:00
Bruce Momjian c51a049ef2 Tom Lane wrote:
> I see in your recent bytea-LIKE patch
>
>         if (datatype != BYTEAOID && pg_database_encoding_max_length()
> 1)
>             len = pg_mbcliplen((const unsigned char *) workstr, len,
len - 1);
>         else
>             len -= -1;
>
> Surely there's one too many minus signs in that last?

Joe Conway
2002-09-20 03:55:40 +00:00
Bruce Momjian 192b0c94f2 This patch cleans up some of the code in src/util/adt/formatting.c,
fixes a few minor bugs (typos, potential buffer overruns, etc.), and
fixes some spelling/grammar mistakes.

Neil Conway
2002-09-20 03:54:57 +00:00
Bruce Momjian 229eebd559 This patch fixes two typos in src/backend/storage/ipc/README.
Neil Conway
2002-09-20 03:53:55 +00:00
Bruce Momjian 07a6fa9df1 Fixed this problem and added regression tests in domain.sql.
Also:
- Changed header file order (alphabetical)
- Changed to m = attnum - 1 in binary copy code for consistency

Rod Taylor
2002-09-20 03:52:50 +00:00
Bruce Momjian a834cbe1e9 > I'm not sure why NDirectFileRead/NDirectFileWrite are unused at the
> moment, but they used to be used; I think the correct response is to
> put back the missing counter increments, not rip out the counters.

Ok, fair enough. It's worth noting that they've been broken for a
while -- for example, the HashJoin counter increments were broken when
you comitted r1.20 of executor/nodeHashJoin.c in May of '99.

I've attached a revised patch that doesn't remove the counters (but
doesn't increment them either: I'm not sure of all the places where
the counter should be incremented).

Neil Conway
2002-09-20 03:45:08 +00:00
Tom Lane da395b56cd Tweak heap.c to refuse attempts to create table columns of standalone
composite types.  Add a couple more lsyscache.c routines to support this,
and make use of them in some other places that were doing lookups the
hard way.
2002-09-19 23:40:56 +00:00
Tom Lane 4a0c3a6142 Department of second thoughts: suppressing implicit casts everywhere in
ruleutils display is not such a great idea.  For arguments of functions
and operators I think we'd better keep the historical behavior of showing
such casts explicitly, to ensure that the function/operator is reparsed
the same way when the rule is reloaded.  This also makes the output of
EXPLAIN less obscurantist about exactly what's happening.
2002-09-19 22:48:34 +00:00
Tom Lane b26dfb9522 Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution.  Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.
2002-09-18 21:35:25 +00:00
Tatsuo Ishii 4b23f05c4f Fix bug in encoding conversion map. 2002-09-18 02:10:10 +00:00
Tatsuo Ishii 4c0bdd1ba8 Update Japanese README so that it reflects the changes made to the
conversion function interface.
2002-09-18 01:21:28 +00:00
Bruce Momjian ff9973a8f1 Remove src/test/regress/sql: plpgsql-nsp-testing.sql per Joe Conway. 2002-09-17 04:27:41 +00:00
Tom Lane c53bb2759f Un-break duplicate_oids script. 2002-09-17 01:28:36 +00:00
Bruce Momjian a2ba9a76b8 Remove retest Makefile entry because it does not compile. 2002-09-16 16:02:43 +00:00
Tom Lane 53e95eee84 Fix for rare race-condition-like failure: if a backend receives SIGUSR2
(notify/SI-overrun interrupt) while it is in process of doing proc_exit,
it is possible for Async_NotifyHandler() to try to start a transaction
when one is already running.  This leads to Asserts() or worse.  I think
it may only be possible to occur when frontend synchronization is lost
(ie, the elog(FATAL) in SocketBackend() fires), but that is a standard
occurrence after error during COPY.  In any case, I have seen this
failure occur during regression tests, so it is definitely possible.
2002-09-16 01:24:41 +00:00
Peter Eisentraut 5ea9322872 Cast functions can be immutable or stable. 2002-09-15 13:04:16 +00:00
Tom Lane db4f3c0334 Update obsolete comment. 2002-09-14 22:14:49 +00:00
Tom Lane c91b8bc537 Cosmetic fixes from Neil Conway. 2002-09-14 19:59:20 +00:00
Tom Lane f7978c6f1d Avoid overflow for large elapsed times in \timing output. Per
Kenji Sugita.
2002-09-14 19:46:01 +00:00
Peter Eisentraut 49c86099f3 Shrink the pg_hba.conf and pg_ident.conf default files and move most of the
inline documentation to the main docs.
2002-09-14 18:35:46 +00:00
Peter Eisentraut d73f8137d2 Translation updates 2002-09-14 13:46:24 +00:00
Barry Lind 7d6a055a7f Added regression test for using server side prepared statements in jdbc
and fixed a bug found by the regression test

 Modified Files:
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/test/jdbc2/Jdbc2TestSuite.java
 Added Files:
 	jdbc/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java
2002-09-14 03:52:56 +00:00
Tatsuo Ishii 3357577247 Change Assert(len > 0) to Assert(len >= 0)
Change PG_RETURN_INT32(0) to PG_RETURN_VOID()
2002-09-13 06:41:18 +00:00
Tom Lane feb202193d Fix likely cause of rare ALTER TABLE ADD FOREIGN KEY failures ---
don't assume relname field of a relcache entry will stay valid across
lots of operations.
2002-09-12 21:16:42 +00:00
Tom Lane 2b0319869a Avoid misleading error message when SET/RESET target variable name
doesn't match any known variable.
2002-09-12 14:03:45 +00:00
Bruce Momjian 7184a428a2 The small context diff below corrects what seems to be an oversight in
fmgr.h - it's discouraged to access fcinfo directly but there is no
macro to get the number of arguments passed to the function. Checking
the number of arguments is often useful when you have a function which
can be called like:

 func('arg');
 func(null);
 func();

all mapping to the same C function.

the macro has a function-like appearance to match the other PG_*
macros.

Lee Kindness.
2002-09-12 00:26:42 +00:00
Bruce Momjian b3f52320f6 > Sean Chittenden <sean@chittenden.org> writes:
>
>>::sigh:: Is it me or does it look like all
>>of pl/pgsql is schema un-aware (ie, all of the declarations).  -sc
>
>
> Yeah.  The group of routines parse_word, parse_dblword, etc that are
> called by the lexer certainly all need work.  There are some
> definitional issues to think about, too --- plpgsql presently relies on
> the number of names to give it some idea of what to look for, and those
> rules are probably all toast now.  Please come up with a sketch of what
> you think the behavior should be before you start hacking code.

Attached is a diff -c format proposal to fix this. I've also attached a short
test script. Seems to work OK and passes all regression tests.

Here's a breakdown of how I understand plpgsql's "Special word rules" -- I
think it illustrates the behavior reasonably well. New functions added by this
patch are plpgsql_parse_tripwordtype and plpgsql_parse_dblwordrowtype:

Joe Conway
2002-09-12 00:24:10 +00:00
Bruce Momjian 81186865fe Joe Conway wrote:
> Hannu Krosing wrote:
 >
 >> It seems that my last mail on this did not get through to the list
 >> ;(
 >>
 >> Please consider renaming the new builtin function
 >> split(text,text,int)
 >>
 >> to something else, perhaps
 >>
 >> split_part(text,text,int)
 >>
 >> (like date_part)
 >>
 >> The reason for this request is that 3 most popular scripting
 >> languages (perl, python, php) all have also a function with similar
 >> signature, but returning an array instead of single element and the
 >> (optional) third argument is limit (maximum number of splits to
 >> perform)
 >>
 >> I think that it would be good to have similar function in (some
 >> future release of) postgres, but if we now let in a function with
 >> same name and arguments but returning a single string instead an
 >> array of them, then we will need to invent a new and not so easy to
 >> recognise name for the "real" split function.
 >>
 >
 > This is a good point, and I'm not opposed to changing the name, but
 > it is too bad your original email didn't get through before beta1 was
 >  rolled. The change would now require an initdb, which I know we were
 >  trying to avoid once beta started (although we could change it
 > without *requiring* an initdb I suppose).
 >
 > I guess if we do end up needing an initdb for other reasons, we
 > should make this change too. Any other opinions? Is split_part an
 > acceptable name?
 >
 > Also, if we add a todo to produce a "real" split function that
 > returns an array, similar to those languages, I'll take it for 7.4.

No one commented on the choice of name, so the attached patch changes
the name of split(text,text,int) to split_part(text,text,int) per
Hannu's recommendation above. This can be applied without an initdb if
current beta testers are advised to run:

   update pg_proc set proname = 'split_part' where proname = 'split';

in the case they want to use this function. Regression and doc fix is
also included in the patch.

Joe Conway
2002-09-12 00:21:25 +00:00
Bruce Momjian b2711a0aee > BTW, clusterdb is not schema-aware and will surely fail in any database
> where more than one schema is in use, because it doesn't trouble to
> schema-qualify table names.

Ok, the following patch should solve this concern.  It also tries to
connect as little times as possible (the previous one would connect one
time per table plus one per database; this one connects two times per
database).

Alvaro Herrera
2002-09-12 00:18:14 +00:00
Bruce Momjian 6309033b16 Add sprompt.obj to Win32 makefiles. 2002-09-11 17:36:13 +00:00
Bruce Momjian 68ba17d406 Add comment about sharing of sprompt.c file. 2002-09-11 17:32:37 +00:00
Tom Lane 6fdc44be71 Tweak querytree-dependency-extraction code so that columns of tables
that are explicitly JOINed are not considered dependencies unless they
are actually used in the query: mere presence in the joinaliasvars
list of a JOIN RTE doesn't count as being used.  The patch touches
a number of files because I needed to generalize the API of
query_tree_walker to support an additional flag bit, but the changes
are otherwise quite small.
2002-09-11 14:48:55 +00:00
Barry Lind d634a5903f Patches submitted by Kris Jurka (jurka@ejurka.com) for the following bugs:
- Properly drop tables in jdbc regression tests with cascade for 7.3
  - problem with Statement.execute() and executeUpdate() not clearing binds
  - problem with ResultSet not correctly handling default encoding
  - changes to correctly support show transaction isolation level in 7.3
  - changed DatabaseMetaDataTest to handle differences in FK names in 7.3
  - better fix for dynamically checking server NAME data length
  (With the fixes above the jdbc regression tests pass on jdbc2 and jdbc3
   against both a 7.2 and 7.3 server)
Patchs submitted by David Wall (d.wall@computer.org):
  - problem with getBlob when largeobject oid is null
  - improvements to BlobOutputStream
Patch submitted by Haris Peco (snpe@snpe.co.yu):
  - problem with callable statement not supporting prepared statement methods

 Modified Files:
 	jdbc/org/postgresql/Driver.java.in
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java
 	jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java
 	jdbc/org/postgresql/jdbc3/Jdbc3ResultSet.java
 	jdbc/org/postgresql/largeobject/BlobOutputStream.java
 	jdbc/org/postgresql/largeobject/LargeObject.java
 	jdbc/org/postgresql/test/TestUtil.java
 	jdbc/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java
 	jdbc/org/postgresql/test/jdbc2/UpdateableResultTest.java
 	jdbc/org/postgresql/test/jdbc2/optional/BaseDataSourceTest.java
 	jdbc/org/postgresql/test/jdbc2/optional/ConnectionPoolTest.java
 	jdbc/org/postgresql/test/jdbc2/optional/SimpleDataSourceTest.java
2002-09-11 05:38:45 +00:00
Tom Lane 87e76d0d4a Fix portability problem (size_t != int). 2002-09-10 18:25:13 +00:00
Tom Lane 94d8a798fa Powerup defaults for LC_foo GUC variables should match what main.c does. 2002-09-10 16:09:02 +00:00
Peter Eisentraut 6555177f24 Use different sed separator for configure arguments. 2002-09-09 18:35:04 +00:00
Barry Lind 62da2fa0e1 Fixed DatabaseMetaData to correctly handle NAME size of 64
Fixed Statement to correctly DEALLOCATE any prepared statements

 Modified Files:
 	jdbc/org/postgresql/PGStatement.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
2002-09-08 00:15:29 +00:00
Bruce Momjian 24507acc0b Changes to documentation and the regression tests for the default
NAMEDATALEN of 64.

Kris Jurka
2002-09-07 18:39:05 +00:00
Peter Eisentraut 40853dd445 Allow pg_dumpall to work with previous releases again. Don't pass the -c
option down to pg_dump, where it's useless, and clarify the meaning of -c
in the documentation.
2002-09-07 16:14:33 +00:00
Peter Eisentraut 123baf8310 Fix help output. 2002-09-07 16:12:27 +00:00
Peter Eisentraut 38e444aae6 Make sure the pg_dump tar archiver can handle members larger than 2 GB, but
does not create members larger than allowed by the tar format.  Also, fix
the generation of the tar header to conform to POSIX.
2002-09-06 21:58:36 +00:00
Bruce Momjian f37c1c486a Run pgjindent for Java folks. 2002-09-06 21:23:06 +00:00
Bruce Momjian 847f8b39d7 Fix printf() quote handling and improper exit(), per Tom. 2002-09-06 02:33:47 +00:00
Tom Lane 9a9825f96a Remove heap_mark4update from AlterTableCreateToastTable. This has
never been the correct procedure for locking a relation, and the
recently-found ALTER TABLE bug with adding a constraint and a toast
table in the same command shows why it's a bad idea.
2002-09-06 00:01:53 +00:00
Tom Lane 6fe27ca2fb Fix some operator-precedence problems. New constructs IS DISTINCT FRM
and IS [NOT] OF were not being parsed consistently with other IS forms.
Also, make the world a little safer for functions named LEFT, RIGHT, etc.
2002-09-05 22:52:48 +00:00
Bruce Momjian e06f4c65b4 Fix compile error. 2002-09-05 22:24:23 +00:00
Bruce Momjian 5fc10c3d17 Remove PGPASSWORDFILE and default to always trying $HOME/.pgpass.
Cleanup up memory allocation for $HOME in related psql places.

Update mention of $HOME/.pgpass in the docs;  add mention in pg_dumpall.
2002-09-05 22:05:50 +00:00
Tom Lane b73d8d22f7 Improve opr_sanity regression test to check oprltcmpop and opgtcmpop
mergejoin links.
2002-09-05 20:23:19 +00:00
Tom Lane f4003816f5 Update oidjoins regression test for 7.3 catalogs. 2002-09-05 19:58:14 +00:00
Tom Lane 5b69f695ac Seems like a good idea for template1 to contain ANALYZE stats for the
system tables.
2002-09-05 19:56:57 +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
Peter Eisentraut a11ea5e2a3 Don't use gethostbyname2(). It's not portable and we don't claim to
support IPv6 anyway.
2002-09-05 18:27:13 +00:00
Peter Eisentraut 1e91782533 Fix compilation warning. (Cygwin has char* as second argument of
recvfrom(), not void*.)
2002-09-05 18:26:18 +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
Tom Lane 3f63787cbf Guard against send-lots-and-lots-of-data DoS attack from unauthenticated
users, by limiting the length of string we will accept for a password.
Patch by Serguei Mokhov, some editorializing by Tom Lane.
2002-09-04 23:31:35 +00:00
Peter Eisentraut e43ecb3d1a Remove leftovers from subproject removals. Fixes for Python and Kerberos
configuration.
2002-09-04 22:54:18 +00:00
Peter Eisentraut be475f92cd Fix compile warning. 2002-09-04 22:51:23 +00:00
Tom Lane 46eef3c1a3 Fix includes for plperl: ensure postgres.h is included first,
remove unnecessary inclusions.
2002-09-04 22:49:37 +00:00
Bruce Momjian e50f52a074 pgindent run. 2002-09-04 20:31:48 +00:00
Bruce Momjian 4490c7b14b Update symbols for 7.3. 2002-09-04 19:11:06 +00:00
Bruce Momjian 2355482e28 Update for 7.3 typedefs. 2002-09-04 19:00:01 +00:00
Bruce Momjian af3cf2cfa8 Update to reflect Tom's suggestions. 2002-09-04 18:45:52 +00:00
Peter Eisentraut f20e3c33d9 Remove sh -x option that snuck in somehow. 2002-09-04 18:04:57 +00:00
Tom Lane 07c67187bf Avoid multiple scans of utils/mb/conversion_procs/ subdirectories during
'make install'; there are enough of 'em that this slowed down the make
noticeably.  Ensure that 'all' is the default make target in all these
directories (defaulting to 'make install' is surprising and dangerous
IMHO).  Fix a couple small typos.
2002-09-04 15:45:50 +00:00
Bruce Momjian 7ae3e126e0 File list cleanup. 2002-09-04 07:31:59 +00:00
Bruce Momjian 0a1e41477f Update files to be changed. 2002-09-04 07:26:37 +00:00
Bruce Momjian 79ecb80c74 Brand 7.3. Ready for beta! 2002-09-04 07:23:04 +00:00
Tatsuo Ishii 97592e6a6c Refrect the changes to src/test/regress/sql/conversion.sql By Tom. 2002-09-04 02:42:34 +00:00
Tom Lane b3506006b5 EXTRACT(EPOCH FROM timestamp) gave wrong answers in the int64-timestamp
case for timestamptz input, and differently wrong answers in the float-
timestamp case for timestamp input.
2002-09-03 22:55:54 +00:00
Tom Lane d61de58906 Arrange for the default permissions on a database to allow temp table
creation to world, but disallow temp table creation in template1.  Per
latest round of pghackers discussion.
I did not force initdb, but the permissions lockdown on template1 will
not take effect unless you do one (or manually REVOKE TEMP ON DATABASE template1 FROM public).
2002-09-03 22:17:35 +00:00
Tom Lane c7d07b5a45 conversion test fails if there is an existing user named foo. Choose a name
somewhat less likely to provoke a conflict.
2002-09-03 22:06:19 +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 86f27321e2 Work around mktime() brain damage in recent versions of glibc by using
a series of localtime() calls to determine the local timezone offset
when mktime() fails.  This eliminates regression failures on RHL 7.3,
and should continue to work until it occurs to the glibc boys to break
localtime() as well.  By then I hope we'll have our own timezone code...
2002-09-03 19:46:32 +00:00
Tom Lane 4885dabe9d Eliminate unnecessary dependency on mktime(), and consequent 'Unable to
convert date to tm' failures, by using DetermineLocalTimeZone() instead.
2002-09-03 19:41:28 +00:00
Peter Eisentraut c917660a11 Workaround for format strings that are concatenated from macros
(INT64_FORMAT), which gettext cannot handle.
2002-09-03 18:50:54 +00:00
Bruce Momjian 738d13833e AIX shlib fix for building libpq.so from Tomoyuki Niijima 2002-09-03 17:17:24 +00:00
Tom Lane a3c9ef766b I think reindex_index had better get AccessExclusiveLock on the parent
heap, not just ExclusiveLock.
2002-09-03 16:00:02 +00:00
Tom Lane ab82bde7e0 Code review and documentation updates for indisclustered patch. 2002-09-03 01:04:41 +00:00
Tom Lane 00482fde8e Partial solution for 'unexpected EOF' problem with pg_disconnect: it
seems we have a choice between annoying messages and leaking memory
(or dumping core, but that's right out).  Patch also fixes several
other problems in pg_disconnect, such as being willing to close a
channel that isn't a PG channel.
2002-09-02 23:41:17 +00:00
Peter Eisentraut b28b05317d Translation updates 2002-09-02 22:22:12 +00:00
Peter Eisentraut 35179e8e32 Avoid shell syntax error if list of languages is empty. 2002-09-02 22:19:42 +00:00
Peter Eisentraut b1bacebea0 Fix typos. 2002-09-02 22:18:56 +00:00
Peter Eisentraut 3851a92f38 Convert control status codes to human-readable strings. 2002-09-02 22:18:26 +00:00
Tom Lane 8c8aa53953 pg_on_connection_loss command for libpgtcl. Patch from
Gerhard Hintermayer, revised and documented by Tom Lane.

This patch also fixes a 'must fix' bug: libpgtcl's LISTEN/NOTIFY
support was broken by the recent changes to the PGnotify structure.
Guess that change wasn't quite so safe as we thought.
2002-09-02 21:51:47 +00:00
Tom Lane 8f60f43f2e Department of second thoughts: make checks for replacing a view slightly
more flexible, and improve the error reporting.  Also, add documentation
for REPLACE RULE/VIEW.
2002-09-02 20:04:40 +00:00
Bruce Momjian 88958ea875 Improve CVS log grouping. 2002-09-02 17:34:57 +00:00
Tom Lane 460ee04956 Fix breakage introduced by evidently-completely-untested snprintf patch. 2002-09-02 14:43:14 +00:00
Tatsuo Ishii 9f09396c16 Fix conversion regressin test failure. 2002-09-02 13:27:20 +00:00
Bruce Momjian 1f8a63eb08 Update catversion so we are sure everyone gets the bytea LIKE fix. 2002-09-02 06:24:15 +00:00
Bruce Momjian 595a5a78e0 > Okay. When you get back to the original issue, the gold is hidden in
> src/backend/optimizer/path/indxpath.c; see the "special indexable
> operators" stuff near the bottom of that file.  (It's a bit of a crock
> that this code is hardwired there, and not somehow accessed through a
> system catalog, but it's what we've got at the moment.)

The attached patch re-enables a bytea right hand argument (as compared
to a text right hand argument), and enables index usage, for bytea LIKE

Joe Conway
2002-09-02 06:22:20 +00:00
Bruce Momjian f1c1685b39 Tab completion in psql is missing the REINDEX command.
Alvaro Herrera
2002-09-02 06:19:38 +00:00
Bruce Momjian a12b4e279b I checked all the previous string handling errors and most of them were
already fixed by You. However there were a few left and attached patch
should fix the rest of them.

I used StringInfo only in 2 places and both of them are inside debug
ifdefs. Only performance penalty will come from using strlen() like all
the other code does.

I also modified some of the already patched parts by changing
snprintf(buf, 2 * BUFSIZE, ... style lines to
snprintf(buf, sizeof(buf), ... where buf is an array.

Jukka Holappa
2002-09-02 06:11:43 +00:00
Bruce Momjian 48e1a39924 I guess the intention was to test incomplete SELECT statements, not
missing semicolons.

I also added a SELECT statement without a target list.

Manfred Koizar
2002-09-02 06:05:16 +00:00
Bruce Momjian 92a162c088 Okay, attached is a patch that moves the alter table regression test
into a separate parallel group. I can't confirm that this fixes the
problem for me (since it only occurs about one in ten or one in twenty
runs), but I think it's a good bet that it does...

Neil Conway
2002-09-02 05:55:43 +00:00
Bruce Momjian 9fd842c4b2 Add GUC variable to print original query to the server logs when there
is an error, warning, etc.

Gavin Sherry
2002-09-02 05:42:54 +00:00
Bruce Momjian 6a8babc206 Remove documentation that says debug_query_string is only used by
pgmonitor.

Now log_min_error_statement uses it.
2002-09-02 05:25:37 +00:00
Bruce Momjian ed7f780016 Fix ordering regression problem on freebsd/alpha by adding ORDER BY. 2002-09-02 05:20:56 +00:00
Bruce Momjian 50938576d4 I tried to build PostgreSQL with the following step to see backends hung
during the regression test. The problem has been reproduced on two machine
but both of these are the same type of hardware and software. I also tried
to recreate the problem on other machines, on older version of AIX but I
couldn't.

After looked through pgsql-hackers mailing list, I focused on spin lock
issue to solve the problem. The easiest and may not be the best solution
for the problem is to give up HAS_TEST_AND_SET. This actually works.

One another and better solution for the problem is to use _check_lock() and
_clear_lock() as spin lock.  Important thing here is to define S_UNLOCK()
with _clear_lock().  This will solve the so called "Compiler bug" issue
someone wrote on the mailing list.

We have some other API such as cs(), compare_and_swap() and fetch_and_or()
to do test and set on AIX, but any of these didn't solve my problem.  I
wrote tiny testing program to see if we have any bug of these API of AIX,
but I couldn't see any problem except for compare_and_swap(). It seems that
you can not use compare_and_swap() for the purpose, as it would not work as
spin lock on any SMP machines I tested.  I don't know the reason why cs()
nor fetch_and_or()/fetch_and_and() will not work with PostgreSQL on p690.
These worked with my testing program on all machines I tested.

Tomoyuki Niijima
2002-09-02 04:42:52 +00:00
Barry Lind 2232172e44 JDBC checkin fixing the following bugs:
Fixed support in the driver for notifications (added PGConnection.getNotifications()) - problem reported by Benjamin.Feinstein@guardent.com
  Worked around server problems with int8/int2 and constants; quote values when they are intended to bind to an int8/int2 column - reported by many
  Fixed bug in the Array interface with string parsing not handling escaped characters correctly - reported by devajx@yahoo.com
  Added workaround to support 'infinity' and '-infinity' for dates - reported bydmitry@openratings.com
  Fixed some performance issues with setBlob - reported by d.wall@computer.org
  Added support for using new prepared statements functionality in 7.3 (added PGStatement.setUseServerPrepare() and isUseServerPrepare() methods)

 Modified Files:
 	jdbc/org/postgresql/PGConnection.java
 	jdbc/org/postgresql/PGStatement.java
 	jdbc/org/postgresql/core/QueryExecutor.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java
 	jdbc/org/postgresql/jdbc2/Array.java
 Added Files:
 	jdbc/org/postgresql/PGNotification.java
 	jdbc/org/postgresql/core/Notification.java
2002-09-02 03:07:36 +00:00
Bruce Momjian 97ac103289 Remove sys/types.h in files that include postgres.h, and hence c.h,
because c.h has sys/types.h.
2002-09-02 02:47:07 +00:00
Tom Lane 248c67d7ed CREATE OR REPLACE VIEW, CREATE OR REPLACE RULE.
Gavin Sherry, Neil Conway, and Tom Lane all got their hands dirty
on this one ...
2002-09-02 02:13:02 +00:00
Tom Lane c7a165adc6 Code review for HeapTupleHeader changes. Add version number to page headers
(overlaying low byte of page size) and add HEAP_HASOID bit to t_infomask,
per earlier discussion.  Simplify scheme for overlaying fields in tuple
header (no need for cmax to live in more than one place).  Don't try to
clear infomask status bits in tqual.c --- not safe to do it there.  Don't
try to force output table of a SELECT INTO to have OIDs, either.  Get rid
of unnecessarily complex three-state scheme for TupleDesc.tdhasoids, which
has already caused one recent failure.  Improve documentation.
2002-09-02 01:05:06 +00:00
Dave Cramer fcd34f9f7f patch from Thomas O'Dowd to ensure that connections are closed 2002-09-01 23:56:13 +00:00
Dave Cramer 422c2e38a1 testing for insertRow 2002-09-01 23:45:20 +00:00
Bruce Momjian 164e1bc913 Update MEMSET_LOOP_LIMIT to 1024 because it is the best value for most
platforms.
2002-09-01 23:41:47 +00:00
Dave Cramer 881390fff6 patch to allow insertRow on an empty resultSet 2002-09-01 23:40:36 +00:00
Dave Cramer 6a5168a7a1 Changed to reflect the current reality, ie we do support updateable resultsets 2002-09-01 23:38:53 +00:00
Bruce Momjian dd1dcf2362 Improve footer length computation for psql.
Greg Sabino Mullan
2002-09-01 23:30:46 +00:00
Bruce Momjian 548d646e65 Add log_duration to GUC/postgresql.conf.
Rename debug_print_query to log_statement and rename show_query_stats to
show_statement_stats.
2002-09-01 23:26:06 +00:00
Tom Lane 470a1048ec plpgsql functions can return RECORD, per Neil Conway. 2002-09-01 16:28:06 +00:00
Tom Lane 681ed4e2fe Code cleanups: make non-implicit WITHOUT FUNCTION casts work, avoid
redundant pg_cast searches, fix obsolete comments.
2002-09-01 02:27:32 +00:00
Bruce Momjian d64e6392fb Remove code that suggested increasing wal_files. 2002-09-01 01:58:42 +00:00
Tom Lane 3c49c4b152 Mark the float8 -> int8 cast as implicit. This resolves the problem
pointed out by Barry Lind: UPDATE bigintcol = 10000000000 fails because
the constant is initially taken as float8.  We really need a better way,
but it's not gonna happen for 7.3.

Also, remove int4reltime() function, which is redundant with the
existing binary-compatibility coercion path from int4 to reltime,
and probably has been unreachable code for a long while.
2002-09-01 00:58:07 +00:00
Tom Lane 845a6c3acc Code review for domain-constraints patch. Use a new ConstraintTest node
type for runtime constraint checks, instead of misusing the parse-time
Constraint node for the purpose.  Fix some damage introduced into type
coercion logic; in particular ensure that a coerced expression tree will
read out the correct result type when inspected (patch had broken some
RelabelType cases).  Enforce domain NOT NULL constraints against columns
that are omitted from an INSERT.
2002-08-31 22:10:48 +00:00
Tom Lane 1440acd703 Wups, didn't mean to commit that just yet. 2002-08-31 19:10:08 +00:00
Tom Lane 0da6cf54ec The UNDEFOID later causes an assertion failure in heap_formtuple when
you try to use the tupdesc to build a tuple.

Joe Conway
2002-08-31 19:09:27 +00:00
Tom Lane 1bab464eb4 Code review for pg_locks feature. Make shmemoffset of PROCLOCK structs
available (else there's no way to interpret the list links).  Change
pg_locks view to show transaction ID locks separately from ordinary
relation locks.  Avoid showing N duplicate rows when the same lock is
held multiple times (seems unlikely that users care about exact hold
count).  Improve documentation.
2002-08-31 17:14:28 +00:00
Tom Lane 7bacf2befa Add expected tuple descriptor to ReturnSetInfo information for table
functions, per suggestion from John Gray and Joe Conway.  Also, fix
plpgsql RETURN NEXT to verify that returned values match the expected
tupdesc.
2002-08-30 23:59:46 +00:00
Tom Lane 26993b2918 AUTOCOMMIT mode is now an available backend GUC variable; setting it
to false provides more SQL-spec-compliant behavior than we had before.
I am not sure that setting it false is actually a good idea yet; there
is a lot of client-side code that will probably be broken by turning
autocommit off.  But it's a start.

Loosely based on a patch by David Van Wie.
2002-08-30 22:18:07 +00:00
Tom Lane 549928d99b Fix for breakage of C-coded SRFs, from Joe Conway. 2002-08-30 19:56:49 +00:00
Tom Lane e2d156fa6e Add attisinherited column to pg_attribute; use it to guard against
column additions, deletions, and renames that would let a child table
get out of sync with its parent.  Patch by Alvaro Herrera, with some
kibitzing by Tom Lane.
2002-08-30 19:23:20 +00:00
Bruce Momjian 96fd7192e7 Back out unintented tab change. 2002-08-30 18:15:23 +00:00
Bruce Momjian 72b60ac997 Remove pgaccess from Makefile. 2002-08-30 18:14:21 +00:00
Bruce Momjian 63653f7ffa Complete TODO item:
* Remove wal_files postgresql.conf option because WAL files are
	  now recycled
2002-08-30 16:50:50 +00:00
Bruce Momjian fefb57ce74 Remove pgaccess from CVS. It has its own home now. 2002-08-30 16:48:44 +00:00
Bruce Momjian f7e089b3fa Back out password packet length check.
Improve wording of pre-7.3 syntax mention.
2002-08-30 16:00:41 +00:00
Marc G. Fournier 9a0b4d7f84 perl5 interface moved to gborg 2002-08-30 13:06:22 +00:00
Marc G. Fournier c411f51dfb libpgeasy moved to gborg ... 2002-08-30 13:03:11 +00:00
Tom Lane df40e28850 Fix off-by-one allocation error in PasswordFromFile(), per Gordon Runkle. 2002-08-30 05:28:50 +00:00
Tom Lane a4dbbb52c9 Revert _LARGEFILE64_SOURCE addition; good try but doesn't work,
at least not on HPUX 10.20, and there's no reason to think it
is needed on later versions.
2002-08-30 02:01:34 +00:00
Tom Lane fac3dd56b3 Group-manipulating code neglected to fill in array element type,
which is now required.
2002-08-30 01:01:02 +00:00
Tom Lane e107f3a7e3 PL/pgSQL functions can return sets. Neil Conway's patch, modified so
that the functionality is available to anyone via ReturnSetInfo, rather
than hard-wiring it to PL/pgSQL.
2002-08-30 00:28:41 +00:00
Hiroshi Inoue 82ccb420d5 Fix a bug introduced in 7.2. 2002-08-29 23:39:05 +00:00
Bruce Momjian 40f2eec503 > > > > If you want to put in security restrictions that are actually useful,
> > > > where is the code to verify that PGPASSWORDFILE points at a
> > > > non-world-readable file?  That needs to be there now, not later, or
> > > > we'll have people moaning about backward compatibility when we finally
> > > > do plug that hole.

Alvaro Herrera
2002-08-29 23:06:32 +00:00
Bruce Momjian 9858a3a43f Sir Mordred The Traitor <mordred@s-mail.com> writes:
> Upon invoking a polygon(integer, circle) function a
> src/backend/utils/adt/geo_ops.c:circle_poly() function will gets
> called, which suffers from a buffer overflow.
>
> 2) A src/backend/adt/utils/geo_ops.c:path_encode() fails to detect a
> buffer overrun condition. It is called in multiple places, the most
> interesting are path_out() and poly_out() functions.

> 5) A src/backend/utils/adt/geo_ops.c:path_add() also fails to detect
> a simple buffer overrun.

I've attached a patch which should fix these problems.

Neil Conway
2002-08-29 23:05:44 +00:00
Peter Eisentraut 6d27cfdd89 Make pg_resetxlog options parsing more standard and prepare messages for
translation.
2002-08-29 22:19:03 +00:00
Peter Eisentraut 41a8562739 Create "po" subdirectory before writing there. 2002-08-29 22:13:01 +00:00
Peter Eisentraut d525ab81c3 Workaround for broken large file support on HP-UX 2002-08-29 22:09:22 +00:00
Bruce Momjian f81ce4a0f6 Prevent problem with extra-long password packets from allocating lots of
memory.

Neil Conway
2002-08-29 21:50:36 +00:00
Bruce Momjian 626eca697c This patch reserves the last superuser_reserved_connections slots for
connections by the superuser only.

This patch replaces the last patch I sent a couple of days ago.

It closes a connection that has not been authorised by a superuser if it would
leave less than the GUC variable ReservedBackends
(superuser_reserved_connections in postgres.conf) backend process slots free
in the SISeg. This differs to the first patch which only reserved the last
ReservedBackends slots in the procState array. This has made the free slot
test more expensive due to the use of a lock.

After thinking about a comment on the first patch I've also made it a fatal
error if the number of reserved slots is not less than the maximum number of
connections.

Nigel J. Andrews
2002-08-29 21:02:12 +00:00
Bruce Momjian a4f6add21b Back out patch, that was alpha, which I think still needs just -O. 2002-08-29 19:35:47 +00:00
Bruce Momjian 19deb4fc41 Change FreeBSD to use -O2, important for MemSet. 2002-08-29 19:35:07 +00:00
Tom Lane e4186762ff Adjust nodeFunctionscan.c to reset transient memory context between calls
to the table function, thus preventing memory leakage accumulation across
calls.  This means that SRFs need to be careful to distinguish permanent
and local storage; adjust code and documentation accordingly.  Patch by
Joe Conway, very minor tweaks by Tom Lane.
2002-08-29 17:14:33 +00:00
Tom Lane 0201dac1c3 Push down outer qualification clauses into UNION and INTERSECT subqueries.
Per pghackers discussion from back around 1-August.
2002-08-29 16:03:49 +00:00
Tom Lane d2236800ee Cause REINDEX to regard TOAST tables as regular relations, not system
tables that need special defenses.  I believe this is okay even for
TOAST tables that belong to system tables.
2002-08-29 15:56:20 +00:00
Tatsuo Ishii 0308d66a6a Remove MULTIBYTE 2002-08-29 08:03:22 +00:00
Tatsuo Ishii ed7baeaf4d Remove #ifdef MULTIBYTE per hackers list discussion. 2002-08-29 07:22:30 +00:00
Tom Lane 8e80dbb849 Rephrase 'Cannot insert into a view' and related messages, per
pghackers discussion around 31-Jul-02.
2002-08-29 06:05:27 +00:00
Tatsuo Ishii 16402ac6e3 update mbregress expected files 2002-08-29 04:43:55 +00:00
Tom Lane dc4e983ff6 Produce a somewhat-useful error message, namely
ERROR:  Cannot display a value of type RECORD
rather than a random integer when someone tries to SELECT a tuple
value.  Per pghackers discussion around 26-May-02.
2002-08-29 04:38:04 +00:00
Tom Lane 99fd5cbd41 FOUND patch was a bit over-enthusiastic: SQL commands that are not
INSERT, UPDATE, or DELETE shouldn't change FOUND.  IMHO anyway.
Also, try to make documentation a little clearer.
2002-08-29 04:12:03 +00:00
Tom Lane 5241a6259f Remove support for version-0 FE/BE protocol, per pghackers discussion.
This breaks support for 6.2 or older client libraries.
2002-08-29 03:22:01 +00:00
Tom Lane 8a24a55c81 Fix ruleutils to dump column definition lists for anonymous record types
defined in the FROM clause.  From Joe Conway, with some tweaks.
2002-08-29 01:19:41 +00:00
Tom Lane 64505ed58b Code review for standalone composite types, query-specified composite
types, SRFs.  Not happy with memory management yet, but I'll commit these
other changes.
2002-08-29 00:17:06 +00:00
Peter Eisentraut 12f80d7c69 Initial Spanish translation from Karim Mribti <karim@inlosa.com> 2002-08-28 21:01:14 +00:00
Peter Eisentraut 3aaffad26f Updates from Dennis Bjorklund 2002-08-28 20:58:45 +00:00
Peter Eisentraut d54caa6b34 Break up the long usage messages in pg_dump and pg_restore and
unify the wording, to make life easier for translators.

from Dennis Bjorklund
2002-08-28 20:57:22 +00:00
Bruce Momjian 03d39ce080 Remove TIOGA files from CVS current; they remain in repositiry. 2002-08-28 20:55:23 +00:00
Bruce Momjian fbb1966cf3 This trivial patches fixes the error message returned by CREATE INDEX
when it finds an existing relation with the same name as the
to-be-created index.

Old error message:

nconway=# create table foo (a int);
CREATE TABLE
nconway=# create index foo on foo (a);
ERROR:  index named "foo" already exists

I replaced 'index' with 'relation' in the error message.

Neil Conway
2002-08-28 20:46:47 +00:00
Bruce Momjian 81dfa2ce43 backend where a statically sized buffer is written to. Most of these
should be pretty safe in practice, but it's probably better to be safe
than sorry.

I was actually looking for cases where NAMEDATALEN is assumed to be
32, but only found one. That's fixed too, as well as a few bits of
code cleanup.

Neil Conway
2002-08-28 20:46:24 +00:00
Bruce Momjian f5fea0808f This is a quick patch to fix a crash in pgquery_dictresult() introduced
recently. I just ran into it while running a set of python test scripts,
and I'm not sure who the normal maintainer is for interfaces/python.

John Nield
2002-08-28 20:18:58 +00:00
Bruce Momjian b60acaf568 The following small patch provides a couple of minor updates (against
CVS HEAD):

Amended "strings" regression test. TOAST tests now insert two values
with storage set to "external", to exercise properly the TOAST slice
routines which fetch only a subset of the chunks.

Changed now-misleading comment on AlterTableCreateToastTable in
tablecmds.c, because both columns of the index on a toast table are now
used.

John Gray
2002-08-28 20:18:29 +00:00
Peter Eisentraut 2364928814 Dump ALTER DATABASE/USER ... SET ... 2002-08-28 18:25:05 +00:00
Bruce Momjian 6077db92c2 Allow FOR UPDATE to appear after LIMIT/OFFSET to match MySQL syntax and as
a more logical ordering.
2002-08-28 14:35:37 +00:00
Tom Lane 8e4357d8ad Fix compile warning. 2002-08-27 21:50:23 +00:00
Peter Eisentraut f032bccbdd Flush output streams before calling pg_dump subprocess. 2002-08-27 21:33:41 +00:00
Bruce Momjian 9afa305835 Disable use of -c and -a together in pg_dump; they don't make sense together. 2002-08-27 21:04:58 +00:00
Tom Lane 65a34e93c6 Bring comments back in sync with code. 2002-08-27 20:54:47 +00:00
Bruce Momjian 73b94657b0 Throw error on pg_atoi(''), regression adjustments. 2002-08-27 20:29:11 +00:00
Peter Eisentraut 7292131c66 Enable locale, so case conversion (identifier processing) and number
formatting (\timing) works correctly.  Change "Total time" to "Time"
since there is nothing that "total" refers to.  Remove non-multibyte
code.
2002-08-27 20:16:49 +00:00
Peter Eisentraut 7af5ea736f Reimplement pg_dumpall in C. Currently no change in functionality,
except that it's more robust, reconnects less often, and is NLS'ed.
2002-08-27 18:57:26 +00:00
Bruce Momjian 6deb649cd3 Add '+' mention in \? help. More clean of \? to do. 2002-08-27 18:28:29 +00:00
Bruce Momjian ec11403023 Make change for pg_locks table. 2002-08-27 18:06:00 +00:00
Bruce Momjian a1c218cae4 The attached patch implements the password packet length sanity check
(using an elog(LOG) ), as well as includes a few more comment fixes.

Neil Conway
2002-08-27 16:21:51 +00:00
Bruce Momjian fd3c4b2eaf Add most of Neil Conway's cleanups. 2002-08-27 15:15:23 +00:00
Bruce Momjian 840deabfe0 More connection timeout cleanups. 2002-08-27 15:02:50 +00:00
Bruce Momjian 4e723e6717 Cleanup of libpq connection timeout code. 2002-08-27 14:49:52 +00:00
Bruce Momjian 0582ad91ac Add fsm sizes. 2002-08-27 14:06:05 +00:00
Tom Lane 28e82066a1 PREPARE/EXECUTE statements. Patch by Neil Conway, some kibitzing
from Tom Lane.
2002-08-27 04:55:12 +00:00
Bruce Momjian a77d34f0b8 This patch updates the lock listing code to use Joe Conway's new
anonymous return type SRF code. It gets rid of the superflous
'pg_locks_result' that Bruce/Tom had commented on. Otherwise, no
changes in functionality.

Neil Conway
2002-08-27 04:00:28 +00:00
Bruce Momjian bda45958a8 This is a 2 line patch to src/interfaces/perl5/GNUMakefile that fixes
the 'override CPPFLAGS' to include the source directory during compile,
and makes the install target look in the proper place for the man page.

Changes are only required when building outside the source directory.

J. R. Nield
2002-08-27 03:57:11 +00:00
Bruce Momjian dd912c6977 This patches replaces a few more usages of strcpy() and sprintf() when
copying into a fixed-size buffer (in this case, a buffer of
NAMEDATALEN bytes). AFAICT nothing to worry about here, but worth
fixing anyway...

Neil Conway
2002-08-27 03:56:35 +00:00
Bruce Momjian c0ad595386 I attach a little patch to make CLUSTER set and reset the indisclustered
bit on the indexes.

I also attach clusterdb and clusterdb.sgml; both of them are blatant
rips of vacuumdb and vacuumdb.sgml, but get the job done.  Please review
them, as I'm probably making a lot of mistakes with SGML and I can't
compile it here.

vacuumdb itself is not very comfortable to use when the databases have
passwords, because it has to connect once for each table (I can probably
make it connect only once for each database; should I?).  Because of
this I added a mention of PGPASSWORDFILE in the documentation, but I
don't know if that is the correct place for that.

Alvaro Herrera
2002-08-27 03:38:28 +00:00
Bruce Momjian b7e272429c Add to skip list in check_guc 2002-08-27 03:06:16 +00:00
Bruce Momjian fd9d665908 Comment cleanup. 2002-08-27 03:02:31 +00:00
Bruce Momjian fc67e1fb94 Script cleanups. 2002-08-27 03:01:13 +00:00
Bruce Momjian f20ec2e8f8 Clean up script. 2002-08-27 02:54:39 +00:00
Bruce Momjian 1051346fb7 Add check_guc utility to compare guc.c and postgresql.conf.sample. 2002-08-27 02:52:42 +00:00
Bruce Momjian e46afb588d Fix units in postgresql.conf. 2002-08-27 02:50:41 +00:00
Bruce Momjian 9ede612245 Add units to postgresql.conf file. 2002-08-26 22:23:07 +00:00
Tom Lane 5d6758fd24 Increase WIDTH_THRESHOLD from 256 to 1K. This addresses recent observation
that ANALYZE would not gather any stats for a CHAR(255) column.  I still
think a width threshold is appropriate for the reasons mentioned in the
code, but we can loosen it at least.
2002-08-26 18:45:57 +00:00
Tom Lane 5cabcfccce Modify array operations to include array's element type OID in the
array header, and to compute sizing and alignment of array elements
the same way normal tuple access operations do --- viz, using the
tupmacs.h macros att_addlength and att_align.  This makes the world
safe for arrays of cstrings or intervals, and should make it much
easier to write array-type-polymorphic functions; as examples see
the cleanups of array_out and contrib/array_iterator.  By Joe Conway
and Tom Lane.
2002-08-26 17:54:02 +00:00
Bruce Momjian 39e331be72 Add Bob Devine's name to the optimizer README. 2002-08-25 22:39:37 +00:00
Tom Lane 58de480999 Clean up comments to be careful about the distinction between variable-
width types and varlena types, since with the introduction of CSTRING as
a more-or-less-real type, these concepts aren't identical.  I've tried to
use varlena consistently to denote datatypes with typlen = -1, ie, they
have a length word and are potentially TOASTable; while the term variable
width covers both varlena and cstring (and, perhaps, someday other types
with other rules for computing the actual width).  No code changes in this
commit except for renaming a couple macros.
2002-08-25 17:20:01 +00:00
Tom Lane 976246cc7e The cstring datatype can now be copied, passed around, etc. The typlen
value '-2' is used to indicate a variable-width type whose width is
computed as strlen(datum)+1.  Everything that looks at typlen is updated
except for array support, which Joe Conway is working on; at the moment
it wouldn't work to try to create an array of cstring.
2002-08-24 15:00:47 +00:00
Barry Lind fe2dec75a9 Enhancements to how queries with bind values are stored internally and sent to
the server.  Previously we allocated a new String object for the entire final
query we were sending to the database.  If you had a big query, or especially
if you had large bind values you ended up with essentially two copies in memory.
This change will reuse the existing objects and therefore should take 1/2 the
memory it does today for a given query.  This restructuring will also allow
in the future the ability to stream bytea data to the server instead of the current approach of pulling it all into memory.
I also fixed a test that was failing on a 7.2 database.
Also renamed some internal variables and some minor cleanup.

 Modified Files:
 	jdbc/org/postgresql/core/QueryExecutor.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
 	jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java
 	jdbc/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java
2002-08-23 20:45:49 +00:00
Tom Lane a2a3192802 Further cleanup around the edges of OPAQUE/pseudotype changes. Correct
the declarations of some index access method support functions.  Support
SQL functions returning VOID.
2002-08-23 16:41:38 +00:00
Tom Lane 14a760882a Since the plpgsql test has been part of the standard regression tests
for a good long while, I see no reason to maintain this original copy.
2002-08-22 23:33:43 +00:00
Tom Lane 40faa4a590 Transpose info from src/pl/plpgsql/test/README into standard regression test file. 2002-08-22 23:31:48 +00:00
Marc G. Fournier 5a303f878e Remove all traces of the ODBC driver, which is now on GBorg as the psqlodbc
project ...
2002-08-22 22:43:14 +00:00
Tom Lane 03a7625a3a Fix bit rot in pg_dump's ability to dump from 7.2 and 7.1 servers. 2002-08-22 21:35:50 +00:00
Tom Lane 19b3c55261 Fixed-size buffer in dumpClasses is not big enough anymore given the
addition of a column list clause to the COPY command.  Spotted by
Martin Renters.
2002-08-22 21:29:34 +00:00
Tom Lane 0f1112923c Code review for recent TRUNCATE changes. Tighten relation-kind check,
tighten foreign-key check (a self-reference should not prevent TRUNCATE),
improve error message, cause a relation's TOAST table to be truncated
along with the relation.
2002-08-22 14:23:36 +00:00
Bruce Momjian b4f24fed7a Commit updated repeat() patch, from Neil Conway 2002-08-22 05:05:19 +00:00
Bruce Momjian d86dee3edd This patch should fix the problem. Doesn't include my previous patch
for repeat(). Again, somewhat off-the-cuff, so I might have missed
something...

test=# select lpad('xxxxx',1431655765,'yyyyyyyyyyyyyyyy');
ERROR:  Requested length too large
test=# select rpad('xxxxx',1431655765,'yyyyyyyyyyyyyyyy');
ERROR:  Requested length too large

(That's on a Unicode DB, haven't tested other encodings but AFAICT
this fix should still work.)

Neil Conway
2002-08-22 04:55:05 +00:00
Bruce Momjian cbe733d752 repeat() fix:
> Neil Conway <neilc@samurai.com> writes:
> > +   /* Check for integer overflow */
> > +   if (tlen / slen != count)
> > +           elog(ERROR, "Requested buffer is too large.");
>
> What about slen == 0?

Good point -- that wouldn't cause incorrect results or a security
problem, but it would reject input that we should really accept.

Revised patch is attached.

Neil Conway
2002-08-22 04:54:20 +00:00
Bruce Momjian 47b37a6bfa # Disallow TRUNCATE on tables that are involved in referential
constraints


The issue with finding and removing foreign key constraints is no longer
an issue, so please apply the attached.

It does NOT check for rules or on delete triggers (old style foreign
keys) as those are difficult to deal with (remove, truncate, re-add).

Rod Taylor
2002-08-22 04:51:06 +00:00
Bruce Momjian a334ae3f22 As suggested by Tom, this patch restricts the right-hand argument of
bytealike to TEXT.

This leaves like_escape_bytea() without anything to do, but I left it in
place in anticipation of the eventual bytea pattern selectivity
functions. If there is agreement that this would be the best long term
solution, I'll take it as a TODO for 7.4.

Joe Conway
2002-08-22 04:45:11 +00:00
Bruce Momjian c7e7672937 Oops, we got duplicate oids from patches again; pick a unique one. 2002-08-22 04:41:06 +00:00
Bruce Momjian 89260124db Add:
replace(string, from, to)
   -- replaces all occurrences of "from" in "string" to "to"
split(string, fldsep, column)
   -- splits "string" on "fldsep" and returns "column" number piece
to_hex(int32_num) & to_hex(int64_num)
   -- takes integer number and returns as hex string

Joe Conway
2002-08-22 03:24:01 +00:00
Bruce Momjian ff1793f036 Remove erroneous character from Makefile due to editor error. 2002-08-22 02:18:45 +00:00
Marc G. Fournier da4683fbe1 Okay, libpq++ is moved to GBorg, and all traces of it have been removed
from the core repository ... I haven't *moved* the libpq++ files out of the
tree, mainly as we want to keep them in place for past branches ...

Peter, I think I've covered all the files I need, and re-ran autoconf to make
sure the configure file is in place properly ...
2002-08-22 00:15:14 +00:00
Tom Lane b663f3443b Add a bunch of pseudo-types to replace the behavior formerly associated
with OPAQUE, as per recent pghackers discussion.  I still want to do some
more work on the 'cstring' pseudo-type, but I'm going to commit the bulk
of the changes now before the tree starts shifting under me ...
2002-08-22 00:01:51 +00:00
Peter Eisentraut 606c9b9d4f Add --help and --version options. Message cleanup. NLS. 2002-08-21 22:24:34 +00:00
Bruce Momjian d46e3dc00f Changes made so new conversion Makefiles will build out of the source tree. 2002-08-21 21:33:55 +00:00
Peter Eisentraut 41c92ace2f Move PO files into subdirectories separate from the source code. 2002-08-21 20:42:27 +00:00
Peter Eisentraut b7a5917a61 Add sys/types.h to common includes. 2002-08-21 17:20:58 +00:00
Tom Lane 091ff0931d Use a non-duplicate OID for pg_lock_status. 2002-08-20 19:23:07 +00:00