Commit Graph

14498 Commits

Author SHA1 Message Date
Tom Lane 80727ce14f Use stat(2) to probe for existing xlog segments in InstallXLogFileSegment,
rather than actually opening the files.  This eliminates some corner cases
where the file indeed exists but open() fails for another reason, such
as being out of file descriptors.  The net reliability gain is probably
tiny, since xlog.c is full of other file open calls that will elog(PANIC)
if they fail for any reason; but this specific failure mode has been
observed in the field, so we may as well fix it.
2003-01-25 03:06:04 +00:00
Tom Lane 7a196bab23 Suppress gcc warnings. 2003-01-24 21:53:29 +00:00
Tom Lane f5e83662d0 Modify planner's implied-equality-deduction code so that when a set
of known-equal expressions includes any constant expressions (including
Params from outer queries), we actively suppress any 'var = var'
clauses that are or could be deduced from the set, generating only the
deducible 'var = const' clauses instead.  The idea here is to push down
the restrictions implied by the equality set to base relations whenever
possible.  Once we have applied the 'var = const' clauses, the 'var = var'
clauses are redundant, and should be suppressed both to save work at
execution and to avoid double-counting restrictivity.
2003-01-24 03:58:44 +00:00
Peter Eisentraut ef7422510e Grant options, and cascading revoke. Grant options are allowed only for
users right now, not groups.  Extension of has_foo_privileges functions to
query the grant options.  Extension of aclitem type to store grantor.
2003-01-23 23:39:07 +00:00
Dave Cramer aa78ca3a95 added fix from Joel Hock to get the inserted row into the current buffer 2003-01-23 18:49:22 +00:00
Tom Lane 36777c1e35 Fix obsolete error message (isImmutable doesn't exist). 2003-01-23 15:18:40 +00:00
Tom Lane 790d5bc992 Change CREATE TABLE AS / SELECT INTO to create the new table with OIDs,
for backwards compatibility with pre-7.3 behavior.  Per discussion on
pgsql-general and pgsql-hackers.
2003-01-23 05:10:41 +00:00
Tom Lane 742403bdad Update 'Mathematical Functions' table to reflect 7.3 addition of float8
forms of ceil(), floor(), sign().  Back-patch this and other recent
doc fixes in this file to the 7.3 branch.
2003-01-23 01:22:59 +00:00
Tom Lane b3d7af46a9 Fix sloppy comment. 2003-01-22 20:44:20 +00:00
Tom Lane c4d0ff32e9 Make estimation of mergejoin scan selectivities more robust, per recent
example from RaÇl GutiÅrrez.
2003-01-22 20:16:42 +00:00
Tom Lane c7b4047234 Improve print_expr() a little. It's still not very bright though. 2003-01-22 19:26:35 +00:00
Tom Lane e2114817c7 Implement choice between hash-based and sort-based grouping for doing
DISTINCT processing on the output of an IN sub-select.
2003-01-22 00:07:00 +00:00
Tom Lane a4482f4c4c Fix coredump problem in plpgsql's RETURN NEXT. When a SELECT INTO
that's selecting into a RECORD variable returns zero rows, make it
assign an all-nulls row to the RECORD; this is consistent with what
happens when the SELECT INTO target is not a RECORD.  In support of
this, tweak the SPI code so that a valid tuple descriptor is returned
even when a SPI select returns no rows.
2003-01-21 22:06:12 +00:00
Michael Meskes f8d8266ac5 Synced parser. 2003-01-21 20:01:12 +00:00
Tom Lane 1a7c6ee8c6 Avoid gratuitous variation in spelling of same error message. 2003-01-21 19:44:26 +00:00
Peter Eisentraut 980acc8329 Fix sed expression for BSD sed. 2003-01-21 10:11:52 +00:00
Tom Lane bdfbfde1b1 IN clauses appearing at top level of WHERE can now be handled as joins.
There are two implementation techniques: the executor understands a new
JOIN_IN jointype, which emits at most one matching row per left-hand row,
or the result of the IN's sub-select can be fed through a DISTINCT filter
and then joined as an ordinary relation.
Along the way, some minor code cleanup in the optimizer; notably, break
out most of the jointree-rearrangement preprocessing in planner.c and
put it in a new file prep/prepjointree.c.
2003-01-20 18:55:07 +00:00
Bruce Momjian be2b660ecd This patch includes a lot of minor cleanups to the SGML documentation,
including:

- replacing all the appropriate usages of <citetitle>PostgreSQL
...</citetitle> with &cite-user;, &cite-admin;, and so on

- fix an omission in the EXECUTE documentation

- add some more text to the EXPLAIN documentation

- improve the PL/PgSQL RETURN NEXT documentation (more work to do here)

- minor markup fixes


Neil Conway
2003-01-19 00:13:31 +00:00
Bruce Momjian 2042daf5c3 Improve symlink handling for C tags file. 2003-01-18 06:06:51 +00:00
Bruce Momjian d12be5c37b Add section on testing index scan. 2003-01-17 17:15:14 +00:00
Bruce Momjian 3c731e0ed7 Add dash to:
set-returning functions or SRF's.

for clarity.
2003-01-17 03:28:18 +00:00
Tom Lane b19adc1aae Fix parse_agg.c to detect ungrouped Vars in sub-SELECTs; remove code
that used to do it in planner.  That was an ancient kluge that was
never satisfactory; errors should be detected at parse time when possible.
But at the time we didn't have the support mechanism (expression_tree_walker
et al) to make it convenient to do in the parser.
2003-01-17 03:25:04 +00:00
Tom Lane a4d82dd4b4 Adjust API of expression_tree_mutator and query_tree_mutator to
simplify callers.  It turns out the common case is that the caller
does want to recurse into sub-queries, so push support for that into
these subroutines.
2003-01-17 02:01:21 +00:00
Tom Lane 227a404cf4 Add code to print information about a detected deadlock cycle. The
printed data is comparable to what you could read in the pg_locks view,
were you fortunate enough to have been looking at it at the right time.
2003-01-16 21:01:45 +00:00
Tom Lane 136828c699 Ooops, didn't cut-and-paste quite enough code from ResolveNew;
with result that flatten_join_alias_vars failed to descend into subselects.
2003-01-16 18:26:02 +00:00
Tom Lane 57ce0f84f2 Fix bogus formatting of DROP DATABASE command, per Christopher Kings-Lynne. 2003-01-16 15:27:59 +00:00
Tom Lane cb23b8415b Repair an embarrassingly large number of alphabetization mistakes in the
datetime token tables.  Even more embarrassing, the regression tests
revealed some of the problems --- but evidently the bogus output wasn't
questioned.  Add code to postmaster startup to directly check the tables
for correct ordering, in hopes of not being embarrassed like this again.
2003-01-16 00:26:49 +00:00
Peter Eisentraut 828822bc96 Add remaining documentation tables to information schema. 2003-01-15 23:37:28 +00:00
Tom Lane cde9f852e0 Now that switch_outer processing no longer relies on being run after
join_references(), it's practical to consolidate all join_references()
processing into the set_plan_references traversal in setrefs.c.  This
seems considerably cleaner than the old way where we did it for join
quals in createplan.c and for targetlists in setrefs.c.
2003-01-15 23:10:32 +00:00
Bruce Momjian 606d4f7b38 Oops, put back changes. Those were Peter's, not mine. 2003-01-15 21:55:52 +00:00
Bruce Momjian 57a15288a1 Revert my changes to features.sgml. 2003-01-15 21:44:35 +00:00
Bruce Momjian 0c64b58b6c More comment cleanups for shared_buffers in postgresql.conf. 2003-01-15 20:49:56 +00:00
Bruce Momjian 20803fa3d2 Update shared_buffer comment in postgresql.conf. 2003-01-15 20:41:18 +00:00
Bruce Momjian 4b874036c2 Back out ORDER BY addition to Inet, for Tom. 2003-01-15 20:01:01 +00:00
Tom Lane de97072e3c Allow merge and hash joins to occur on arbitrary expressions (anything not
containing a volatile function), rather than only on 'Var = Var' clauses
as before.  This makes it practical to do flatten_join_alias_vars at the
start of planning, which in turn eliminates a bunch of klugery inside the
planner to deal with alias vars.  As a free side effect, we now detect
implied equality of non-Var expressions; for example in
	SELECT ... WHERE a.x = b.y and b.y = 42
we will deduce a.x = 42 and use that as a restriction qual on a.  Also,
we can remove the restriction introduced 12/5/02 to prevent pullup of
subqueries whose targetlists contain sublinks.
Still TODO: make statistical estimation routines in selfuncs.c and costsize.c
smarter about expressions that are more complex than plain Vars.  The need
for this is considerably greater now that we have to be able to estimate
the suitability of merge and hash join techniques on such expressions.
2003-01-15 19:35:48 +00:00
Bruce Momjian 0eed62f34d Reorder VARCHAR() to appear before CHAR() in docs. 2003-01-15 18:01:05 +00:00
Bruce Momjian d14c64c4a3 This patch fixes an incorrect statement and makes a few cleanups to
contrib/fulltextindex/README.fti

Backpatched to 7.3.X too.

Neil Conway
2003-01-15 16:45:17 +00:00
Bruce Momjian 3b6ca54cda This patch includes some minor fixes and improvements to the SGML docs
for PL/PgSQL.

Neil Conway
2003-01-15 16:40:24 +00:00
Bruce Momjian ecbd8daaac Add ORDER BY for inet regression, pointed out by Rod Taylor. 2003-01-15 16:35:50 +00:00
Peter Eisentraut 2160c9177d Add sql_features table to information schema. Generate the features list
in the documentation from that same data.
2003-01-14 23:19:34 +00:00
Bruce Momjian 1eddbd81fa Readd #include netinet/in.h for FreeBSD. 2003-01-14 22:52:57 +00:00
Peter Eisentraut 97f0d0c86f Escape ampersand. 2003-01-14 10:19:02 +00:00
Barry Lind 56e6436c3a Bumped up build number to 200 2003-01-14 09:42:07 +00:00
Barry Lind feefc329bd Patch from Florian Wunderlich to correctly support java Timestamps. Previously
the code would only capture milliseconds where as both postgres and the java
Timestamp object support greater resolution.
Also fixed a bug reported by Rhett Sutphin where the last digit of the
fractional seconds was lost when using timestamp without time zone

 Modified Files:
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
 	jdbc/org/postgresql/test/jdbc2/TimestampTest.java
2003-01-14 09:13:51 +00:00
Barry Lind 9db065ba56 Patch from Aaron Mulder to have pooled connections implement PGConnection
Modified Files:
 	jdbc/org/postgresql/jdbc2/optional/PooledConnectionImpl.java
 	jdbc/org/postgresql/test/jdbc2/optional/BaseDataSourceTest.java
2003-01-14 05:46:49 +00:00
Barry Lind 88e524063a Patch from Kris Jurka to improve the performance of getImportedKeys().
Use explicit joins to avoid using the genetic query optimizer.  Also fixed
a regression test that was failing to compile.  This change also cleans up
how key names are reported as per:
A change to the value of the FK_NAME column.  Currently the returned value
is the triggers arguments which look like

"<unnamed>\000t2\000t1\000UNSPECIFIED\000a\000a\000"

This was required for server versions < 7.3 when a user did not supply
constraint names.  Every constraint was named "<unnamed>"
.  7.3 has enforced unique constraint names per table so unnamed foreign
keys will have different names "$1", "$2" and so on.  I've used logic
along the lines of the following to preserve the unique names in the
original scheme, but allow people who go to the trouble of naming their
constraints to see them:

if (triggerargs.startsWith("<unnamed>")) {
	fkname = [the whole ugly trigger args name originally used];
} else {
	fkname = [the actual fk name];
}

 Modified Files:
 	jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
 	jdbc/org/postgresql/test/jdbc2/optional/ConnectionPoolTest.java
2003-01-14 05:05:26 +00:00
Bruce Momjian 956762a546 Add:
> 	o Allow PL/PgSQL to support array element assignment
2003-01-14 00:47:35 +00:00
Bruce Momjian 4e9face69a Add Hugarian FAQ, from Laszlo Hornyak 2003-01-13 23:00:32 +00:00
Tom Lane 1e9f85b9f6 Fix information_schema.sql install to work when building outside
source tree.
2003-01-13 20:37:18 +00:00
Tom Lane 56e1aab286 Reconsider mechanism for marking sub-selects that are at top level of
a qualification clause (and hence can get away with being sloppy about
distinguishing FALSE from UNKNOWN).  We need to know this in subselect.c;
marking the subplans in setrefs.c is too late.
2003-01-13 18:10:53 +00:00