OSDN Git Service

pg-rex/syncrep.git
22 years agoBug #1: attribute name when column is type cast:
Bruce Momjian [Mon, 10 Sep 2001 14:53:10 +0000 (14:53 +0000)]
Bug #1: attribute name when column is type cast:

Given the following table:

test=# \d f
          Table "f"
 Column |  Type   | Modifiers
--------+---------+-----------
 i      | integer |
 test   | text    |

If I do the following:

test=# insert into f values(1,'test');
INSERT 139549 1
test=# select i::int8,test from f;
 ?column? | test
----------+------
        1 | test
(1 row)

It doesn't make much sense that the first column should be called
'?column?'.

The patch results in the output appearing like this:

test=# select i::int8,test from f;
 i | test
---+------
 1 | test
(1 row)

----------

Gavin Sherry

22 years ago> NOTE: in the command.c in three places there (I believe) is a typo:
Bruce Momjian [Mon, 10 Sep 2001 14:51:33 +0000 (14:51 +0000)]
> NOTE: in the command.c in three places there (I believe) is a typo:
>
> "parse error at [the] end of line"
>
> Attached patch also fixes it. I noticed this while editing the po file.
> If I'm wrong, please ignore the command.c.patch. I will revert my translation
> as well then.
>
> --
> Serguei A. Mokhov

22 years agoThe attached patch should be sufficient to fix libpgtcl. It requires
Bruce Momjian [Mon, 10 Sep 2001 14:49:12 +0000 (14:49 +0000)]
The attached patch should be sufficient to fix libpgtcl. It requires
PostgreSQL to support unicode-conversion, but retains binary
compatibility among Tcl versions.

However, it neither checks at compile time not at runtime, if support
for unicode-conversion does really exist and it doesn't prevent the
user from changing the client encoding after initialization. I think
there should be warnings about this somewhere in the documentation.

Reinhard Max

22 years agoChange dialog windows.
Hiroshi Inoue [Mon, 10 Sep 2001 10:13:30 +0000 (10:13 +0000)]
Change dialog windows.

22 years ago1) Fix SQLForeignKeys() in multibyte mode.
Hiroshi Inoue [Mon, 10 Sep 2001 08:53:27 +0000 (08:53 +0000)]
1) Fix SQLForeignKeys() in multibyte mode.
2) Fix a bug with NUMERIC scale in case of Parse
  statement option.
3) Remove a no longer needed loop in CC_send_query().

Hiroshi Inoue

22 years agoShort version of install procedure fails due to lacking chown.
Tatsuo Ishii [Mon, 10 Sep 2001 08:46:46 +0000 (08:46 +0000)]
Short version of install procedure fails due to lacking chown.

22 years agoThe usage of kill is incorrect (lacks "data"). Anyway we should use
Tatsuo Ishii [Mon, 10 Sep 2001 07:17:01 +0000 (07:17 +0000)]
The usage of kill is incorrect (lacks "data"). Anyway we should use
pg_ctl instead.

22 years agoFix typo. split does not produce ".".
Tatsuo Ishii [Mon, 10 Sep 2001 07:11:28 +0000 (07:11 +0000)]
Fix typo. split does not produce ".".

22 years agoFix typo.
Tatsuo Ishii [Mon, 10 Sep 2001 06:35:34 +0000 (06:35 +0000)]
Fix typo.

22 years agoExample program lacks RETURN
Tatsuo Ishii [Mon, 10 Sep 2001 06:30:43 +0000 (06:30 +0000)]
Example program lacks RETURN

22 years agoFix typo.
Tatsuo Ishii [Mon, 10 Sep 2001 05:57:22 +0000 (05:57 +0000)]
Fix typo.

22 years agoFix typo.
Tatsuo Ishii [Mon, 10 Sep 2001 05:46:41 +0000 (05:46 +0000)]
Fix typo.

22 years agoFix initlocation messages
Tatsuo Ishii [Mon, 10 Sep 2001 05:20:23 +0000 (05:20 +0000)]
Fix initlocation messages

22 years agoRemove INV_ARCHIVE mention in python readme.
Bruce Momjian [Mon, 10 Sep 2001 04:21:14 +0000 (04:21 +0000)]
Remove INV_ARCHIVE mention in python readme.

22 years agoRemove INV_ARCHIVE mention in perl.
Bruce Momjian [Mon, 10 Sep 2001 04:19:19 +0000 (04:19 +0000)]
Remove INV_ARCHIVE mention in perl.

22 years agoRemove mention of INV_ARCHIVE.
Bruce Momjian [Mon, 10 Sep 2001 04:15:41 +0000 (04:15 +0000)]
Remove mention of INV_ARCHIVE.

22 years agofix typo.
Tatsuo Ishii [Mon, 10 Sep 2001 03:02:06 +0000 (03:02 +0000)]
fix typo.

22 years agoAdd missing ';'
Tatsuo Ishii [Mon, 10 Sep 2001 02:46:18 +0000 (02:46 +0000)]
Add missing ';'

22 years agoUpdate TODO list.
Bruce Momjian [Mon, 10 Sep 2001 02:02:37 +0000 (02:02 +0000)]
Update TODO list.

22 years agoUpdate TODO list.
Bruce Momjian [Mon, 10 Sep 2001 00:14:29 +0000 (00:14 +0000)]
Update TODO list.

22 years agoMarkup additions and spell check. (covers Admin Guide)
Peter Eisentraut [Sun, 9 Sep 2001 23:52:12 +0000 (23:52 +0000)]
Markup additions and spell check. (covers Admin Guide)

22 years agoMarkup additions and spell check. (covers User's Guide)
Peter Eisentraut [Sun, 9 Sep 2001 17:21:59 +0000 (17:21 +0000)]
Markup additions and spell check. (covers User's Guide)

22 years agoAdd -U, -P, -C options. See README.pgbench for more details.
Tatsuo Ishii [Sun, 9 Sep 2001 03:15:56 +0000 (03:15 +0000)]
Add -U, -P, -C options. See README.pgbench for more details.

22 years agoBackout Karel's patch
Tatsuo Ishii [Sun, 9 Sep 2001 01:15:11 +0000 (01:15 +0000)]
Backout Karel's patch

22 years agofix markup
Peter Eisentraut [Sat, 8 Sep 2001 16:46:34 +0000 (16:46 +0000)]
fix markup

22 years agoImprove declare/fetch mode a little.
Hiroshi Inoue [Sat, 8 Sep 2001 16:20:16 +0000 (16:20 +0000)]
Improve declare/fetch mode a little.
Add a new DSN option for PREPARE hadling.

Hiroshi Inoue

22 years agoApply 7.1.3 changes to the current tree also.
Hiroshi Inoue [Sat, 8 Sep 2001 16:15:28 +0000 (16:15 +0000)]
Apply 7.1.3 changes to the current tree also.

22 years agoMake the world somewhat safe for (not from) DELETE FROM pg_shadow;
Peter Eisentraut [Sat, 8 Sep 2001 15:24:00 +0000 (15:24 +0000)]
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).

22 years ago> > A simple and robus solution is in the begin of mbutils.c set default
Bruce Momjian [Sat, 8 Sep 2001 14:30:15 +0000 (14:30 +0000)]
> >  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

22 years agoMove updateCommon() into Win32 block because it is only used there.
Bruce Momjian [Sat, 8 Sep 2001 02:48:53 +0000 (02:48 +0000)]
Move updateCommon() into Win32 block because it is only used there.

22 years agoUpdate TODO list.
Bruce Momjian [Sat, 8 Sep 2001 02:42:53 +0000 (02:42 +0000)]
Update TODO list.

22 years agoResolve compile errors on unix.
Hiroshi Inoue [Sat, 8 Sep 2001 02:28:41 +0000 (02:28 +0000)]
Resolve compile errors on unix.
Rename psqlodbc.def -> psqlodbc_win32.def.
Improve internal *declare cursor* handling
a little.

Hiroshi Inoue

22 years agoClean up some confusion about where and how to set whereToSendOutput.
Tom Lane [Sat, 8 Sep 2001 01:10:21 +0000 (01:10 +0000)]
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.

22 years agoMove TESTSUITE file to test/README.
Bruce Momjian [Fri, 7 Sep 2001 23:34:16 +0000 (23:34 +0000)]
Move TESTSUITE file to test/README.

22 years agoChange addlit() to not assume its input is null-terminated, so that we
Tom Lane [Fri, 7 Sep 2001 23:17:14 +0000 (23:17 +0000)]
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.

22 years agoAttached is a patch that fixes 2 test cases of the JDBC test
Bruce Momjian [Fri, 7 Sep 2001 22:17:48 +0000 (22:17 +0000)]
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

22 years agoRead transactions don't work on 7.0.x db's 2nd patch
Bruce Momjian [Fri, 7 Sep 2001 22:17:02 +0000 (22:17 +0000)]
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

22 years agoPatch for jdbc2 ResultSet.java. Looks like performance improvement.
Bruce Momjian [Fri, 7 Sep 2001 22:15:55 +0000 (22:15 +0000)]
Patch for jdbc2 ResultSet.java.  Looks like performance improvement.

Joseph Shraibman

22 years agoI've attached the fixed version of the patch below. After the
Bruce Momjian [Fri, 7 Sep 2001 22:02:32 +0000 (22:02 +0000)]
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

22 years agoHere is my much-promised patch to let people add UNIQUE constraints after
Bruce Momjian [Fri, 7 Sep 2001 21:57:53 +0000 (21:57 +0000)]
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

22 years ago>has anyone ever successfully done copy to/from stdout with the
Bruce Momjian [Fri, 7 Sep 2001 21:55:00 +0000 (21:55 +0000)]
>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

22 years agoAdd Java testsuite info.
Bruce Momjian [Fri, 7 Sep 2001 21:45:42 +0000 (21:45 +0000)]
Add Java testsuite info.

22 years agoUpdate SGML with new hostnames for CVS and CVSup.
Bruce Momjian [Fri, 7 Sep 2001 21:36:46 +0000 (21:36 +0000)]
Update SGML with new hostnames for CVS and CVSup.

22 years agoCreate pgjindent for java.
Bruce Momjian [Fri, 7 Sep 2001 21:25:44 +0000 (21:25 +0000)]
Create pgjindent for java.

22 years agoRevert treatment of NOTIFY in rules to its pre-7.1 behavior: notify will
Tom Lane [Fri, 7 Sep 2001 20:52:31 +0000 (20:52 +0000)]
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.

22 years agoAdd CRED alignment for NetBSD.
Bruce Momjian [Fri, 7 Sep 2001 19:59:04 +0000 (19:59 +0000)]
Add CRED alignment for NetBSD.

22 years agoUpdate SCM_CREDS for Net/Free/BSD-OS. Add configure checks.
Bruce Momjian [Fri, 7 Sep 2001 19:52:54 +0000 (19:52 +0000)]
Update SCM_CREDS for Net/Free/BSD-OS.  Add configure checks.

22 years agoUpdate TODO list.
Bruce Momjian [Fri, 7 Sep 2001 18:50:07 +0000 (18:50 +0000)]
Update TODO list.

22 years agoEnable SIGTERM and SIGQUIT during client authentication so
Jan Wieck [Fri, 7 Sep 2001 16:12:49 +0000 (16:12 +0000)]
Enable SIGTERM and SIGQUIT during client authentication so
the postmaster can kill the forked off processes when shutdown
is requested.

Jan

22 years agoRemove file, per Karel.
Bruce Momjian [Fri, 7 Sep 2001 15:14:16 +0000 (15:14 +0000)]
Remove file, per Karel.

22 years agoRemove variable length macros used in debugging, per Karel.
Bruce Momjian [Fri, 7 Sep 2001 15:01:45 +0000 (15:01 +0000)]
Remove variable length macros used in debugging, per Karel.

22 years agoRemove unused files for Karel's patch.
Bruce Momjian [Fri, 7 Sep 2001 14:17:17 +0000 (14:17 +0000)]
Remove unused files for Karel's patch.

22 years agoRemove common.c, removed in Karal's patch.
Bruce Momjian [Fri, 7 Sep 2001 14:00:25 +0000 (14:00 +0000)]
Remove common.c, removed in Karal's patch.

22 years ago1) Most driver options could be set per DSN.
Hiroshi Inoue [Fri, 7 Sep 2001 06:02:24 +0000 (06:02 +0000)]
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

22 years agoAdd missing files.
Tatsuo Ishii [Fri, 7 Sep 2001 03:32:11 +0000 (03:32 +0000)]
Add missing files.

22 years agoRevise overflow test in int84() to avoid codegen bug in some older
Tom Lane [Fri, 7 Sep 2001 01:33:44 +0000 (01:33 +0000)]
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.

22 years agoUpdate TODO list.
Bruce Momjian [Fri, 7 Sep 2001 01:29:50 +0000 (01:29 +0000)]
Update TODO list.

22 years agoUpdate tab completion for \d*.
Bruce Momjian [Fri, 7 Sep 2001 01:24:18 +0000 (01:24 +0000)]
Update tab completion for \d*.

22 years agoFix a number of places where pg_dump was careless about explicitly
Tom Lane [Fri, 7 Sep 2001 01:11:50 +0000 (01:11 +0000)]
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.

22 years agoUpdate FAQ.
Bruce Momjian [Fri, 7 Sep 2001 00:51:10 +0000 (00:51 +0000)]
Update FAQ.

22 years agoMissed a few places that referred to a compile-time limit on
Tom Lane [Fri, 7 Sep 2001 00:46:42 +0000 (00:46 +0000)]
Missed a few places that referred to a compile-time limit on
max_connections.

22 years agoUpdate FAQ.
Bruce Momjian [Fri, 7 Sep 2001 00:46:00 +0000 (00:46 +0000)]
Update FAQ.

22 years agoUpdate FAQ.
Bruce Momjian [Fri, 7 Sep 2001 00:45:14 +0000 (00:45 +0000)]
Update FAQ.

22 years agoGet rid of PID entries in shmem hash table; there is no longer any need
Tom Lane [Fri, 7 Sep 2001 00:27:30 +0000 (00:27 +0000)]
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.

22 years ago>Well, if it is that easy, I can do it. Patch attached and applied.
Bruce Momjian [Thu, 6 Sep 2001 20:43:39 +0000 (20:43 +0000)]
>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>

22 years agoUpdate transactions for nested idea.
Bruce Momjian [Thu, 6 Sep 2001 20:41:30 +0000 (20:41 +0000)]
Update transactions for nested idea.

22 years agoUpdate TODO list.
Bruce Momjian [Thu, 6 Sep 2001 20:40:05 +0000 (20:40 +0000)]
Update TODO list.

22 years agoUpdate TODO list.
Bruce Momjian [Thu, 6 Sep 2001 20:37:14 +0000 (20:37 +0000)]
Update TODO list.

22 years agoUpdate TODO list.
Bruce Momjian [Thu, 6 Sep 2001 20:11:07 +0000 (20:11 +0000)]
Update TODO list.

22 years agoOn Mon, 3 Sep 2001 22:01:17 -0500, you wrote:
Bruce Momjian [Thu, 6 Sep 2001 18:26:37 +0000 (18:26 +0000)]
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>

22 years agoUpdate TODO list.
Bruce Momjian [Thu, 6 Sep 2001 16:59:45 +0000 (16:59 +0000)]
Update TODO list.

22 years agoAdd mutex test.
Bruce Momjian [Thu, 6 Sep 2001 16:51:12 +0000 (16:51 +0000)]
Add mutex test.

22 years agoUpdate TODO list.
Bruce Momjian [Thu, 6 Sep 2001 16:50:40 +0000 (16:50 +0000)]
Update TODO list.

22 years agoAdd to syntax error reporting.
Bruce Momjian [Thu, 6 Sep 2001 16:30:46 +0000 (16:30 +0000)]
Add to syntax error reporting.

22 years ago> The win32.mak and libpgtcl.def files had been lost (patch doesn't handle
Bruce Momjian [Thu, 6 Sep 2001 15:20:19 +0000 (15:20 +0000)]
> 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

22 years agoAdd -rpath for BSD/OS, from Peter E.
Bruce Momjian [Thu, 6 Sep 2001 13:43:42 +0000 (13:43 +0000)]
Add -rpath for BSD/OS, from Peter E.

22 years ago> Patch applied. Thanks.
Bruce Momjian [Thu, 6 Sep 2001 12:53:15 +0000 (12:53 +0000)]
> 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

22 years agoRussian translation from Serguei Mokhov
Peter Eisentraut [Thu, 6 Sep 2001 11:10:47 +0000 (11:10 +0000)]
Russian translation from Serguei Mokhov

22 years agoTo fix the perpetually broken makefiles in the contrib tree, I have
Peter Eisentraut [Thu, 6 Sep 2001 10:49:30 +0000 (10:49 +0000)]
To fix the perpetually broken makefiles in the contrib tree, I have
written a generic framework of rules that the contrib makefiles can
use instead of writing their own each time.  You only need to set a few
variables and off you go.

22 years agoMove the "how to write a PL call handler" parts from the CREATE LANGUAGE
Peter Eisentraut [Thu, 6 Sep 2001 10:28:39 +0000 (10:28 +0000)]
Move the "how to write a PL call handler" parts from the CREATE LANGUAGE
man page to the Programmer's Guide.

22 years agoFix Karel's patch. Suggested by Eiji Tokuya
Tatsuo Ishii [Thu, 6 Sep 2001 05:01:38 +0000 (05:01 +0000)]
Fix Karel's patch. Suggested by Eiji Tokuya

22 years agoCommit Karel's patch.
Tatsuo Ishii [Thu, 6 Sep 2001 04:57:30 +0000 (04:57 +0000)]
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

22 years agoAdd missing files.
Bruce Momjian [Thu, 6 Sep 2001 03:58:59 +0000 (03:58 +0000)]
Add missing files.

22 years agoUpdate TODO list.
Bruce Momjian [Thu, 6 Sep 2001 03:46:09 +0000 (03:46 +0000)]
Update TODO list.

22 years agoPAM authentication:
Bruce Momjian [Thu, 6 Sep 2001 03:23:38 +0000 (03:23 +0000)]
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

22 years ago - new to_char(interval, text)
Bruce Momjian [Thu, 6 Sep 2001 03:22:42 +0000 (03:22 +0000)]
 - 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

22 years agoThis makes encrypt() parser more strict.
Bruce Momjian [Thu, 6 Sep 2001 03:21:39 +0000 (03:21 +0000)]
This makes encrypt() parser more strict.

Marko Kreen

22 years agoAttached is a patch for JDBC's getColumn() function that was broken /
Bruce Momjian [Thu, 6 Sep 2001 03:20:30 +0000 (03:20 +0000)]
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

22 years agoThis fixes clashing defines of ERROR. On win32, winapi.h is included, which
Bruce Momjian [Thu, 6 Sep 2001 03:18:12 +0000 (03:18 +0000)]
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

22 years ago> > I sent this to -hackers and peter_e, but thought it ought to go to
Bruce Momjian [Thu, 6 Sep 2001 03:16:46 +0000 (03:16 +0000)]
> > 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

22 years agoThis fixes the regression test .so builds on sysv5 systems:
Bruce Momjian [Thu, 6 Sep 2001 03:15:43 +0000 (03:15 +0000)]
This fixes the regression test .so builds on sysv5 systems:
I believe this will fix peter_e's problen with gcc.

Larry Rosenman

22 years agoAttached is my attempt to clean up the horrors of the ExecSQL() method in
Bruce Momjian [Thu, 6 Sep 2001 03:13:34 +0000 (03:13 +0000)]
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

22 years agoAttached is a patch for current CVS, consisting of a cvs diff -c
Bruce Momjian [Thu, 6 Sep 2001 03:11:59 +0000 (03:11 +0000)]
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

22 years agoApply jdbc error changes.
Bruce Momjian [Thu, 6 Sep 2001 03:07:27 +0000 (03:07 +0000)]
Apply jdbc error changes.

22 years agoSync up jdbc error files.
Bruce Momjian [Thu, 6 Sep 2001 03:03:37 +0000 (03:03 +0000)]
Sync up jdbc error files.

22 years agoOn Sat, Aug 25, 2001 at 08:15:45PM -0400, Bruce Momjian wrote:
Bruce Momjian [Thu, 6 Sep 2001 02:58:33 +0000 (02:58 +0000)]
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

22 years agoNext version of patch.
Bruce Momjian [Thu, 6 Sep 2001 02:56:32 +0000 (02:56 +0000)]
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

22 years agoBelow is the patch against current cvs for libpgtcl and
Bruce Momjian [Thu, 6 Sep 2001 02:54:56 +0000 (02:54 +0000)]
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

22 years agoHello, i just reviewed the win32 errno patch and i saw that maybe i didn't
Bruce Momjian [Thu, 6 Sep 2001 02:52:00 +0000 (02:52 +0000)]
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)

22 years agoFix handling of pg_type.typdefault per bug report from Dave Blasby.
Tom Lane [Thu, 6 Sep 2001 02:07:42 +0000 (02:07 +0000)]
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.