Commit Graph

27514 Commits

Author SHA1 Message Date
Tom Lane d1ab3eb712 Clean up the ancient decision to show only two fractional-seconds digits
in "postgres_verbose" intervalstyle, and the equally arbitrary decision to
show at least two fractional-seconds digits in most other datetime display
styles.  This results in some minor changes in the expected regression test
outputs.

Also, coalesce a lot of repetitive code in datetime.c into subroutines,
for clarity and ease of maintenance.  In particular this roughly halves
the number of #ifdef HAVE_INT64_TIMESTAMP segments.

Ron Mayer, with some additional kibitzing from Tom Lane
2008-11-12 01:36:20 +00:00
Andrew Dunstan 466368b8d0 Detect and error out on inability to get proper linkage information required for plperl, usually due to absence of perl ExtUtils::Embed module. Backpatch as far as 8.1. 2008-11-12 00:00:05 +00:00
Magnus Hagander bd059c2d1d Mention the tup_fetched column in pg_stat_database.
Greg Sabino Mullane
2008-11-11 20:06:21 +00:00
Tom Lane 0d7099d2f0 Ensure that the phrels sets of PlaceHolderVars appearing in an AppendRelInfo's
translated_vars list get updated when pulling up an appendrel member.  It's
not clear that this really matters at present, since relatively little gets
done with the outputs of an appendrel child relation; but it probably will
come back to bite us sometime if we leave them with the wrong values.
2008-11-11 19:05:21 +00:00
Tom Lane 0436679969 Get rid of adjust_appendrel_attr_needed(), which has been broken ever since
we extended the appendrel mechanism to support UNION ALL optimization.  The
reason nobody noticed was that we are not actually using attr_needed data for
appendrel children; hence it seems more reasonable to rip it out than fix it.
Back-patch to 8.2 because an Assert failure is possible in corner cases.
Per examination of an example from Jim Nasby.

In HEAD, also get rid of AppendRelInfo.col_mappings, which is quite inadequate
to represent UNION ALL situations; depend entirely on translated_vars instead.
2008-11-11 18:13:32 +00:00
Magnus Hagander ccc9073f26 Make psql report "SSL connection (unknown cipher)" when libpq has set
up a SSL connection, but psql is compiled without support for it.

Not a really realistic use-case, but the patch also cuts down on
the number of places with #ifdef's...
2008-11-11 15:01:53 +00:00
Tom Lane cad3a26a95 Fix sloppy omission of now-required #include's. 2008-11-11 14:17:02 +00:00
Heikki Linnakangas 7e8b0b9ab1 Change error messages to print the physical path, like
"base/11517/3767_fsm", instead of symbolic names like "1663/11517/3767/1",
per Alvaro's suggestion. I didn't change the messages in the higher-level
index, heap and FSM routines, though, where the fork is implicit.
2008-11-11 13:19:16 +00:00
Michael Meskes c7f5c7c128 Replaced manually synced preproc.y by the one created by the new script.
Adapted regression test files accordingly.
2008-11-11 11:41:24 +00:00
Tom Lane 3be2448525 Add an explicit caution about how to use pg_do_encoding_conversion with
non-null-terminated input.  Per discussion with ITAGAKI Takahiro.
2008-11-11 03:01:20 +00:00
Tom Lane a4917bef0e Add support for input and output of interval values formatted per ISO 8601;
specifically, we can input either the "format with designators" or the
"alternative format", and we can output the former when IntervalStyle is set
to iso_8601.

Ron Mayer
2008-11-11 02:42:33 +00:00
Alvaro Herrera a44564b4f8 Fix a case of string building. 2008-11-10 21:49:16 +00:00
Tom Lane 5e11e73d37 Fix bugs in sqlchar_to_unicode and unicode_to_sqlchar: both were measuring
the length of a UTF8 character with pg_mblen (wrong if DB encoding isn't
UTF8), and the latter was blithely assuming that a static buffer would somehow
revert to all zeroes for each use.
2008-11-10 18:02:20 +00:00
Heikki Linnakangas 45d146a6db Fix 'Q' format char parsing in the new to_timestamp() code. Used to crash. 2008-11-10 17:36:53 +00:00
Alvaro Herrera 6462e7b81c Add a --locale switch to createdb, to ease the creation of databases with
different locales.  This is just syntactical sweetener over --lc-collate and
--lc-ctype.  Per discussion.

While at it, properly document --lc-ctype and --lc-collate in SGML docs,
which apparently were forgotten (or purposefully ommited?) when they were
created.
2008-11-10 16:25:41 +00:00
Tom Lane 2b74d45c1b pg_do_encoding_conversion cannot return NULL (at least not unless the input
is NULL), so remove some useless tests for the case.
2008-11-10 15:18:40 +00:00
Tom Lane d141e7493b Fix old bug in contrib/sslinfo: X509_NAME_to_text freed the BIO_s_mem buffer
it was using too soon.  In a situation where pg_do_encoding_conversion is
a no-op, this led to garbage data returned.

In HEAD, also modify the code that's ensuring null termination to make it
a tad more obvious what's happening.
2008-11-10 14:57:38 +00:00
Tom Lane c5451c22e3 Make relhasrules and relhastriggers work like relhasindex, namely we let
VACUUM reset them to false rather than trying to clean 'em up during DROP.
2008-11-10 00:49:37 +00:00
Tom Lane e4718f2c9e Replace pg_class.reltriggers with relhastriggers, which is just a boolean hint
("there might be triggers") rather than an exact count.  This is necessary
catalog infrastructure for the upcoming patch to reduce the strength of
locking needed for trigger addition/removal.  Split out and committed
separately for ease of reviewing/testing.

In passing, also get rid of the unused pg_class columns relukeys, relfkeys,
and relrefs, which haven't been maintained in many years and now have no
chance of ever being maintained (because of wishing to avoid locking).

Simon Riggs
2008-11-09 21:24:33 +00:00
Tom Lane 1d577f5e49 Add a startup check that pg_xlog and pg_xlog/archive_status exist.
If the latter doesn't exist, automatically recreate it.  (We don't do
this for pg_xlog, though, per discussion.)

Jonah Harris
2008-11-09 17:51:15 +00:00
Tom Lane dbf57d31f8 Add some documentation about handling of fractions in interval input.
(It's always worked like this, but we never documented it before.)
2008-11-09 17:09:48 +00:00
Tom Lane df7641e25a Add a new GUC variable called "IntervalStyle" that decouples interval output
from DateStyle, and create a new interval style that produces output matching
the SQL standard (at least for interval values that fall within the standard's
restrictions).  IntervalStyle is also used to resolve the conflict between the
standard and traditional Postgres rules for interpreting negative interval
input.

Ron Mayer
2008-11-09 00:28:35 +00:00
Tom Lane eec501c4f7 Fix recently added code for SQL years-months interval syntax so that
it behaves correctly for a leading minus sign, zero year value, and
nonzero month value.  Per discussion with Ron Mayer.
2008-11-08 20:51:49 +00:00
Tom Lane 13fdd0e4d1 Add some more citext test cases, per David Wheeler. Also remove the
citext-to-and-from-xml tests, since those caused variation between
installations with or without libxml without really proving much.  Instead
repurpose citext_1.out as the expected results in glibc en_US (and probably
other) locales.
2008-11-07 23:17:30 +00:00
Tom Lane 399ad77c66 Improve documentation of pg_typeof, per gripe from David Wheeler. 2008-11-07 22:54:41 +00:00
Tom Lane 6517f377d6 Implement ALTER DATABASE SET TABLESPACE to move a whole database (or at least
as much of it as lives in its default tablespace) to a new tablespace.

Guillaume Lelarge, with some help from Bernd Helmle and Tom Lane
2008-11-07 18:25:07 +00:00
Tom Lane 85e2cedf98 Improve bulk-insert performance by keeping the current target buffer pinned
(but not locked, as that would risk deadlocks).  Also, make it work in a small
ring of buffers to avoid having bulk inserts trash the whole buffer arena.

Robert Haas, after an idea of Simon Riggs'.
2008-11-06 20:51:15 +00:00
Tom Lane cdc197cf31 Improve psql's \dC command to take a pattern parameter. Casts are shown
if their source or target types match the pattern (using the same definition
of "match" as \dT does).  Per recent discussion.
2008-11-06 15:18:36 +00:00
Heikki Linnakangas 5ae29525d1 The logic in systable_beginscan to translate heap attribute numbers to
index column numbers needs to handle the case where you have more than
one scankey on the same index column. toast_fetch_datum_slice() needs it.
2008-11-06 13:07:08 +00:00
Tom Lane 53b4e469ca This maneuver really requires a comment ... 2008-11-05 20:17:18 +00:00
Andrew Dunstan 0db527c05b change fix for suppress_redundant_updates_trigger() where relation has Oids, to only apply if present Oid is invalid, per second thought from TGL 2008-11-05 19:15:15 +00:00
Andrew Dunstan b65ebc7e8b fix suppress_redundant_updates_trigger() where relation has Oids, per gripe from KaiGai Kohei 2008-11-05 18:49:28 +00:00
Peter Eisentraut e2a277bd08 A few additional test cases for array functionality 2008-11-05 12:27:09 +00:00
Tom Lane e0dc7d026f Rename several aliases for PLpgSQL_datum.dno to also be called dno.
Hopefully this will forestall future confusion about their roles.

Jonah Harris
2008-11-05 00:07:54 +00:00
Bruce Momjian e33e0c43fe Document that SSL is only possible on tcp/ip connections in the
postgresql.conf 'ssl' section.
2008-11-04 22:40:40 +00:00
Bruce Momjian c227ccc2f7 Document that 'sslmode' is ignored for Unix domain socket communication;
backpatch to 8.3.X.
2008-11-04 22:36:07 +00:00
Alvaro Herrera b6cb3d0c06 Revert unwanted patch, per Tom. 2008-11-04 21:00:15 +00:00
Alvaro Herrera 45fffcf778 Remove unused rfno from PLpgSQL_recfield
Jonah Harris
2008-11-04 20:58:46 +00:00
Tom Lane 70b6e99e40 Fix bug introduced in recent patch to make plpython cope with OUT arguments:
the proc->argnames array has to be initialized to zero immediately on creation,
since the error recovery path will try to free its elements.
2008-11-04 15:16:48 +00:00
Peter Eisentraut 725ba51f2c Experimental new support for building man pages via docbook2x, an XSL-based
tool chain.  With some polishing, this might help us get rid of our ancient
and crufty man page build mechanism.
2008-11-04 14:58:22 +00:00
Peter Eisentraut 254aecb704 ADD array_ndims function
Author: Robert Haas <robertmhaas@gmail.com>
2008-11-04 14:49:12 +00:00
Peter Eisentraut 9beb9e761b Fix compiler warning about uninitialized variable 2008-11-04 11:04:06 +00:00
Bruce Momjian 4253f016c9 Add missing colon to docs. 2008-11-04 04:18:50 +00:00
Bruce Momjian ac3797a913 Remove tabs from SGML file. 2008-11-04 00:59:45 +00:00
Tom Lane 31b15fe8dc Disallow LOCK TABLE outside a transaction block (or function), since this case
almost certainly represents user error.  Per a gripe from Sebastian Böhm
and subsequent discussion.
2008-11-04 00:57:19 +00:00
Tom Lane 99e0996284 Fix compiler warnings (including a seriously bogus elog call); minor
code beautification.
2008-11-04 00:29:39 +00:00
Tom Lane 1a2b41f498 Use bool for a boolean flag. 2008-11-03 23:49:07 +00:00
Peter Eisentraut 84aa797292 Allow uuid_in() to parse a wider variety of variant input formats for the UUID
data type.  This patch takes the approach of allowing an optional hyphen after
each group of four hex digits.

Author: Robert Haas <robertmhaas@gmail.com>
2008-11-03 22:14:40 +00:00
Tom Lane 48cbe59150 Dept of second thoughts: seems it'd be safer if pg_typeof is marked
stable not immutable, since it depends on system catalog contents.
2008-11-03 21:09:17 +00:00
Tom Lane b4eae023bb Clean up the messy semantics (not to mention inefficiency) of PageGetTempPage
by splitting it into three functions with better-defined behaviors.

Zdenek Kotala
2008-11-03 20:47:49 +00:00