Commit Graph

26856 Commits

Author SHA1 Message Date
Peter Eisentraut e1bdd07c3c Add localization support to ecpg.
Author: Euler Taveira de Oliveira <euler@timbira.com>
2008-05-16 15:20:04 +00:00
Bruce Momjian 4eb0900768 Done:
PL/pgSQL

> 	o -Add CASE capability to language (already in SQL)
2008-05-16 02:23:44 +00:00
Tom Lane 8282d6fc70 Persuade GIN to react to control-C in a reasonable amount of time
while building a GIN index.
2008-05-16 01:27:06 +00:00
Tom Lane b62f246fb0 Support SQL/PSM-compatible CASE statement in plpgsql.
Pavel Stehule
2008-05-15 22:39:49 +00:00
Tom Lane 0fdb350cae Add code to eval_const_expressions() to support const-simplification of
CoerceViaIO nodes.  This improves the ability of the planner to deal with
cases where the node input is a constant.  Per bug #4170.
2008-05-15 17:37:49 +00:00
Tom Lane 93c701edc6 Add support for tracking call counts and elapsed runtime for user-defined
functions.

Note that because this patch changes FmgrInfo, any external C functions
you might be testing with 8.4 will need to be recompiled.

Patch by Martin Pihlak, some editorialization by me (principally, removing
tracking of getrusage() numbers)
2008-05-15 00:17:41 +00:00
Tom Lane 3bc25384d7 Move the "instr_time" typedef and associated macros into a new header
file portability/instr_time.h, and add a couple more macros to eliminate
some abstraction leakage we formerly had.  Also update psql to use this
header instead of its own copy of nearly the same code.

This commit in itself is just code cleanup and shouldn't change anything.
It lays some groundwork for the upcoming function-stats patch, though.
2008-05-14 19:10:29 +00:00
Bruce Momjian 719a115874 Reorgnize psql \? help output, to reduce the size of the "General"
heading at the top;   broken into more sections now.
2008-05-14 15:30:22 +00:00
Bruce Momjian 210faf2d5f Fix a few warnings that have crept into CVS HEAD. 2008-05-14 15:16:27 +00:00
Magnus Hagander 9bf1db04c0 Remove the special variable for open_sync_bit used in O_SYNC and O_DSYNC
modes, replacing it with a call to a function that derives it from the
sync_method variable, now that it has distinct values for these two cases.

This means that assign_xlog_sync_method() no longer changes any settings,
thus fixing the bug introduced in the change to use a guc enum for
wal_sync_method.
2008-05-14 14:02:57 +00:00
Magnus Hagander 14e6858ff4 Make the win32 implementation of getrusage() return EINVAL if being
asked for anything other than RUSAGE_SELF, since it's not supported.

This is never called anywhere in the code today, but might be in
the future.

Not backpatching, since it's not called anywhere today.
2008-05-14 07:28:13 +00:00
Bruce Momjian 36f0b1cab7 Remove odd duplicate wording in psql pager section. 2008-05-14 04:07:01 +00:00
Tom Lane 4107478d37 Improve plpgsql's RAISE command. It is now possible to attach DETAIL and
HINT fields to a user-thrown error message, and to specify the SQLSTATE
error code to use.  The syntax has also been tweaked so that the
Oracle-compatible case "RAISE exception_name" works (though you won't get a
very nice error message if you just write that much).  Lastly, support
the Oracle-compatible syntax "RAISE" with no parameters to re-throw
the current error from within an EXCEPTION block.

In passing, allow the syntax SQLSTATE 'nnnnn' within EXCEPTION lists,
so that there is a way to trap errors with custom SQLSTATE codes.

Pavel Stehule and Tom Lane
2008-05-13 22:10:30 +00:00
Magnus Hagander 72e2db86b9 Don't try to close negative file descriptors, since this can cause
crashes on certain platforms. In particular, the MSVC runtime is known
to do this.

Fixes bug #4162, reported and diagnosed by Javier Pimas
2008-05-13 20:53:52 +00:00
Bruce Momjian d82a1d582c This is the patch replace offnum++ by OffsetNumberNext, to be
consistent.  OffsetNumberNext() has some casting that makes it useful.

Fujii Masao
2008-05-13 15:44:08 +00:00
Alvaro Herrera a61b2464fa Change \du to use the new printTable API, improving the situation of very wide
tables.

Brendan Jurd, with some help from me.
2008-05-13 00:23:17 +00:00
Alvaro Herrera e6a64bd3b6 Fix a bug in the previous patch, which caused the title pointer to be used
before it was actually set.
2008-05-13 00:14:11 +00:00
Alvaro Herrera 1e9199e84c Improve psql's internal print.c code by introducing an actual print API.
Provides for better code readability, but mainly this is infrastructure changes
to allow further changes such as arbitrary footers on printed tables.  Also,
the translation status of each element in the table is more easily customized.

Brendan Jurd, with some editorialization by me.
2008-05-12 22:59:58 +00:00
Bruce Momjian 9340c6372f Todo done:
> * -Improve dead row detection during multi-statement transactions usage
2008-05-12 20:50:52 +00:00
Alvaro Herrera 5da9da71c4 Improve snapshot manager by keeping explicit track of snapshots.
There are two ways to track a snapshot: there's the "registered" list, which
is used for arbitrary long-lived snapshots; and there's the "active stack",
which is used for the snapshot that is considered "active" at any time.
This also allows users of snapshots to stop worrying about snapshot memory
allocation and freeing, and about using PG_TRY blocks around ActiveSnapshot
assignment.  This is all done automatically now.

As a consequence, this allows us to reset MyProc->xmin when there are no
more snapshots registered in the current backend, reducing the impact that
long-running transactions have on VACUUM.
2008-05-12 20:02:02 +00:00
Magnus Hagander aa82790fca Fix breakage by the wal_sync_method patch in installations that use
O_DSYNC (specifically this broke all the Windows buildfarm members)
2008-05-12 19:45:23 +00:00
Michael Meskes 1fe8d17128 Check for non-existant connection in prepare statement handling.
Do not close files that weren't opened.
2008-05-12 16:29:04 +00:00
Alvaro Herrera 000086b49c Document that "ROLLBACK TO savepoint" does not un-close cursors. 2008-05-12 16:23:26 +00:00
Alvaro Herrera 9084399782 Put back bufmgr.h in bufpage.h -- it is needed by some macros.
Remove #include bufmgr.h from (most?) source files which already include
bufpage.h.
2008-05-12 16:06:10 +00:00
Magnus Hagander 2739a4e1d2 Report which WAL sync method we are trying to change *to* when it fails,
not which one we had before (that worked, and thus is completley irrelevant)
2008-05-12 14:27:47 +00:00
Magnus Hagander f99760c19f Convert wal_sync_method to guc enum. 2008-05-12 08:35:05 +00:00
Alvaro Herrera f8c4d7db60 Restructure some header files a bit, in particular heapam.h, by removing some
unnecessary #include lines in it.  Also, move some tuple routine prototypes and
macros to htup.h, which allows removal of heapam.h inclusion from some .c
files.

For this to work, a new header file access/sysattr.h needed to be created,
initially containing attribute numbers of system columns, for pg_dump usage.

While at it, make contrib ltree, intarray and hstore header files more
consistent with our header style.
2008-05-12 00:00:54 +00:00
Andrew Dunstan a86a9bf9fe Remaining pieces of fix for contrib makefiles 2008-05-10 15:30:11 +00:00
Tom Lane 125ed6853e Restore psql's former behavior that padding spaces to the right of the last
output column are not emitted.  (That change already caused more noise in
the regression test output files than I would like.)  Provide some needed
editorial help for comments, clean up code formatting.
2008-05-10 03:31:58 +00:00
Bruce Momjian 2cabe2db79 Add URL for:
o Allow an existing index to be marked as a table's primary key
>
> 	  http://archives.postgresql.org/pgsql-hackers/2008-04/msg00500.php
2008-05-10 01:50:51 +00:00
Bruce Momjian d603b3e48a Add to TODO:
> 	o Allow an existing index to be marked as a table's primary key
2008-05-10 01:50:14 +00:00
Bruce Momjian f586e70665 Add URL for:
* Add column to pg_stat_activity that shows the progress of long-running
  commands like CREATE INDEX and VACUUM
>
>   http://archives.postgresql.org/pgsql-patches/2008-04/msg00203.php
>
2008-05-10 01:40:09 +00:00
Bruce Momjian 3c8f87361c Update alternative output regression files for new float8 test of power(). 2008-05-10 01:04:59 +00:00
Bruce Momjian 1526a701c4 Add TODO item:
> 	o Clear table counters on TRUNCATE
>
> 	  http://archives.postgresql.org/pgsql-hackers/2008-04/msg00169.php
2008-05-10 00:33:33 +00:00
Bruce Momjian 1d18d1dd7b TODOs done:
> 	o -Prevent parent tables from altering or dropping constraints
> 	o -Prevent child tables from altering or dropping constraints
2008-05-10 00:25:08 +00:00
Tom Lane cd902b331d Change the rules for inherited CHECK constraints to be essentially the same
as those for inherited columns; that is, it's no longer allowed for a child
table to not have a check constraint matching one that exists on a parent.
This satisfies the principle of least surprise (rows selected from the parent
will always appear to meet its check constraints) and eliminates some
longstanding bogosity in pg_dump, which formerly had to guess about whether
check constraints were really inherited or not.

The implementation involves adding conislocal and coninhcount columns to
pg_constraint (paralleling attislocal and attinhcount in pg_attribute)
and refactoring various ALTER TABLE actions to be more like those for
columns.

Alex Hunsaker, Nikhil Sontakke, Tom Lane
2008-05-09 23:32:05 +00:00
Bruce Momjian f8df836ae3 Adjust power() error messages to be more descriptive. 2008-05-09 21:31:23 +00:00
Andrew Dunstan 3159040627 Improve logic for finding object files on OBJS lines in contrib Makefiles. If this unbreaks buildfarm mastodon, apply everywhere. 2008-05-09 16:01:05 +00:00
Tom Lane 6b1b4641b8 Give a warning if -s switch is used with a non-custom pgbench test.
Also, clean up the code that assigned the scale into :scale variables.
Greg Smith and Tom Lane
2008-05-09 15:53:07 +00:00
Peter Eisentraut d35c56ed9f Add "%option noinput" to the scanners to avoid compiler warnings. GCC 4.3
began to realize that the input() function isn't used and printed warnings.
2008-05-09 15:36:31 +00:00
Bruce Momjian 6e3e60095d Update C comments to mention SQL:2003 handling of power return values. 2008-05-09 15:36:06 +00:00
Heikki Linnakangas c5f42ce8d5 Fix Assert introduced in previous patch. 2008-05-09 15:27:17 +00:00
Heikki Linnakangas f0eb3e5e58 Fix incorrect archive truncation point calculation in the %r recovery_command
parameter. This fixes bug 4137 reported by Wojciech Strzalka, where a WAL
file is deleted too early when starting the recovery of a warm standby server.

Also add a sanity check in pg_standby so that it will refuse to delete anything
earlier than the file being restored, and improve the debug message in case
nothing is deleted.

Simon Riggs. Backpatch to 8.3, which is where %r was introduced.
2008-05-09 14:27:47 +00:00
Tom Lane 706fcbd820 Fix bogus expected output that should have made it quite clear that
something was wrong with that tab patch.
2008-05-09 05:25:54 +00:00
Tom Lane e1435983b8 Fix memory stomp that's turning the whole buildfarm pink: you can't hack up
pg_wcsformat without changing pg_wcssize to match.  Add some comments to
try to make that clearer, and make a couple other minor editorializations.
2008-05-09 05:25:04 +00:00
Bruce Momjian c56b444496 Add to TODO:
>
> * Improve the /contrib installation experience
>
>   http://archives.postgresql.org/pgsql-hackers/2008-04/msg00132.php
2008-05-09 03:58:41 +00:00
Bruce Momjian 4a586bd405 Add regression test for various power expressions with a zero base, and
adjust source code to be more modular.
2008-05-08 22:17:54 +00:00
Bruce Momjian 6b4e9d1654 Have numeric 0 ^ 4.3 return 1, rather than an error, and have 0 ^ 0.0
return 1, rather than error.

This was already the float8 behavior.
2008-05-08 19:25:38 +00:00
Bruce Momjian eabd1b2ee8 Have psql output tab as the proper number of spaces, rather than \x09. 2008-05-08 19:11:36 +00:00
Bruce Momjian 5adf98ae24 Add psql '\pset format wrapped' mode to wrap output to screen width, or
file/pipe output too if \pset columns' is set.

Bryce Nesbitt
2008-05-08 17:04:26 +00:00