Commit Graph

8495 Commits

Author SHA1 Message Date
Hiroshi Inoue ec6c4d8c82 Improve declare/fetch mode a little.
Add a new DSN option for PREPARE hadling.

Hiroshi Inoue
2001-09-08 16:20:16 +00:00
Hiroshi Inoue fc5ec424ab Apply 7.1.3 changes to the current tree also. 2001-09-08 16:15:28 +00:00
Peter Eisentraut c0d4d5473a Make the world somewhat safe for (not from) DELETE FROM pg_shadow;
Assign the fixed user id 1 to the user created by initdb.
A stand-alone backend will always set the user id to 1.
(Consequently, the name of that user is no longer important.)

In stand-alone mode, the user id 1 will have implicit superuser
status, to allow repairs even if there are no users defined.

Print a warning message when starting in stand-alone mode when no
users are defined.

Disallow dropping the current user and session user.

Granting/revoking superuser status also grants/revokes usecatupd.
(Previously, it would never grant it back.  This could lead to "deadlocks".)

CREATE USER and CREATE GROUP will start allocating user ids at 100
(unless explicitly specified), to prevent accidental creation of a
superuser (plus some room for future extensions).
2001-09-08 15:24:00 +00:00
Bruce Momjian fdbf796f36 > > A simple and robus solution is in the begin of mbutils.c set default
> > ClientEncoding to SQL_ASCII (like default DatabaseEncoding). Bruce, can
> > you change it? It's one line change. Again thanks.

 Forget it! A default client encoding must be set by actual database encoding...
Please apply the small attached patch that solve it better.

Karel Zak
2001-09-08 14:30:15 +00:00
Bruce Momjian 468b9d8202 Move updateCommon() into Win32 block because it is only used there. 2001-09-08 02:48:53 +00:00
Hiroshi Inoue 4ad1b5b766 Resolve compile errors on unix.
Rename psqlodbc.def -> psqlodbc_win32.def.
Improve internal *declare cursor* handling
a little.

Hiroshi Inoue
2001-09-08 02:28:41 +00:00
Tom Lane 02b1a7fd51 Clean up some confusion about where and how to set whereToSendOutput.
We will no longer try to send elog messages to the client before we have
initialized backend libpq (oops); however, reporting bogus commandline
switches via elog does work now (not irrelevant, because of PGOPTIONS).
Fix problem with inappropriate sending of checkpoint-process messages
to stderr.
2001-09-08 01:10:21 +00:00
Bruce Momjian 6b9f94022c Move TESTSUITE file to test/README. 2001-09-07 23:34:16 +00:00
Tom Lane 09e99a1082 Change addlit() to not assume its input is null-terminated, so that we
don't have more bugs like the quote-quote-quote-quote one.  Propagate
fix into ecpg lexer, too.
2001-09-07 23:17:14 +00:00
Bruce Momjian b6385efb79 Attached is a patch that fixes 2 test cases of the JDBC test
suite. This reduces the number of failures from 9 to 7.

Both ConnectionTest and JBuilderTest did not create their own
tables, which caused these test cases to fail with "relation ...
does not exist". It appears these test cases relied on tables
created by the example code elsewhere in the source tree. I've
added the necessary "create table" and "drop table" statements
to the test cases, using the column definitions from the example
code.

While working on that I modified the helper method createTable
in JDBC2Tests.java to take a table parameter, rather than using
table names passed via the properties in build.xml. I'm not sure
what that was good for, and in fact, except for the default
table name "jdbctest", this functionality wasn't used at all.

Ren? Pijlman
2001-09-07 22:17:48 +00:00
Bruce Momjian 7066253ab5 Read transactions don't work on 7.0.x db's 2nd patch
Here is a revised patch with Barry's suggestions implemented

Dave Cramer
2001-09-07 22:17:02 +00:00
Bruce Momjian 6ea41dcc7b Patch for jdbc2 ResultSet.java. Looks like performance improvement.
Joseph Shraibman
2001-09-07 22:15:55 +00:00
Bruce Momjian 1834987fb6 I've attached the fixed version of the patch below. After the
discussion on pgsql-hackers (especially the frightening memory dump in
<12273.999562219@sss.pgh.pa.us>), we decided that it is best not to
use identifiers from an untrusted source at all.  Therefore, all
claims of the suitability of PQescapeString() for identifiers have
been removed.

Florian Weimer
2001-09-07 22:02:32 +00:00
Bruce Momjian bd9b32803b Here is my much-promised patch to let people add UNIQUE constraints after
table creation time.  Big deal you say - but this patch is the basis of the
next thing which is adding PRIMARY KEYs after table creation time.  (Which
is currently impossible without twiddling catalogs)

Rundown
-------

* I have made the makeObjectName function of analyze.c non-static, and
exported it in analyze.h

* I have included analyze.h and defrem.h into command.c, to support
makingObjectNames and creating indices

* I removed the 'case CONSTR_PRIMARY' clause so that it properly fails and
says you can't add primary keys, rather than just doing nothing and
reporting nothing!!!

* I have modified the docs.

Algorithm
---------

* If name specified is null, search for a new valid constraint name.  I'm
not sure if I should "lock" my generated name somehow tho - should I open
the relation before doing this step?

* Open relation in access exclusive mode

* Check that the constraint does not already exist

* Define the new index

* Warn if they're doubling up on an existing index

Christopher Kings-Lynne
2001-09-07 21:57:53 +00:00
Bruce Momjian 68e190cfa4 >has anyone ever successfully done copy to/from stdout with the
>tcl-extension for postgreSQL.
>I'm currently using 7.0 and always getting a seg fault when I try to
>read from the database connection after issueing a "COPY table TO
>stdout;" (I'm using the connection handle, *not* the result handle).
>Maybe this is fixed in a later release.
>The README file in src/interfaces/libpgtcl tells me, that this should
>work, but unforunately it doesn't.

Yes, it seems broken. It is a bug in libpgtcl.  Are you running Tcl >= 8.3.2?
That's when the Tcl team changed the data structure for channel
callbacks.  The change itself was designed to be backward compatible, but I
suspect a related change made the code more sensitive to errors in the
structure (NULL pointers where functions are required).  Either that, or
nobody has tried to use libpgtcl with COPY in a long time.

First, I have to say I can't think of a good reason to use PostgreSQL's
COPY command from a Tcl application. I think it should only be used with
psql for importing data from another source into PostgreSQL, or for
exporting PostgreSQL data into another database (but why would anyone do
that?) If it was me, I would stick with SELECT and INSERT and be "SQL
Compliant".

OK, editorial is over. Try applying the patch below to fix
      src/interfaces/libpgtcl/pgtclId.c
and let us know if it works. I did little testing on it, but my test did
segfault before and ran fine (copy in and copy out) after the patch.  This
is for PostgreSQL-7.1.2 - since you are running older 7.0, I don't know if
this will work, but I suspect it will.

PS It's the absence of PgWatchProc which kills it. I didn't upgrade it
to the "V2" channel type structure, so it should be compatible with older
Tcl's. But aside from gets and puts, I doubt any other file operations
would work on the handle during a copy.

ljb
2001-09-07 21:55:00 +00:00
Bruce Momjian a926c7058b Add Java testsuite info. 2001-09-07 21:45:42 +00:00
Bruce Momjian 3fb3678409 Create pgjindent for java. 2001-09-07 21:25:44 +00:00
Tom Lane 17c03b30b0 Revert treatment of NOTIFY in rules to its pre-7.1 behavior: notify will
occur unconditionally, even if the rule should otherwise execute
conditionally.  This is more useful than giving an error, even though it's
not truly the correct behavior.  Per today's pghackers discussion.
2001-09-07 20:52:31 +00:00
Bruce Momjian 8c55728295 Add CRED alignment for NetBSD. 2001-09-07 19:59:04 +00:00
Bruce Momjian a7621c92ae Update SCM_CREDS for Net/Free/BSD-OS. Add configure checks. 2001-09-07 19:52:54 +00:00
Jan Wieck 7e26a8241d Enable SIGTERM and SIGQUIT during client authentication so
the postmaster can kill the forked off processes when shutdown
is requested.

Jan
2001-09-07 16:12:49 +00:00
Bruce Momjian d9044b5637 Remove file, per Karel. 2001-09-07 15:14:16 +00:00
Bruce Momjian 4ea26bf354 Remove variable length macros used in debugging, per Karel. 2001-09-07 15:01:45 +00:00
Bruce Momjian 7bfc83f673 Remove unused files for Karel's patch. 2001-09-07 14:17:17 +00:00
Bruce Momjian 9f5185cf63 Remove common.c, removed in Karal's patch. 2001-09-07 14:00:25 +00:00
Hiroshi Inoue 377d131b6c 1) Most driver options could be set per DSN.
2) Keep FE/BE protocol more precisely.
3) Improve procedure calls.
4) A trial to avoid PREMATURE execution(#ifdef'd now).

Hiroshi Inoue
2001-09-07 06:02:24 +00:00
Tatsuo Ishii 3bdd67a203 Add missing files. 2001-09-07 03:32:11 +00:00
Tom Lane 0fc7779d2e Revise overflow test in int84() to avoid codegen bug in some older
versions of gcc.  We don't really need to explicitly test the limits
anyway, just reverse-convert and see if we get the same answer.
2001-09-07 01:33:44 +00:00
Bruce Momjian 4ab2393729 Update tab completion for \d*. 2001-09-07 01:24:18 +00:00
Tom Lane ee3c51d4f5 Fix a number of places where pg_dump was careless about explicitly
coercing OID literals to OID in its queries.  Depending on the query
and the server version, this could cause failures for OIDs over 2 billion.
2001-09-07 01:11:50 +00:00
Tom Lane e67bb7af5a Missed a few places that referred to a compile-time limit on
max_connections.
2001-09-07 00:46:42 +00:00
Tom Lane 863aceb54f Get rid of PID entries in shmem hash table; there is no longer any need
for them, and making them just wastes time during backend startup/shutdown.
Also, remove compile-time MAXBACKENDS limit per long-ago proposal.
You can now set MaxBackends as high as your kernel can stand without
any reconfiguration/recompilation.
2001-09-07 00:27:30 +00:00
Bruce Momjian 0059c4216c >Well, if it is that easy, I can do it. Patch attached and applied.
>
>> On Mon, 3 Sep 2001 22:01:17 -0500, you wrote:
>>     public boolean isWritable(int column) throws SQLException
>>     {
>>         return !isReadOnly(column);
>>     }

Actually, I think this change has a consequence for this method
in the same class:

    public boolean isDefinitelyWritable(int column)
        throws SQLException
    {
        return isWritable(column);
    }

This is from the JDBC spec
(http://java.sun.com/j2se/1.3/docs/api/java/sql/ResultSetMetaData.html):

  isReadOnly() - Indicates whether the designated column is
definitely not writable.

  isWritable() - Indicates whether it is possible for a write on
the designated column to succeed.

  isDefinitelyWritable() - Indicates whether a write on the
designated column will definitely succeed.

At this time we don't really implement the fine semantics of
these methods. I would suggest the following defaults:

  isReadOnly()             false
  isWritable()             true
  isDefinitelyWritable()   false

And that would mean that your patch is correct, but
isDefinitelyWritable() would need to be patched accordingly:

    public boolean isDefinitelyWritable(int column)
        throws SQLException
    {
        return false;
    }

Again, both in jdbc1 and jdbc2.

Regards,
Ren? Pijlman <rene@lab.applinet.nl>
2001-09-06 20:43:39 +00:00
Bruce Momjian afa178e7e2 On Mon, 3 Sep 2001 22:01:17 -0500, you wrote:
>public boolean isWritable(int column) throws SQLException
>{
>        if (isReadOnly(column))
>                return true;
>        else
>                return false;
>}

The author probably intended:

    public boolean isWritable(int column) throws SQLException
    {
        return !isReadOnly(column);
    }

And if he would have coded it this way he wouldn't have made
this mistake :-)

>hence, isWritable() will always return false. this is something
>of a problem :)

Why exactly? In a way, true is just as incorrect as false, and
perhaps it should throw "not implemented". But I guess that
would be too non-backwardly-compatible.

>let me know if i can provide further information.

Will you submit a patch?

Regards,
Ren? Pijlman <rene@lab.applinet.nl>
2001-09-06 18:26:37 +00:00
Bruce Momjian 343e38a938 > The win32.mak and libpgtcl.def files had been lost (patch doesn't handle
> new files). I'm attaching those two files below.
>
> Regards
> Mikhail Terekhov
2001-09-06 15:20:19 +00:00
Bruce Momjian 495e264fa3 Add -rpath for BSD/OS, from Peter E. 2001-09-06 13:43:42 +00:00
Bruce Momjian f57477e651 > Patch applied. Thanks.
Thanks. However, I seem to have left a single debug statement in there :-(

Here's a patch to remove it.

Vianen, Jeroen van
2001-09-06 12:53:15 +00:00
Peter Eisentraut 8837164730 Russian translation from Serguei Mokhov 2001-09-06 11:10:47 +00:00
Tatsuo Ishii f25ed23c57 Fix Karel's patch. Suggested by Eiji Tokuya 2001-09-06 05:01:38 +00:00
Tatsuo Ishii 227767112c Commit Karel's patch.
-------------------------------------------------------------------
Subject: Re: [PATCHES] encoding names
From: Karel Zak <zakkr@zf.jcu.cz>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-patches <pgsql-patches@postgresql.org>
Date: Fri, 31 Aug 2001 17:24:38 +0200

On Thu, Aug 30, 2001 at 01:30:40AM +0200, Peter Eisentraut wrote:
> > 		- convert encoding 'name' to 'id'
>
> I thought we decided not to add functions returning "new" names until we
> know exactly what the new names should be, and pending schema

 Ok, the patch not to add functions.

> better
>
>     ...(): encoding name too long

 Fixed.

 I found new bug in command/variable.c in parse_client_encoding(), nobody
probably never see this error:

if (pg_set_client_encoding(encoding))
{
	elog(ERROR, "Conversion between %s and %s is not supported",
                     value, GetDatabaseEncodingName());
}

because pg_set_client_encoding() returns -1 for error and 0 as true.
It's fixed too.

 IMHO it can be apply.

		Karel
PS:

    * following files are renamed:

src/utils/mb/Unicode/KOI8_to_utf8.map  -->
        src/utils/mb/Unicode/koi8r_to_utf8.map

src/utils/mb/Unicode/WIN_to_utf8.map  -->
        src/utils/mb/Unicode/win1251_to_utf8.map

src/utils/mb/Unicode/utf8_to_KOI8.map -->
        src/utils/mb/Unicode/utf8_to_koi8r.map

src/utils/mb/Unicode/utf8_to_WIN.map -->
        src/utils/mb/Unicode/utf8_to_win1251.map

   * new file:

src/utils/mb/encname.c

   * removed file:

src/utils/mb/common.c

--
 Karel Zak  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/

 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
2001-09-06 04:57:30 +00:00
Bruce Momjian 50aa3020ac Add missing files. 2001-09-06 03:58:59 +00:00
Bruce Momjian 04c1f72920 PAM authentication:
> pam_strerror() should be used a few more times, rather than just saying
> "Error!".  Also, the configure.in snippet seems wrong.  You add
> -I$pam_prefix/include/security to $INCLUDES and then you #include
> <security/pam_appl.h>.  This whole thing is probably unnecessary, since
> PAM is a system library on the systems where it exists, so the headers
> and libraries are found automatically, unlike OpenSSL and
> Kerberos.

See attached revised patch. (I'm sure the configure.in stuff can be done
right/better, I'm just not enough of a autoconf guru to know what to
change it to.)

Dominic J. Eidson
2001-09-06 03:23:38 +00:00
Bruce Momjian 2a34134b6c - new to_char(interval, text)
- new millisecond (ms) and microsecond (us) support
 - more robus parsing from string - used is separator checking for
   non-exact formats like to_date('2001-9-1', 'YYYY-MM-DD')
 - SGML docs are included

Karel Zak
2001-09-06 03:22:42 +00:00
Bruce Momjian 57040f78f7 Attached is a patch for JDBC's getColumn() function that was broken /
flawed in the following ways:

1. Only returned columns that had a default value defined, rather than all
columns in a table
2. Used 2 * N + 1 queries to find out attributes, comments and typenames
for N columns.

By using some outer join syntax it is possible to retrieve all necessary
information in just one SQL statement. This means this version is only
suitable for PostgreSQL >= 7.1. Don't know whether that's a problem.

I've tested this function with current sources and 7.1.3 and patched both
jdbc1 and jdbc2. I haven't compiled nor tested the jdbc1 version though, as
I have no JDK 1.1 available.

Note the discussion in http://fts.postgresql.org/db/mw/msg.html?mid=1029626
regarding differences in obtaining comments on database object in 7.1 and
7.2. I was unable to use the following syntax (or similar ones):

select
     ...,
     description
from
     ...
     left outer join col_description(a.attrelid, a.attnum) description
order by
     c.relname, a.attnum;

(the error was parse error at or near '(') so I had to paste the actual
code for the col_description function into the left outer join. Maybe
someone who is more knowledgable about outer joins might provide me with a
better SQL statement.

Jeroen van Vianen
2001-09-06 03:20:30 +00:00
Bruce Momjian 0b71596fdd This fixes clashing defines of ERROR. On win32, winapi.h is included, which
includes windows.h, which #defines ERROR to 0. PostgreSQL's logging functions
define ERROR to -1. This patch redefines ERROR to -1 to avoid current or
future breakage of the logging functions.

Gerhard H?ring
2001-09-06 03:18:12 +00:00
Bruce Momjian e9f546365f > > I sent this to -hackers and peter_e, but thought it ought to go to
> > -patches as well.
>
> The -Bdynamic probably ought to disappear.

That was there already, but I have no objections.  I was trying to
make minimal changes.

Larry Rosenman
2001-09-06 03:16:46 +00:00
Bruce Momjian 56b102a96e This fixes the regression test .so builds on sysv5 systems:
I believe this will fix peter_e's problen with gcc.

Larry Rosenman
2001-09-06 03:15:43 +00:00
Bruce Momjian e30b283f30 Attached is my attempt to clean up the horrors of the ExecSQL() method in
the JDBC driver.

I've done this by extracting it into a new method object called
QueryExecutor (should go into org/postgresql/core/) and then taking it
apart into different methods in that class.

A short summary:

* Extracted ExecSQL() from Connection into a method object called
  QueryExecutor.

* Moved ReceiveFields() from Connection to QueryExecutor.

* Extracted parts of the original ExecSQL() method body into smaller
  methods on QueryExecutor.

* Bug fix: The instance variable "pid" in Connection was used in two
  places with different meaning. Both were probably in dead code, but it's
  fixed anyway.

Anders Bengtsson
2001-09-06 03:13:34 +00:00
Bruce Momjian d99794e613 Attached is a patch for current CVS, consisting of a cvs diff -c
for the changed files and a few new files:
- test/jdbc2/BatchExecuteTest.java
- util/MessageTranslator.java
- jdbc2/PBatchUpdateException.java

As an aside, is this the best way to submit a patch consisting
of both changed and new files? Or is there a smarter cvs command
which gets them all in one patch file?

This patch fixes batch processing in the JDBC driver to be
JDBC-2 compliant. Specifically, the changes introduced by this
patch are:

1) Statement.executeBatch() no longer commits or rolls back a
transaction, as this is not prescribed by the JDBC spec. Its up
to the application to disable autocommit and to commit or
rollback the transaction. Where JDBC talks about "executing the
statements as a unit", it means executing the statements in one
round trip to the backend for better performance, it does not
mean executing the statements in a transaction.

2) Statement.executeBatch() now throws a BatchUpdateException()
as required by the JDBC spec. The significance of this is that
the receiver of the exception gets the updateCounts of the
commands that succeeded before the error occurred. In order for
the messages to be translatable, java.sql.BatchUpdateException
is extended by org.postgresql.jdbc2.PBatchUpdateException() and
the localization code is factored out from
org.postgresql.util.PSQLException to a separate singleton class
org.postgresql.util.MessageTranslator.

3) When there is no batch or there are 0 statements in the batch
when Statement.executeBatch() is called, do not throw an
SQLException, but silently do nothing and return an update count
array of length 0. The JDBC spec says "Throws an SQLException if
the driver does not support batch statements", which is clearly
not the case. See testExecuteEmptyBatch() in
BatchExecuteTest.java for an example. The message
postgresql.stat.batch.empty is removed from the language
specific properties files.

4) When Statement.executeBatch() is performed, reset the
statement's list of batch commands to empty. The JDBC spec isn't
100% clear about this. This behaviour is only documented in the
Java tutorial
(http://java.sun.com/docs/books/tutorial/jdbc/jdbc2dot0/batchupdates.html).
Note that the Oracle JDBC driver also resets the statement's
list in executeBatch(), and this seems the most reasonable
interpretation.

5) A new test case is added to the JDBC test suite which tests
various aspects of batch processing. See the new file
BatchExecuteTest.java.

Regards,
Ren? Pijlman
2001-09-06 03:11:59 +00:00
Bruce Momjian e5d3df2019 Apply jdbc error changes. 2001-09-06 03:07:27 +00:00
Bruce Momjian 914eec7d3b Sync up jdbc error files. 2001-09-06 03:03:37 +00:00
Bruce Momjian 02566f14f4 On Sat, Aug 25, 2001 at 08:15:45PM -0400, Bruce Momjian wrote:
> Can someone research this and figure out what the proper solution for
> this is?  Seems we are going around in circles if we keep
> adding/removing DLLIMPORT.

I believe that the attached patch is the correct solution --  I apologize
for the gyrations.  With the attached patch, Cygwin libpq++ builds
cleanly again.  The root cause was that DLLIMPORT was defaulting to
__declspec(dllimport) since BUILDING_DLL was *not* defined when building
the libpq++ DLL.

Unfortunately, to test my patch requires changing the following makefile:

    src/interfaces/libpq++/examples/Makefile

and the #includes in all of the *.cc to build against the source tree
instead of the following hardcoded installation directory structure:

    /usr/local/pgsql

I was able to manually build

    src/interfaces/libpq++/examples/testlibpq0.exe

against my Cygwin libpq++ without errors.  However, I have not tried to
actually test testlibpq0.exe.

Is this sufficient?  Or, do you want me to clean up libpq++/examples too?
(Or, is it silly to even ask? :,))  Let me know how you want to proceed and
I will submit a patch to pgsql-patches.

Jason Tishler
2001-09-06 02:58:33 +00:00
Bruce Momjian 16910e44de Next version of patch.
Now with documentation update and disabling of UTF conversion for Tcl <=8.0

On Fri, 24 Aug 2001, Vsevolod Lobko wrote:

> On Thu, 23 Aug 2001, Tom Lane wrote:
>
> > > Is this looks better?
> >
> > It does, but one small gripe: the lack of semicolons will probably cause
> > pg_indent to mess up the indentation.  (I know emacs' autoindent mode
> > will not work nicely with it, either.)  Please set up the macros so that
> > you write
> >
> >                         UTF_BEGIN;
> >                         Tcl_DStringAppend(&unknown_src, UTF_E2U(part), -1);
> >                         UTF_END;
> >
> > and then I'll be happy.
>
> Attached revised patch
>
> > Your point about overhead is a good one, so I retract the gripe about
> > using a configure switch.  But please include documentation patches to
> > describe the configure option in the administrator's guide (installation
> > section).
>
> This patch still uses configure switch for enabling feature.
>
> For enabling based on tcl version we have 2 posibilites:
>  1) having feature enabled by default, but in pltcl.c check for tcl
>     version and disable it for old versions
>  2) enable or disable at configure time based on tcl version, but there
>     are problem - current configure don't checks for tcl version at all
>     and my configure skills not enought for adding this
>

Vsevolod Lobko
2001-09-06 02:56:32 +00:00
Bruce Momjian 37c0b64875 Below is the patch against current cvs for libpgtcl and
two additional files win32.mak and libpgtcl.def.
This patch allows to compile libpgtcl.dll on Windows
with tcl > 8.0. I've tested it on WinNT (VC6.0), SUSE Linux (7.0)
and Solaris 2.6 with tcl 8.3.3.

Mikhail Terekhov
2001-09-06 02:54:56 +00:00
Bruce Momjian ee0ef05b8d Hello, i just reviewed the win32 errno patch and i saw that maybe i didn't
really played it totally safe in my last suggestion, the system table might
pick up the msg but not the netmsg.dll, so better try both.
I also added a hex printout of the "errno" appended to all messages, that's
nicer.

If anyone hate my coding style, or that i'm using goto constructs, just tell
me, and i'll rework it into a nested if () thing.

Magnus Naeslund(f)
2001-09-06 02:52:00 +00:00
Tom Lane 6c91eef7b7 Fix handling of pg_type.typdefault per bug report from Dave Blasby.
If there's anyone out there who's actually using datatype-defined
default values, this will be an incompatible change in behavior ...
but the old behavior was so broken that I doubt anyone was using it.
2001-09-06 02:07:42 +00:00
Tom Lane f2b604ecf4 Add some debugging details to some of the elog(STOP) conditions for WAL.
Standardize on %X/%X as the formatting for XLOG position display --- we
had a couple of different formats before, and none of 'em were as useful
as hex offsets IMHO.
2001-09-06 02:02:48 +00:00
Bruce Momjian c2ed891512 Overhaul ecpg manual page.
Update Italian jdbc error messages.
2001-09-06 00:23:42 +00:00
Tom Lane 763554393a Fix code so that we recover cleanly if there are no free semaphores
available in freeSemMap.  As noted by Tatsuo, this is now a likely
scenario for detecting MaxBackends-exceeded; if MaxBackends is a multiple
of PROC_NSEMS_PER_SET then we will fail here and not in sinval.c.  The
cleanup path did not work correctly before, anyway.
2001-09-04 21:42:17 +00:00
Tom Lane 936114a019 Fix comment, add Assert. 2001-09-04 19:12:05 +00:00
Tom Lane bc1a61a30d Fix typo. 2001-09-04 19:05:59 +00:00
Peter Eisentraut 2c3bd9e8f3 /usr/local/bin/perl => /usr/bin/perl 2001-09-04 11:41:04 +00:00
Bruce Momjian 5840db21fb Add back incremental patch for BSD indent. 2001-09-04 03:34:42 +00:00
Bruce Momjian 7e13743299 pg_restore option is {c|t}, not {c|f}. Pointed out by someone on IRC.
"  -F {c|t}                 specify backup file format\n"
2001-09-04 03:20:29 +00:00
Tom Lane b553cba15a Clean up the lock state properly when aborting because of early deadlock
detection in ProcSleep().  Bug noted by Tomasz Zielonka --- how did this
escape detection for this long??
2001-09-04 02:26:57 +00:00
Peter Eisentraut 3c59a9e3b7 Bring references to ipcclean in sync with reality. 2001-09-04 00:22:34 +00:00
Peter Eisentraut 309401a7b6 Fix misscanning of """" (an identifier consisting of one double-quote). 2001-09-04 00:19:39 +00:00
Bruce Momjian e5390263ed Add patch for 0LL for BSD indent/pgindent. 2001-09-03 23:11:20 +00:00
Peter Eisentraut 69c52c8e5b Put pgstat internal files into $PGDATA/global. 2001-09-03 12:00:00 +00:00
Peter Eisentraut daac2d0ce3 Parse the arguments of \connect as SQL identifiers, so that they expose
the expected behavior in mixed-case situations.

bug report from James Pattie, 2001-08-31
2001-09-02 23:52:19 +00:00
Peter Eisentraut 60ce9e9279 New blood and fresh air for tutorial 2001-09-02 23:27:50 +00:00
Peter Eisentraut 68e5360018 Convert some fprintf's to elog's. 2001-08-30 19:02:42 +00:00
Peter Eisentraut 11193c8a20 For INSERTs, one can now tab complete DEFAULT VALUES.
from Liam Stewart
2001-08-30 13:17:03 +00:00
Peter Eisentraut b1a38a4380 Install the SQL command man pages into a section appropriate for each
system.  Some systems did not understand the 'l' section, and in general
it wasn't entirely appropriate.

On SCO OpenServer, the man pages won't be installed at all until someone
figures out their man system.
2001-08-29 19:14:40 +00:00
Peter Eisentraut f45b7270b6 Whoops, wrong logic. 2001-08-29 11:54:12 +00:00
Peter Eisentraut dd225655b9 Change the conditionals so the mips + gcc code here doesn't apply for Irix.
The code in s_lock.h should get used.

report from Bruno Mattarollo <bruno@web1.greenpeace.org>
2001-08-28 15:04:27 +00:00
Peter Eisentraut f5944af8ba Include directory rearrangement
Client headers are no longer in a subdirectory, since they have been made
namespace-clean.

Internal libpq headers are in a private subdirectory.

Server headers are in a private subdirectory.  pg_config has a new option
to point there.
2001-08-28 14:20:28 +00:00
Hiroshi Inoue 3fcea502c4 Fix a wrong error handling. 2001-08-28 05:52:13 +00:00
Tom Lane 9d4a45e25c Avoid #ifdef inside printf() ... that loses on platforms where printf()
is a macro.
2001-08-28 02:47:18 +00:00
Tom Lane 7d66bf261c Add some minimal exercising of functional-index feature to regression
tests.
2001-08-27 23:23:35 +00:00
Tom Lane c92b450891 Suppress definitions of 'true' and 'false' macros if __cplusplus.
Since we're assuming a C++ compiler knows what 'bool' is, seems we
should assume it knows 'true' and 'false' too.  This prevents problems
on some systems, per report from Leandro Fanzone.
2001-08-27 23:02:25 +00:00
Tom Lane 814f40cf43 Use a cursor for fetching data in -d or -D mode, so that pg_dump doesn't
run out of memory with large tables in these modes.  Patch from
Martijn van Oosterhout.
2001-08-27 20:33:07 +00:00
Tom Lane 545c6696a6 Fix confusion over static-ness of a subroutine. 2001-08-27 20:03:38 +00:00
Tom Lane 5163394659 Remove unneeded/unportable extern. 2001-08-27 20:02:10 +00:00
Tom Lane d15a118a21 Quick-hack solution to regproc/oid issue was not the right solution. 2001-08-27 01:09:59 +00:00
Tom Lane ceca2a7d14 Un-break pg_dump --- pg_class.indproc is now regproc not oid, which
for some reason displays a zero oid differently.  Possibly we should
revert that schema change, but it's easy to make pg_dump accept both
spellings so I'll do that for now.
2001-08-27 00:44:40 +00:00
Peter Eisentraut 87c5e0fa56 Do not install the odbc header files, per discussion on odbc list. 2001-08-27 00:38:55 +00:00
Peter Eisentraut 42ae4f2940 Turn on plpython build by default if we have something that looks like a
shared library, or we can do without one.
2001-08-27 00:29:49 +00:00
Hiroshi Inoue af70014686 Fix a complie error on Windows platform. 2001-08-27 00:18:03 +00:00
Peter Eisentraut 34fd50880f VPATH and DESTDIR support for PL/Perl, using the same techniques employed
in interfaces/perl5 a brief while ago.

Also, since building PL/Perl without a shared libperl actually works on
some platforms we can enable it there to get some development happening.
I've only checked off linux right now, but others should be added in the
future.
2001-08-26 23:54:41 +00:00
Peter Eisentraut ef7152f99b Put the right runpath to libpq into the Perl module shared object on more
platforms and without relinking.

Also support VPATH builds and DESTDIR installs.  One hopes.
2001-08-26 22:28:04 +00:00
Bruce Momjian 3d162c0d1a Please pull this patch. It breaks JDBC1 support. The JDBC1 code no
longer compiles, due to objects being referenced in this patch that do
not exist in JDK1.1.

Barry Lind
---------------------------------------------------------------------------

The JDBC driver requires

  permission java.net.SocketPermission "host:port", "connect";

in the policy file of the application using the JDBC driver
in the postgresql.jar file.  Since the Socket() call in the
driver is not protected by AccessController.doPrivileged() this
permission must also be granted to the entire application.
2001-08-26 17:08:48 +00:00
Tom Lane bc7d37a525 Transaction IDs wrap around, per my proposal of 13-Aug-01. More
documentation to come, but the code is all here.  initdb forced.
2001-08-26 16:56:03 +00:00
Bruce Momjian e87a5ed1e0 Add single-letter encryption options for createuser. Update createuser --help. 2001-08-26 04:19:46 +00:00
Bruce Momjian 5863d541ae Put createuser ENCRYPTED/UNENCRYPTED in the proper place in the query. 2001-08-26 03:46:58 +00:00
Bruce Momjian 19a251d0ec >>>>The JDBC driver requires
>>>>
>>>> permission java.net.SocketPermission "host:port", "connect";
>>>>
>>>>in the policy file of the application using the JDBC driver
>>>>in the postgresql.jar file.  Since the Socket() call in the
>>>>driver is not protected by AccessController.doPrivileged() this
>>>>permission must also be granted to the entire application.
>>>>
>>>>The attached diff fixes it so that the connect permission can be
>>>>restricted just the the postgresql.jar codeBase if desired.

David Daney
2001-08-26 01:06:20 +00:00
Bruce Momjian 1be615f381 Here is a patch to the resultmap to make the regression tests work on
OU8.

Larry Rosenman
2001-08-26 00:55:15 +00:00
Bruce Momjian f478692552 The attached file: SerializePatch2.tgz, contains a patch for
org.postgresql.util.Serialize and org.postgresql.jdbc2.PreparedStatement
that  fixes the ability to "serialize" a simple java class into a
postgres table.

The current cvs seems completely broken in this support, so the patch
puts it  into working condition, granted that there are many limitations
with  serializing java classes into Postgres.

The code to do serialize appears to have been in the driver since
Postgres  6.4, according to some comments in the source.  My code is not
adding any  totally new ability to the driver, rather just fixing what
is there so that  it actually is usable.  I do not think that it should
affect any existing  functions of the driver that people regularly
depend on.

The code is activated if you use jdbc2.PreparedStatement and try to
setObject  some java class type that is unrecognized, like not String or
not some other  primitive type.  This will cause a sequence of function
calls that results in  an instance of Serialize being instantiated for
the class type passed.  The  Serialize constructor will query pg_class
to see if it can find an existing  table that matches the name of the
java class. If found, it will continue and  try to use the table to
store the object, otherwise an SQL exception is  thrown and no harm is
done.  Serialize.create() has to be used to setup the  table for a java
class before anything can really happen with this code other  than an
SQLException (unless by some freak chance a table exists that it  thinks
it can use).

I saw a difference in Serialize.java between 7.1.3 and 7.2devel that I
didn't  notice before, so I had to redo my changes from the 7.2devel
version (why I  had to resend this patch now).  I was missing the
fixString stuff, which is  nice and is imporant to ensure the inserts
will not fail due to embedded  single quote or unescaped backslashes. I
changed that fixString function in  Serialize just a little since there
is no need to muddle with escaping  newlines: only escaping single quote
and literal backslashes is needed.  Postgres appears to insert newlines
within strings without trouble.
2001-08-26 00:54:42 +00:00
Tom Lane ca86791a61 Fix portability problem in new CLOG code, per report from Rene Pijlman. 2001-08-25 23:24:39 +00:00
Bruce Momjian a263e39bec Re-apply Array.java patch to new Array.java file to fix compile. 2001-08-25 21:08:24 +00:00