Commit Graph

27027 Commits

Author SHA1 Message Date
Joe Conway c0241b9573 When an ERROR happens on a dblink remote connection, take
pains to pass the ERROR message components locally, including
using the passed SQLSTATE. Also wrap the passed info in an
appropriate CONTEXT message. Addresses complaint by Henry
Combrinck. Joe Conway, with much good advice from Tom Lane.
2008-07-03 03:56:57 +00:00
Tom Lane 0a8f6b797a Fix psql's \d and allied commands to work with all server versions back to 7.4.
Guillaume Lelarge, with some additional fixes by me.
2008-07-03 03:37:17 +00:00
Bruce Momjian 2c2aff6acd Update source code comment about when to use gettext_noop(). 2008-07-03 02:49:54 +00:00
Tom Lane c5f4b98fae Fix transaction-lifespan memory leak in xpath(). Report by Matt Magoffin,
fix by Kris Jurka.
2008-07-03 00:04:24 +00:00
Bruce Momjian 1e797d29c3 Documentation patch by Kevin L. McBride explaining GUC lock variables,
which are available if LOCK_DEBUG is defined.
2008-07-01 21:49:04 +00:00
Tom Lane 009a6c9a1a Remove GUC extra_desc strings that are redundant with the enum value lists. 2008-07-01 21:07:33 +00:00
Bruce Momjian 03c4e793e8 Add URL for:
* Add database and transaction-level triggers
2008-07-01 18:26:30 +00:00
Bruce Momjian 16812e339c Add to TODO:
> * Fix TRUNCATE ... RESTART IDENTITY so its affect on sequences is rolled
>   back on transaction abort
2008-07-01 18:09:09 +00:00
Heikki Linnakangas 65919ec949 Move volatility, language, etc. modifiers before function body in the pg_dump
output for CREATE FUNCTION. This makes it easier to read especially if the
function body is long.

Original idea and patch by Greg Sabino Mullane, though this is a stripped
down version of that.
2008-07-01 11:46:48 +00:00
Heikki Linnakangas 3ccb2c590c Extend VacAttrStats to allow typanalyze functions to store statistic values
of different types than the underlying column. The capability isn't yet
used for anything, but will be required by upcoming patch to analyze
tsvector columns.

Jan Urbanski
2008-07-01 10:33:09 +00:00
Magnus Hagander baaad2330b "debug" level was supposed to be hidden, since it's just an alias for debug2. 2008-07-01 06:36:11 +00:00
Magnus Hagander 7b39f488b4 Split apart message_level_options into one set for server-side settings and
one for client-side, restoring the previous behaviour with different
sort order for the 'log' level. Also, remove redundant list of available
options, since the enum code will output it automatically.
2008-07-01 06:08:31 +00:00
Tom Lane 8c3340fe16 Fix identify_system_timezone() so that it tests the behavior of the system
timezone setting in the current year and for 100 years back, rather than
always examining years 1904-2004.  The original coding would have problems
distinguishing zones whose behavior diverged only after 2004; which is a
situation we will surely face sometime, if it's not out there already.

In passing, also prevent selection of the dummy "Factory" timezone, even
if that's exactly what the system is using.  Reporting time as GMT seems
better than that.
2008-07-01 03:40:55 +00:00
Tom Lane 5b965bf08b Teach autovacuum how to determine whether a temp table belongs to a crashed
backend.  If so, send a LOG message to the postmaster log, and if the table
is beyond the vacuum-for-wraparound horizon, forcibly drop it.  Per recent
discussions.  Perhaps we ought to back-patch this, but it probably needs
to age a bit in HEAD first.
2008-07-01 02:09:34 +00:00
Bruce Momjian 92d1cc8973 Issue psql connection warnings on connection start and via \c, per
observation by David Fetter.
2008-07-01 00:08:18 +00:00
Bruce Momjian 6b797c852b Fix recovery.conf boolean variables to take the same range of string
values as postgresql.conf.
2008-06-30 22:10:43 +00:00
Bruce Momjian 5ce521f648 Add psql TODO:
> 	o Add "auto" expanded mode that outputs in expanded format if
> 	  "wrapped" mode can't wrap the output to the screen width
>
> 	  http://archives.postgresql.org/pgsql-hackers/2008-05/msg00417.php
>
2008-06-30 19:45:15 +00:00
Bruce Momjian c96d5df53e Add psql TODO item:
> 	o Add option to wrap column values at whitespace boundaries,
>           rather than chopping them at a fixed width.
> 	  Currently, "wrapped" format chops values into fixed
> 	  widths.  Perhaps the word wrapping could use the same
> 	  algorithm documented in the W3C specification.
> 	  http://archives.postgresql.org/pgsql-hackers/2008-05/msg00404.php
> 	  http://www.w3.org/TR/CSS21/tables.html#auto-table-layout
2008-06-30 19:41:37 +00:00
Teodor Sigaev 8eee65c996 ltree support for multibyte encodings. Patch was made by
laser <laserlist@pgsqldb.com> with some editorization by me.
2008-06-30 18:30:48 +00:00
Heikki Linnakangas 995fb74202 Turn PGBE_ACTIVITY_SIZE into a GUC variable, track_activity_query_size.
As the buffer could now be a lot larger than before, and copying it could
thus be a lot more expensive than before, use strcpy instead of memcpy to
copy the query string, as was already suggested in comments. Also, only copy
the PgBackendStatus struct and string if the slot is in use.

Patch by Thomas Lee, with some changes by me.
2008-06-30 10:58:47 +00:00
Tom Lane 7ea9b997ef Remove unnecessary coziness of GIN code with datum copying. Now that
space is tracked via GetMemoryChunkSpace, there's really no advantage
to duplicating datumCopy's innards here.  This is one bit of my toast
indirection patch that should go in anyway.
2008-06-29 21:04:01 +00:00
Tom Lane 4a8d573cda If pnstrdup is going to be promoted to a generally available function,
it ought to conform to the rest of palloc.h in using Size for sizes.
2008-06-28 16:45:22 +00:00
Tom Lane dcc2334736 Consider a clause to be outerjoin_delayed if it references the nullable side
of any lower outer join, even if it also references the non-nullable side and
so could not get pushed below the outer join anyway.  We need this in case
the clause is an OR clause: if it doesn't get marked outerjoin_delayed,
create_or_index_quals() could pull an indexable restriction for the nullable
side out of it, leading to wrong results as demonstrated by today's bug
report from toruvinn.  (See added regression test case for an example.)

In principle this has been wrong for quite a while.  In practice I don't
think any branch before 8.3 can really show the failure, because
create_or_index_quals() will only pull out indexable conditions, and before
8.3 those were always strict.  So though we might have improperly generated
null-extended rows in the outer join, they'd get discarded from the result
anyway.  The gating factor that makes the failure visible is that 8.3
considers "col IS NULL" to be indexable.  Hence I'm not going to risk
back-patching further than 8.3.
2008-06-27 20:54:37 +00:00
Magnus Hagander f6c1dece9a Fix standalone libpq build on win32.
Hiroshi Saito
2008-06-27 18:58:14 +00:00
Tom Lane 2c2161a47d Improve planner's estimation of the size of an append relation: rather than
taking the maximum of any child rel's width, we should weight the widths
proportionally to the number of rows expected from each child.  In hindsight
this is obviously correct because row width is really a proxy for the total
physical size of the relation.  Per discussion with Scott Carey (bug #4264).
2008-06-27 03:56:55 +00:00
Bruce Momjian f95b5334a7 Mention actual function names in documentation of how to pass binary
values to libpq.
2008-06-27 02:44:31 +00:00
Bruce Momjian 5d747ddd75 Add to TODO:
>
> * Fix system views like pg_stat_all_tables to use set-returning
>   functions, rather than views of per-column functions
2008-06-27 02:38:29 +00:00
Tom Lane 8530c82fc4 Clarify plpgsql documentation by not treating IF THEN ELSE IF ... as a
truly distinct version of IF.  Per suggestion from Marko Kreen.
2008-06-27 01:52:59 +00:00
Tom Lane 623f8a0969 Modify the recently-added probe for -Wl,--as-needed some more, because RHEL-4
vintage Linux is even more broken than we realized: a link to libreadline
will succeed, and fail only at runtime.  It seems that an AC_TRY_RUN test
is the only reliable way to check whether this is really safe.  Per report
from Tatsuo.
2008-06-27 00:36:16 +00:00
Bruce Momjian 68057055f6 Use SGML table to show backslash string escapes, rather than have them
appear in a paragraph.

Andy Anderson
2008-06-26 22:24:42 +00:00
Bruce Momjian 476fad2d91 Add MERGE TODO URL:
>   http://archives.postgresql.org/pgsql-hackers/2008-04/msg01890.php
2008-06-26 19:18:37 +00:00
Bruce Momjian 4688e6d9cb Fix pg_ctl bug where detection of binary location from postmaster.opts
wasn't working.
2008-06-26 18:25:24 +00:00
Teodor Sigaev 5ff9899933 Fix bug "select lower('asd') = 'asd'" returns false with multibyte encoding
and non-C locale. Fix is just to use correct source's length for char2wchar
call.
2008-06-26 16:06:37 +00:00
Michael Meskes 13c843d085 Synced parser 2008-06-26 08:04:05 +00:00
Bruce Momjian 46dd4db31e Add TODO about security:
* Improve server security options

  http://archives.postgresql.org/pgsql-hackers/2008-04/msg01875.php
  http://archives.postgresql.org/pgsql-hackers/2008-05/msg00000.php
2008-06-26 03:58:00 +00:00
Bruce Momjian 9c1d897b94 More FAQ URL updates from Curtis Gallant. 2008-06-26 03:54:28 +00:00
Bruce Momjian 7cc1fb4768 Simplify 'pg_ctl restart' detection of first argument in
postmaster.opts.
2008-06-26 03:51:56 +00:00
Bruce Momjian 54b9a968ed Update FAQ URLs as suggested by Curtis Gallant. 2008-06-26 03:02:27 +00:00
Bruce Momjian 1fc2fbe51f Add to TODO:
>
> * Improve LDAP authentication configuration options
>
>   http://archives.postgresql.org/pgsql-hackers/2008-04/msg01745.php
2008-06-26 02:53:19 +00:00
Bruce Momjian 067f1e5fa8 Fix 'pg_ctl restart' to preserve command-line arguments. 2008-06-26 02:47:19 +00:00
Bruce Momjian a1183238be Use SYSTEMQUOTE as concatentation to strings, rather than %s printf
patterns, for clarity.
2008-06-26 01:35:45 +00:00
Bruce Momjian 124c22d5fd Remove use of postmaster.opts.default by pg_ctl. 2008-06-26 01:12:20 +00:00
Tom Lane 5f6f840e93 Reduce the alignment requirement of type "name" from int to char, and arrange
to suppress zero-padding of "name" entries in indexes.

The alignment change is unlikely to save any space, but it is really needed
anyway to make the world safe for our widespread practice of passing plain
old C strings to functions that are declared as taking Name.  In the previous
coding, the C compiler was entitled to assume that a Name pointer was
word-aligned; but we were failing to guarantee that.  I think the reason
we'd not seen failures is that usually the only thing that gets done with
such a pointer is strcmp(), which is hard to optimize in a way that exploits
word-alignment.  Still, some enterprising compiler guy will probably think
of a way eventually, or we might change our code in a way that exposes
more-obvious optimization opportunities.

The padding change is accomplished in one-liner fashion by declaring the
"name" index opclasses to use storage type "cstring" in pg_opclass.h.
Normally btree and hash don't allow a nondefault storage type, because they
don't have any provisions for converting the input datum to another type.
However, because name and cstring are effectively the same thing except for
padding, no conversion is needed --- we only need index_form_tuple() to treat
the datum as being cstring not name, and this is sufficient.  This seems to
make for about a one-third reduction in the typical sizes of system catalog
indexes that involve "name" columns, of which we have many.

These two changes are only weakly related, but the alignment change makes
me feel safer that the padding change won't introduce problems, so I'm
committing them together.
2008-06-24 17:58:27 +00:00
Bruce Momjian 3dc59beae2 TODO item done:
< 	o Prevent pg_dump/pg_restore from being affected by
> 	o -Prevent pg_dump/pg_restore from being affected by
2008-06-24 15:53:24 +00:00
Tom Lane 320c7eb8c6 Oops, make the MSVC build put fmgroids.h where it needs to be.
Per buildfarm results.
2008-06-24 01:15:36 +00:00
Bruce Momjian 815aa2c8e8 Add TODO:
>
> 	o Allow COPY to report errors sooner
>
>          http://archives.postgresql.org/pgsql-hackers/2008-04/msg01169.php
2008-06-23 22:42:32 +00:00
Bruce Momjian 2047021fdb Add URL for Merge. 2008-06-23 22:23:54 +00:00
Bruce Momjian d34cf008a9 Backup wording improvement.
Joshua D. Drake
2008-06-23 22:15:17 +00:00
Bruce Momjian fe0dbfe6f3 Add to TODO:
> * Allow custom variables to appear in pg_settings()
2008-06-23 22:12:20 +00:00
Bruce Momjian c09174fb95 Add item:
* Implement a module capability for loading /contrib-style extensions

  http://archives.postgresql.org/pgsql-patches/2008-04/msg00164.php
2008-06-23 21:35:35 +00:00