Tom Lane [Wed, 7 Apr 2004 18:17:25 +0000 (18:17 +0000)]
Extend set-operation planning to keep track of the sort ordering induced
by the set operation, so that redundant sorts at higher levels can be
avoided. This was foreseen a good while back, but not done. Per request
from Karel Zak.
Tom Lane [Wed, 7 Apr 2004 17:42:28 +0000 (17:42 +0000)]
build_subquery_pathkeys() was examining wrong copy of subquery target list,
causing it to fail to recognize the output ordering of subqueries that
contain set operations (UNION/INTERSECT/EXPECT). Per example from Karel Zak.
Bruce Momjian [Wed, 7 Apr 2004 05:05:50 +0000 (05:05 +0000)]
> >>1. change the type of "log_statement" option from boolean to string,
> >>with allowed values of "all, mod, ddl, none" with default "none".
OK, here is a patch that implements #1. Here is sample output:
test=> set client_min_messages = 'log';
SET
test=> set log_statement = 'mod';
SET
test=> select 1;
?column?
----------
1
(1 row)
test=> update test set x=1;
LOG: statement: update test set x=1;
ERROR: relation "test" does not exist
test=> update test set x=1;
LOG: statement: update test set x=1;
ERROR: relation "test" does not exist
test=> copy test from '/tmp/x';
LOG: statement: copy test from '/tmp/x';
ERROR: relation "test" does not exist
test=> copy test to '/tmp/x';
ERROR: relation "test" does not exist
test=> prepare xx as select 1;
PREPARE
test=> prepare xx as update x set y=1;
LOG: statement: prepare xx as update x set y=1;
ERROR: relation "x" does not exist
test=> explain analyze select 1;;
QUERY PLAN
------------------------------------------------------------------------------------
Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.006..0.007 rows=1 loops=1)
Total runtime: 0.046 ms
(2 rows)
test=> explain analyze update test set x=1;
LOG: statement: explain analyze update test set x=1;
ERROR: relation "test" does not exist
test=> explain update test set x=1;
ERROR: relation "test" does not exist
It checks PREPARE and EXECUTE ANALYZE too. The log_statement values are
'none', 'mod', 'ddl', and 'all'. For 'all', it prints before the query
is parsed, and for ddl/mod, it does it right after parsing using the
node tag (or command tag for CREATE/ALTER/DROP), so any non-parse errors
will print after the log line.
Tom Lane [Tue, 6 Apr 2004 18:46:03 +0000 (18:46 +0000)]
Support FULL JOIN with no join clauses, such as X FULL JOIN Y ON TRUE.
That particular corner case is not exactly compelling, but given 7.4's
ability to discard redundant join clauses, it is possible for the situation
to arise from queries that are not so obviously silly. Per bug report
of 6-Apr-04.
Tom Lane [Tue, 6 Apr 2004 16:39:30 +0000 (16:39 +0000)]
ALTER SEQUENCE RESTART did the wrong thing if sequence last_value was
equal to the desired restart value (must clear is_called, did not).
Per bug report #1127 from Piotr Konieczny.
Bruce Momjian [Tue, 6 Apr 2004 13:21:33 +0000 (13:21 +0000)]
The attached applied patch throws an error if the delimiter appears in
the COPY NULL string:
test=> copy pg_language to '/tmp/x' with delimiter '|';
COPY
test=> copy pg_language to '/tmp/x' with delimiter '|' null '|x';
ERROR: COPY delimiter must not appear in the NULL specification
test=> copy pg_language from '/tmp/x' with delimiter '|' null '|x';
ERROR: COPY delimiter must not appear in the NULL specification
It also throws an error if it conflicts with the default NULL string:
test=> copy pg_language to '/tmp/x' with delimiter '\\';
ERROR: COPY delimiter must not appear in the NULL specification
test=> copy pg_language to '/tmp/x' with delimiter '\\' NULL 'x';
COPY
Bruce Momjian [Mon, 5 Apr 2004 03:11:39 +0000 (03:11 +0000)]
This is a cleanup patch for access/transam/xact.c. It only removes some
#ifdef NOT_USED code, and adds a new TBLOCK state which signals the fact
that StartTransaction() has been executed.
Bruce Momjian [Mon, 5 Apr 2004 02:48:09 +0000 (02:48 +0000)]
Improve handling of GUC USERLIMIT variables by reorganizing code. Also,
handle new postgresql.conf values with SIGHUP better by better enforcing
USERLIMIT settings on existing non-super-user backends.
Tom Lane [Fri, 2 Apr 2004 23:14:08 +0000 (23:14 +0000)]
check_sql_fn_retval has always thought that we supported doing
'SELECT foo()' in a SQL function returning a rowtype, to simply pass
back the results of another function returning the same rowtype.
However, that hasn't actually worked in many years. Now it works again.
Tom Lane [Thu, 1 Apr 2004 21:59:45 +0000 (21:59 +0000)]
Adjust expected regression outputs for plan changes caused by recent
'fuzzy cost comparison' patch. Mea culpa for not having noticed this
when I committed the patch.
Tom Lane [Thu, 1 Apr 2004 21:28:47 +0000 (21:28 +0000)]
Replace TupleTableSlot convention for whole-row variables and function
results with tuples as ordinary varlena Datums. This commit does not
in itself do much for us, except eliminate the horrid memory leak
associated with evaluation of whole-row variables. However, it lays the
groundwork for allowing composite types as table columns, and perhaps
some other useful features as well. Per my proposal of a few days ago.
1. In keeping with the recent discussion that there should be more
said about views, stored procedures, and triggers, in the tutorial, I
have added a bit of verbiage to that end.
2. Some formatting changes to the datetime discussion, as well as
addition of a citation of a relevant book on calendars.
Bruce Momjian [Tue, 30 Mar 2004 21:58:20 +0000 (21:58 +0000)]
1. In keeping with the recent discussion that there should be more
said about views, stored procedures, and triggers, in the tutorial, I
have added a bit of verbiage to that end.
2. Some formatting changes to the datetime discussion, as well as
addition of a citation of a relevant book on calendars.
Teodor Sigaev [Tue, 30 Mar 2004 15:45:33 +0000 (15:45 +0000)]
Cleanup vectors of GISTENTRY and eliminate problem with 64-bit strict-aligned
boxes. Change interface to user-defined GiST support methods union and
picksplit. Now instead of bytea struct it used special GistEntryVector
structure.
Tom Lane [Mon, 29 Mar 2004 19:58:04 +0000 (19:58 +0000)]
Use fuzzy comparison of path costs in add_path(), so that paths with the
same path keys and nearly equivalent costs will be considered redundant.
The exact nature of the fuzziness may get adjusted later based on current
discussions, but no one has shot a hole in the basic idea yet ...
Tom Lane [Sat, 27 Mar 2004 00:24:28 +0000 (00:24 +0000)]
Now that we are allowing index opclasses to contain operators that are
only stable and not immutable, pred_test_simple_clause has to guard
against making invalid deductions. Add a test for immutability of
the selected test_op.
Teodor Sigaev [Thu, 25 Mar 2004 16:56:10 +0000 (16:56 +0000)]
1 Minimize memory allocation for void (but not null) value.
2 Add silly ordering for ts_vector to aim grouping, union, except etc. Don't use BTree opclass (tsvector_ops).
Tom Lane [Wed, 24 Mar 2004 23:38:49 +0000 (23:38 +0000)]
Add a more useful error message for the case where someone tries to pass
a whole row or record variable into a SQL function. Eventually this case
should be made to actually work, but for now this is better than what it
did before.
Tom Lane [Wed, 24 Mar 2004 22:40:29 +0000 (22:40 +0000)]
Replace max_expr_depth parameter with a max_stack_depth parameter that
is measured in kilobytes and checked against actual physical execution
stack depth, as per my proposal of 30-Dec. This gives us a fairly
bulletproof defense against crashing due to runaway recursive functions.
Bruce Momjian [Wed, 24 Mar 2004 04:04:51 +0000 (04:04 +0000)]
Here's a patch implementing the "thread method" to workaround the bug
with socket calls in signal handlers (APC) on Win32. See details in mail
to pgsql-hackers-win32 a couple of minutes ago.
Neil Conway [Wed, 24 Mar 2004 03:22:35 +0000 (03:22 +0000)]
Fix some whitespace formatting, and remove an overly-verbose
parameter description: postgresql.conf is not the place for
documentating the functionality of a GUC var.
Bruce Momjian [Wed, 24 Mar 2004 03:10:29 +0000 (03:10 +0000)]
>>Also, what is the default connection mode of psql? It should probably be
>>equivalent to "-h localhost", shouldn't it?
>>
>>
>
>Now that is something I had not thought of. Seems we can assume a Win32
>psql can never use unix domain sockets, so defaulting that to localhost
>is a good solution too.
Bruce Momjian [Tue, 23 Mar 2004 21:39:46 +0000 (21:39 +0000)]
When changing select() calls for delays into pg_usleep(), two comments
in s_lock.c were not updated, and still refers to select. Made my grep
hit the wrong files, so I figured a simple patch was in order.. (other
refs in the same comment block was changed..)
Tom Lane [Tue, 23 Mar 2004 19:35:17 +0000 (19:35 +0000)]
Upgrade ALTER TABLE DROP COLUMN so that it can drop an OID column, and
remove separate implementation of ALTER TABLE SET WITHOUT OIDS in favor
of doing a regular DROP. Also, cause CREATE TABLE to account completely
correctly for the inheritance status of the OID column. This fixes
problems with dropping OID columns that have dependencies, as noted by
Christopher Kings-Lynne, as well as making sure that you can't drop an
OID column that was inherited from a parent.
Neil Conway [Tue, 23 Mar 2004 02:47:35 +0000 (02:47 +0000)]
Improve the locale and character set docs, add some <xref>s pointing
to the character set docs where appropriate, and improve the postmaster
reference page. Character set cross-refs suggested by Gavin Kistner.
Tom Lane [Tue, 23 Mar 2004 01:23:48 +0000 (01:23 +0000)]
Replace the virtual_host and tcpip_socket parameters with a unified
listen_addresses parameter, as per recent discussion. The default behavior
is now to listen on localhost, which eliminates the need for the -i
postmaster switch in many scenarios.
Tom Lane [Mon, 22 Mar 2004 23:55:29 +0000 (23:55 +0000)]
Before deciding we can use a socket for statistics collection, test to
ensure that it actually passes data. This catches cases such as a kernel
packet filter rule that makes the socket useless.