Bruce Momjian [Wed, 26 Jun 2002 21:58:56 +0000 (21:58 +0000)]
The attached patch fixes some spelling mistakes, makes the
comments on one of the optimizer functions a lot more
clear, adds a summary of the recent KSQO discussion to the
comments in the code, adds regression tests for the bug with
sequence state Tom fixed recently and another reg. test, and
removes some PostQuel legacy stuff: ExecAppend -> ExecInsert,
ExecRetrieve -> ExecSelect, etc.
Bruce Momjian [Tue, 25 Jun 2002 17:27:20 +0000 (17:27 +0000)]
The attached patch fixes some spelling mistakes, makes the
comments on one of the optimizer functions a lot more
clear, adds a summary of the recent KSQO discussion to the
comments in the code, adds regression tests for the bug with
sequence state Tom fixed recently and another reg. test, and
removes some PostQuel legacy stuff: ExecAppend -> ExecInsert,
ExecRetrieve -> ExecSelect, etc. This was changed because the
elog() messages from this routine are user-visible, so we
should be using the SQL terms.
Barry Lind [Mon, 24 Jun 2002 04:53:05 +0000 (04:53 +0000)]
fixed bug reported by Wolfgang Winter w.winter@logitags.com where historic timestamps which do not have timezone info were being interpreted in local timezone instead of GMT. Also added a check to support timestamp vs. timestamptz in this code
Bruce Momjian [Sun, 23 Jun 2002 21:29:32 +0000 (21:29 +0000)]
It seems that ExecInit/EndIndexScan is leaking some memory...
For example, if I run a query, that uses an index scan, and call
MemoryContextSt ats (CurrentMemoryContext) before ExecutorStart() and
after ExecutorEnd() in ProcessQuery(), I am consistently see ing that
the 'after' call shows 256 bytes more used, then 'before'...
The problem seems to be in ExecEndIndexScan - it does not release
scanstate, ind exstate, indexstate->iss_RelationDescs and indexstate ->
iss_ScanDescs...
Bruce Momjian [Sun, 23 Jun 2002 20:09:23 +0000 (20:09 +0000)]
Update dbsize documentation with:
Copy this directory to contrib/dbsize in your PostgreSQL source tree.
Then just run make; make install. Finally, load the functions into any
database using dbsize.sql.
When computing the size of a table, it does not include TOAST or index
disk space.
Implement SQL99 CREATE CAST and DROP CAST statements.
Also implement alternative forms to expose the PostgreSQL CREATE FUNCTION
features.
Implement syntax for READ ONLY and READ WRITE clauses in SET TRANSACTION.
READ WRITE is already implemented (of course).
Implement syntax for "LIKE table" clause in CREATE TABLE. Should be fairly
easy to complete since it resembles SELECT INTO.
Implement MATCH SIMPLE clause for foreign key definitions. This is explicit
SQL99 syntax for the default behavior, so we now support it :)
Start implementation of shorthand for national character literals in
scanner. For now, just swallow the leading "N", but sometime soon let's
figure out how to pass leading type info from the scanner to the parser.
We should use the same technique for binary and hex bit string literals,
though it might be unusual to have two apparently independent literal
types fold into the same storage type.
Bruce Momjian [Thu, 20 Jun 2002 17:19:08 +0000 (17:19 +0000)]
Here is a patch for Composite and Set returning function support. I made
two small changes to the API since last patch, which hopefully completes
the decoupling of composite function support from SRF specific support.
Bruce Momjian [Thu, 20 Jun 2002 17:09:42 +0000 (17:09 +0000)]
Attached is a regression test patch for SRFs. I based it on the test
scripts that I have been using, minus the C function tests and without
calls to random() -- figured random() wouldn't work too well for a
regression test ;-)
Bruce Momjian [Thu, 20 Jun 2002 16:57:00 +0000 (16:57 +0000)]
> Here's the first doc patch for SRFs. The patch covers general
> information and SQL language specific info wrt SRFs. I've taken to
> calling this feature "Table Fuctions" to be consistent with (at least)
> one well known RDBMS.
Bruce Momjian [Tue, 18 Jun 2002 17:27:58 +0000 (17:27 +0000)]
Change CREATE DATABASE to use DefElem instead of constructing structure
members in gram.y. This is the prefered method for WITH and arbitrary
param/value pairs.
Tom Lane [Sat, 15 Jun 2002 22:06:09 +0000 (22:06 +0000)]
Clean up gcc warnings. Avoid the bad habit of putting externs in .c
files rather than a header file where they belong. Pay some modicum
of attention to picking global routine names that aren't likely to
conflict with surrounding applications.
Bruce Momjian [Sat, 15 Jun 2002 20:03:51 +0000 (20:03 +0000)]
Patch for current_schemas to optionally include implicit ...
Second cut attached. This one just adds a boolean option to the existing
function to indicate that implicit schemas are to be included (or not).
I remembered the docs as well this time :-)
Bruce Momjian [Sat, 15 Jun 2002 20:01:31 +0000 (20:01 +0000)]
PATCH SSL_pending() checks in libpq/fe-misc.c:
I am no longer pursuing a total non-blocking implementation. I haven't
found a good way to test it with the type of work that I do with
PostgreSQL. I do use blocking SSL sockets with this mod and have had no
problem whatsoever. The bug that I fixed in this patch is exceptionally
hard to reproduce reliably.
Bruce Momjian [Sat, 15 Jun 2002 19:54:24 +0000 (19:54 +0000)]
This patch wraps all accesses to t_xmin, t_cmin, t_xmax, and t_cmax in
HeapTupleHeaderData in setter and getter macros called
HeapTupleHeaderGetXmin, HeapTupleHeaderSetXmin etc.
It also introduces a "virtual" field xvac by defining
HeapTupleHeaderGetXvac and HeapTupleHeaderSetXvac. Xvac is used by
VACUUM, in fact it is stored in t_cmin.
Bruce Momjian [Sat, 15 Jun 2002 19:52:56 +0000 (19:52 +0000)]
The normal operation of our servers is to have tcpip_sockets enabled,
but occasionally I may need to shut down the server and restart it
w/o tcpip sockets. Postmaster has the -i option to turn on tcpip
connections, but it wasn't immediately clear how to easily or
temporarily turn it off (when it's been enabled in postgresql.conf).
In fact, it wasn't clear to me until digging in to postmaster.c that
I could pass '-c tcpip_socket=false' or '--tcpip_socket=false'.
(And then of course when I looked more closely at the man page I
realized I'd missed the proper part of the documentation.) What I'd
been looking for is a flag that would have the opposite effect of
'-i', and it's conceivable that others will be looking for specific
flags to do the opposite of '-F' and '-S'.
I was preparing to add options to postmaster until I realized that
maybe the solution is just to add some documentation.
If you'd rather have 1 character options to accomplish this, I'd be
happy to do that-- adding those 9 lines of code is definitely within
my ability. :) (Although, the "right" letter to be the opposite of -S
isn't clear to me, since -s is already taken.)
Bruce Momjian [Sat, 15 Jun 2002 19:39:33 +0000 (19:39 +0000)]
The macaddr datatype understands most formats of MAC address, except 12
hex digits with no separators, eg 00AABBCCDDEE. This is easily remedied
with the following patch (against 7.2.1):
Bruce Momjian [Sat, 15 Jun 2002 19:37:48 +0000 (19:37 +0000)]
Noted with versions 7.0.3, 7.1.3, and 7.2.1:
The psql interpreter becomes unstable if variable substitutions
are used. The debugger GDB was unable to help however mpatrol
reports that the sprintf at mainloop.c:389 is steping one byte
farther than the allocation.
Bruce Momjian [Sat, 15 Jun 2002 19:34:51 +0000 (19:34 +0000)]
On Wed, 2002-05-29 at 01:41, Tom Lane wrote:
>
> > Is it a good idea to provide an example (such as the above), or should I
> > just try and describe the behaviour?
>
> Examples are generally good things ...
OK, the attached documentation patch provides some simple examples of
use of tablename as a parameter, %ROWTYPE and %TYPE.
In the end I decided that the documentation is literally correct, but
hard to follow without any examples explicitly showing the use of a
table name as a parameter.
Bruce Momjian [Sat, 15 Jun 2002 19:30:40 +0000 (19:30 +0000)]
The method PgLargeObject::LOid() is missing an implementation in the .cc
file.
The program seems to compile ok, but when linking a program that uses
the call,
g++ chokes with an undefined reference error.
If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------
I include the code:
Bruce Momjian [Sat, 15 Jun 2002 18:49:29 +0000 (18:49 +0000)]
This patch fixes a few minor problems with libpq++: remove the deprecated
PQExec(" ") in the wrapper around PQnotifies(), fix the Makefile for
the examples so that they will actually compile properly (with the
exception of #5, which depends on internal headers), make a minor change
to libpq++.h so that "make examples" now works on my machine, update
some documentation, fix some grammatical problems, and remove some of
the more hideous comments.
Add LOCALTIME and LOCALTIMESTAMP functions per SQL99 standard.
Remove ODBC-compatible empty parentheses from calls to SQL99 functions
for which these parentheses do not match the standard.
Update the ODBC driver to ensure compatibility with the ODBC standard
for these functions (e.g. CURRENT_TIMESTAMP, CURRENT_USER, etc).
Include a new appendix in the User's Guide which lists the labeled features
for SQL99 (the labeled features replaced the "basic", "intermediate",
and "advanced" categories from SQL92). features.sgml does not yet split
this list into "supported" and "unsupported" lists.
Search the existing regular expression cache as a ring buffer.
Will optimize the case for repeated calls for the same expression,
which seems to be the most common case. Formerly, always searched
from the first entry.
May want to look at the least-recently-used algorithm to make sure it
is identifying the right slots to reclaim. Seems silly to do math when
it seems that we could simply use an incrementing counter...