Commit Graph

19167 Commits

Author SHA1 Message Date
Peter Eisentraut 71936fc5eb The Czech (cs_CZ) and Slovak (sk_SK) locales sort numbers after letters,
instead of vice versa.  Update the regression test expectations to support
that.  In the plpgsql test, adjust the test data so that this isn't an
issue.  In the char and varchar tests, add new expected files.
2009-02-12 15:11:44 +00:00
Peter Eisentraut c1c1886d82 Unset language-related locale settings in any case, otherwise psql will
speak in tongues and mess up the regression test diffs.
2009-02-12 13:26:03 +00:00
Magnus Hagander b31d0719fb Don't call SetEnvironmentVariable() when removing an environment variable,
as this seems to crash on at least some versions of MingW. Our current usage
of this function does not require it, so it should be ok to ignore.
2009-02-12 12:53:34 +00:00
Tom Lane 6d1e361852 Change ALTER TABLE SET WITHOUT OIDS to rewrite the whole table to physically
get rid of the OID column.  This eliminates the problem discovered by Heikki
back in November that 8.4's suppression of "unnecessary" junk filtering in
INSERT/SELECT could lead to an Assert failure, or storing of oids into a table
that shouldn't have them if Asserts are off.  While that particular problem
could have been solved in other ways, it seems likely to be just a forerunner
of things to come if we continue to allow tables to contain rows that disagree
with the pg_class.relhasoids setting.  It's better to make this operation slow
than to sacrifice performance or risk bugs in more common code paths.

Also, add ALTER TABLE SET WITH OIDS to rewrite the table to add oids.
This was a bit more controversial, but in view of the very small amount of
extra code needed given the current ALTER TABLE infrastructure, it seems best
to eliminate the asymmetry in features.
2009-02-11 21:11:16 +00:00
Tom Lane 68d95f12e7 Tweak configure to attempt to add -qnoansialias to CFLAGS whenever running
on AIX with a non-gcc compiler.  The previous coding would do this only if
CC was exactly "xlc"; which is a bad idea, as demonstrated by trouble report
from Mihai Criveti.
2009-02-11 20:02:40 +00:00
Alvaro Herrera 787020fd3d Improve psql \d+ to show TOAST reloptions too. Per complaint from
ITAGAKI Takahiro.
2009-02-11 19:12:04 +00:00
Peter Eisentraut 20a43b16b4 Only unset the locale environment when --no-locale is used (the way it was
presumably designed, but didn't act).  This allows running the temp install
tests in a non-C locale, thus exercising users' real environments better.
Document how to change locales for test runs.
2009-02-11 14:03:42 +00:00
Peter Eisentraut 8b9dd6b5fd Support for KOI8U encoding 2009-02-10 19:29:39 +00:00
Peter Eisentraut 1cb54c2860 Remove the encoding *numbers* from the comments. They are useless, and
make maintenance harder.
2009-02-10 16:44:44 +00:00
Peter Eisentraut 06941da30b Add possibility to generate only some files, by passing command-line
arguments.
2009-02-10 16:36:55 +00:00
Tom Lane 8205258fa6 Adopt Bob Jenkins' improved hash function for hash_any(). This changes the
contents of hash indexes (again), so bump catversion.

Kenneth Marshall
2009-02-09 21:18:28 +00:00
Alvaro Herrera 834a6da4f7 Update autovacuum to use reloptions instead of a system catalog, for
per-table overrides of parameters.

This removes a whole class of problems related to misusing the catalog,
and perhaps more importantly, gives us pg_dump support for the parameters.

Based on a patch by Euler Taveira de Oliveira, heavily reworked by me.
2009-02-09 20:57:59 +00:00
Tom Lane 3d02cae310 Ensure that INSERT ... SELECT into a table with OIDs never copies row OIDs
from the source table.  This could never happen anyway before 8.4 because
the executor invariably applied a "junk filter" to rows due to be inserted;
but now that we skip doing that when it's not necessary, the case can occur.
Problem noted 2008-11-27 by KaiGai Kohei, though I misunderstood what he
was on about at the time (the opacity of the patch he proposed didn't help).
2009-02-08 18:02:27 +00:00
Bruce Momjian e795b56322 ecpg requires libpq; add Makefile rules to require libpq to be built
first.

Alvaro Herrera
2009-02-07 17:17:34 +00:00
Bruce Momjian 65b731bd9d Fix to_timestamp() to not require upper/lower case matching for meridian
designations (AM/PM).  Also separate out matching of a meridian with
periods (e.g. A.M.) and with those without.

Do the same for AD/BC.

Brendan Jurd
2009-02-07 14:16:46 +00:00
Heikki Linnakangas b75b66332a Fix obsolete comment. Zdenek Kotala 2009-02-07 10:49:36 +00:00
Peter Eisentraut a3a7d47275 Set column privileges to supported 2009-02-07 01:02:55 +00:00
Tom Lane c473d92351 Fix cost_mergejoin's failure to adjust for rescanning of non-unique merge join
keys when considering a semi or anti join.  This requires estimating the
selectivity of the merge qual as though it were a regular inner join condition.
To allow caching both that and the real outer-join-aware selectivity, split
RestrictInfo.this_selec into two fields.

This fixes one of the problems reported by Kevin Grittner.
2009-02-06 23:43:24 +00:00
Tom Lane 7449427a1e Clean up some loose ends from the column privileges patch: add
has_column_privilege and has_any_column_privilege SQL functions; fix the
information_schema views that are supposed to pay attention to column
privileges; adjust pg_stats to show stats for any column you have select
privilege on; and fix COPY to allow copying a subset of columns if the user
has suitable per-column privileges for all the columns.

To improve efficiency of some of the information_schema views, extend the
has_xxx_privilege functions to allow inquiring about the OR of a set of
privileges in just one call.  This is just exposing capability that already
existed in the underlying aclcheck routines.

In passing, make the information_schema views report the owner's own
privileges as being grantable, since Postgres assumes this even when the grant
option bit is not set in the ACL.  This is a longstanding oversight.

Also, make the new has_xxx_privilege functions for foreign data objects follow
the same coding conventions used by the older ones.

Stephen Frost and Tom Lane
2009-02-06 21:15:12 +00:00
Bruce Momjian 8c78f8e65c Add PL/PgSQL FOUND and GET DIAGNOSTICS support for RETURN QUERY
statement

Pavel Stehule
2009-02-05 15:25:49 +00:00
Michael Meskes 78cbd49826 Mixing long and int entries of a union only works on some architectures. 2009-02-05 08:28:47 +00:00
Tom Lane 244f649261 Fix an old corner-case error in match_unsorted_outer(): don't consider
the cheapest-total inner path as a new candidate while truncating the
sort key list, if it already matched the full sort key list.  This is
too much of a corner case to be worth back-patching, since it's unusual
for the cheapest total path to be sorted, and anyway no real harm is
done (except in JOIN_SEMI/ANTI cases where cost_mergejoin is a bit
broken at the moment).  But it wasn't behaving as intended, so fix it.
Noted while examining a test case from Kevin Grittner.  This error doesn't
explain his issue, but it does explain why "set enable_seqscan = off"
seemed to reproduce it for me.
2009-02-05 01:24:55 +00:00
Michael Meskes 649a1252b7 Added result checks for calls to gmtime(). 2009-02-04 08:51:10 +00:00
Michael Meskes 08ffa78483 Argh, wrong line copied again. 2009-02-03 08:55:45 +00:00
Michael Meskes efd019fc94 Fixed copy&paste mistake that made library use uninitialized variable. 2009-02-03 08:48:29 +00:00
Tom Lane 623cf5edec Add a failure check for syslogger's use of _beginthreadex(), and remove
unnecessary thread address output parameter, to make this code look more
like that in pg_restore.
2009-02-03 00:59:26 +00:00
Tom Lane c401a5ce58 Fix plpgsql to not treat INSERT INTO as an INTO-variables clause anywhere
in the string, not just at the start.  Per bug #4629 from Martin Blazek.

Back-patch to 8.2; prior versions don't have the problem, at least not in
the reported case, because they don't try to recognize INTO in non-SELECT
statements.  (IOW, this is really fallout from the RETURNING patch.)
2009-02-02 20:25:38 +00:00
Andrew Dunstan 775f1b379e Provide for parallel restoration from a custom format archive. Each data and
post-data step is run in a separate worker child (a thread on Windows, a child
process elsewhere) up to the concurrent number specified by the new pg_restore
command-line --multi-thread | -m switch.

Andrew Dunstan, with some editing by Tom Lane.
2009-02-02 20:07:37 +00:00
Alvaro Herrera 3a5b773715 Allow reloption names to have qualifiers, initially supporting a TOAST
qualifier, and add support for this in pg_dump.

This allows TOAST tables to have user-defined fillfactor, and will also
enable us to move the autovacuum parameters to reloptions without taking
away the possibility of setting values for TOAST tables.
2009-02-02 19:31:40 +00:00
Michael Meskes 80f95a6500 When changing a regression test file one should also change the expected output file. 2009-02-02 16:54:28 +00:00
Michael Meskes 934eab7cd5 Set memory segment to '0', just to be sure. 2009-02-02 16:49:50 +00:00
Michael Meskes 2d3c691146 Fixed auto allocation for binary data types. 2009-02-02 16:14:06 +00:00
Michael Meskes 77ca045384 Fixed bug in %s handling. 2009-02-02 15:35:28 +00:00
Tom Lane daac6e988e Fix unnest() to handle a toasted input array safely. Per report from
Alvaro.
2009-01-30 21:21:18 +00:00
Heikki Linnakangas 4265ed9f4e Check that connection limit is within valid range. IOW, not < -1.
It's missing in older versions too, but it doesn't seem worth
back-porting. All negative are just harmlessly treated as "no limit", and
tightening the check might even brake an application that relies on it.
2009-01-30 17:24:47 +00:00
Peter Eisentraut cb629f7225 Make messages consistent with existing ones 2009-01-30 12:53:43 +00:00
Peter Eisentraut c05460fe50 Whitespace fix in message 2009-01-30 12:53:12 +00:00
Tom Lane 204db566b4 Update time zone data files to tzdata release 2009a: introduces Asia/Kathmandu
as the preferred spelling of that zone name, corrects historical DST
information for Switzerland and Cuba.
2009-01-29 19:59:59 +00:00
Tom Lane 0d65eea3da Replace argument-checking Asserts with regular test-and-elog checks in all
encoding conversion functions.  These are not can't-happen cases because
it's possible to create a conversion with the wrong conversion function
for the specified encoding pair.  That would lead to an Assert crash in
an Assert-enabled build, or incorrect conversion otherwise, neither of
which is desirable.  This would be a DOS issue if production databases
were customarily built with asserts enabled, but fortunately that's not so.
Per an observation by Heikki.

Back-patch to all supported branches.
2009-01-29 19:23:42 +00:00
Teodor Sigaev b5b3134813 Fix incorrect dereferencing of char* to array's index.
Per Tommy Gildseth <tommy.gildseth@usit.uio.no> report
2009-01-29 16:22:10 +00:00
Peter Eisentraut 7adbd76655 Message fix 2009-01-29 09:38:38 +00:00
Magnus Hagander 61fd2c51d8 Change warning-silencing code not to cast the pointer type, instead
casting the value of the variable later.

Per comments from Tom.
2009-01-28 15:32:21 +00:00
Magnus Hagander 16c46d5d7a Go over all OpenSSL return values and make sure we compare them
to the documented API value. The previous code got it right as
it's implemented, but accepted too much/too little compared to
the API documentation.

Per comment from Zdenek Kotala.
2009-01-28 15:06:47 +00:00
Magnus Hagander 1ab7dc0630 Support running as a service on Windows 7, by not specifying
the JOB_OBJECT_UILIMIT_HANDLES flag.

Dave Page & Magnus Hagander
2009-01-28 11:19:37 +00:00
Magnus Hagander 6b73366520 Silence compiler warning on win32.
ITAGAKI Takahiro
2009-01-27 12:46:16 +00:00
Magnus Hagander 3a8ec880dc Silence compiler warnings in new win32 locale code
when building on mingw.

ITAGAKI Takahiro
2009-01-27 12:45:09 +00:00
Peter Eisentraut 5fe3da927b Revert updatable views 2009-01-27 12:40:15 +00:00
Alvaro Herrera c0f92b57dc Allow extracting and parsing of reloptions from a bare pg_class tuple, and
refactor the relcache code that used to do that.  This allows other callers
(particularly autovacuum) to do the same without necessarily having to open
and lock a table.
2009-01-26 19:41:06 +00:00
Peter Eisentraut 39ab3c1c61 Message format tuning 2009-01-26 10:19:44 +00:00
Tom Lane 006b9e7a92 Tweak the existing special case for AIX in pg_getaddrinfo_all() to handle
yet another failure case in AIX's getaddrinfo().  Per report and patch
by Andrew Chernow.
2009-01-23 19:58:06 +00:00