1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-05 09:19:17 +03:00

26378 Commits

Author SHA1 Message Date
Tom Lane
bedba2cc0e Improve error reporting for problems in text search configuration files
by installing an error context subroutine that will provide the file name
and line number for all errors detected while reading a config file.
Some of the reader routines were already doing that in an ad-hoc way for
errors detected directly in the reader, but it didn't help for problems
detected in subroutines, such as encoding violations.

Back-patch to 8.3 because 8.3 is where people will be trying to debug
configuration files.
2008-06-18 20:55:49 +00:00
Tom Lane
01860337c3 Fix the code that adds regclass constants to a plan's list of relation OIDs
that it depends on for replan-forcing purposes.  We need to consider plain OID
constants too, because eval_const_expressions folds a RelabelType atop a Const
to just a Const.  This change could result in OID values that aren't really
for tables getting added to the dependency list, but the worst-case
consequence would be occasional useless replans.  Per report from Gabriele
Messineo.
2008-06-17 14:51:38 +00:00
Tom Lane
c9bbf92655 Clean up a number of bogosities around pltcl's handling of the Tcl "result":
1. Directly reading interp->result is deprecated in Tcl 8.0 and later;
you're supposed to use Tcl_GetStringResult.  This code finally broke with
Tcl 8.5, because Tcl_GetVar can now have side-effects on interp->result even
though it preserves the logical state of the result.  (There's arguably a
Tcl issue here, because Tcl_GetVar could invalidate the pointer result of a
just-preceding Tcl_GetStringResult, but I doubt the Tcl guys will see it as
a bug.)

2. We were being sloppy about the encoding of the result: some places would
push database-encoding data into the Tcl result, which should not happen,
and we were assuming that any error result coming back from Tcl was in the
database encoding, which is not a good assumption.

3. There were a lot of calls of Tcl_SetResult that uselessly specified
TCL_VOLATILE for constant strings.  This is only a minor performance issue,
but I fixed it in passing since I had to look at all the calls anyway.

#2 is a live bug regardless of which Tcl version you are interested in,
so back-patch even to branches that are unlikely to be used with Tcl 8.5.
I went back as far as 8.0, which is as far as the patch applied easily;
7.4 was using a different error processing scheme that has got its own
problems :-(
2008-06-17 00:52:49 +00:00
Tom Lane
f3a5b48fff Improve the various elog messages in tuptoaster.c to report which TOAST table
the problem happened in.  These are all supposedly can't-happen cases, but
when they do happen it's useful to know where.

Back-patch to 8.3, but not further because the patch doesn't apply cleanly
further back.  Given the lack of response to my proposal of this, there
doesn't seem to be enough interest to justify much back-porting effort.
2008-06-13 02:59:52 +00:00
Heikki Linnakangas
b9d591d6b9 Fix bug in the WAL recovery code to finish an incomplete split.
CacheInvalidateRelcache() crashes if called in WAL recovery, because the
invalidation infrastructure hasn't been initialized yet.

Back-patch to 8.2, where the bug was introduced.
2008-06-11 08:40:32 +00:00
Tom Lane
f35ed40410 Create a script to handle stamping release version numbers into files,
replacing the tedious and error-prone manual process we've been using.
2008-06-10 18:08:55 +00:00
Tom Lane
7dd65ddb62 Fix unportable (and incorrect anyway) usage of LL constant suffix that
recently snuck into cash.c.  Per report from Edmundo Robles Lopez.
2008-06-09 19:58:46 +00:00
Tom Lane
d90b34ff65 Fix datetime input functions to correctly detect integer overflow when
running on a 64-bit platform ... strtol() will happily return 64-bit
output in that case.  Per bug #4231 from Geoff Tolley.
2008-06-09 19:34:09 +00:00
Marc G. Fournier
668396e05c tag 8.3.3 REL8_3_3 2008-06-09 00:38:40 +00:00
Tom Lane
f1869c79a9 Stamp 8.3.3 (except for configure.in/configure) 2008-06-08 22:14:09 +00:00
Tom Lane
c10ad86f55 Update release notes for ALTER AGGREGATE fix. 2008-06-08 21:46:16 +00:00
Tom Lane
54dd1ff437 ALTER AGGREGATE OWNER seems to have been missed by the last couple of
patches that dealt with object ownership.  It wasn't updating pg_shdepend
nor adjusting the aggregate's ACL.  In 8.2 and up, fix this permanently
by making it use AlterFunctionOwner_oid.  In 8.1, the function code wasn't
factored that way, so just copy and paste.
2008-06-08 21:09:52 +00:00
Tom Lane
bab4c41c93 Update release notes for 8.3.3 et al. 2008-06-07 22:10:47 +00:00
Tom Lane
1bec411798 Fix pg_get_ruledef() so that negative numeric constants are parenthesized.
This is needed because :: casting binds more tightly than minus, so for
example -1::integer is not the same as (-1)::integer, and there are cases
where the difference is important.  In particular this caused a failure
in SELECT DISTINCT ... ORDER BY ... where expressions that should have
matched were seen as different by the parser; but I suspect that there
could be other cases where failure to parenthesize leads to subtler
semantic differences in reloaded rules.  Per report from Alexandr Popov.
2008-06-06 17:59:37 +00:00
Marc G. Fournier
21cb67512c tag for 8.3.2 REL8_3_2 2008-06-06 03:56:39 +00:00
Tom Lane
6deaeb3e2b Stamp 8.3.2 (except for configure.in/configure) 2008-06-05 23:55:26 +00:00
Tom Lane
2d2896507b Translation updates. 2008-06-05 23:36:45 +00:00
Alvaro Herrera
4b79171136 Fix missing "not", per Frank Millman (bug #4212). 2008-06-05 19:56:14 +00:00
Michael Meskes
bf3bf909a5 Added symbol SQL to list of allowed variables. 2008-06-04 12:26:14 +00:00
Tom Lane
ad6acfde57 Draft release notes for upcoming back-branch updates. 2008-06-04 03:16:11 +00:00
Tom Lane
3ea40a115d Remove unused variable (was already done in HEAD) 2008-06-03 20:55:41 +00:00
Tom Lane
bc0c7e9876 Fix initdb to reject a relative path for -X (--xlogdir) argument. This
doesn't work, and the real reason why not is it's unclear where the path
is relative to (initdb's CWD, or the data directory?).  We could make an
arbitrary decision, but it seems best to make the user be unambiguous.
Per gripe from Devrim.
2008-06-02 03:48:07 +00:00
Tom Lane
77241fe9fd Update time zone data files to tzdata release 2008c (DST law changes in
Morocco, Iraq, Choibalsan, Pakistan, Syria, Cuba, Argentina/San_Luis).
2008-06-01 18:23:07 +00:00
Tom Lane
8146f890bb Make 8.3.x psql print tab characters as an appropriate number of spaces,
rather than "\x09".  Before 8.3 we just printed tabs as-is, leading to poor
formatting of subsequent columns, but consensus is that "\x09" is not an
improvement over that.  Back-patch of fix that's already in HEAD.
2008-05-29 19:34:44 +00:00
Tom Lane
fe4f2861ba Fix some bugs introduced by the 8.2-era conversion of cube functions to V1
calling convention.  cube_inter and cube_distance could attempt to pfree
their input arguments, and cube_dim returned a value from a struct it
might have just pfree'd (which would only really cause a problem in a
debug build, but it's still wrong).  Per bug #4208 and additional code
reading.

In HEAD and 8.3, I also made a batch of cosmetic changes to bring these
functions into line with the preferred coding style for V1 functions,
ie declare and fetch all the arguments at the top so readers can easily
see what they are.
2008-05-29 18:46:46 +00:00
Tom Lane
f26cbcab75 Backpatch Zdenek Kotala's fix to prevent pglz_decompress from stomping on
memory if the compressed data is corrupt.

Backpatch as far as 8.2.  The issue exists in older branches too, but given
the lack of field reports, it's not clear it's worth any additional effort
to adapt the patch to the slightly different code in older branches.
2008-05-28 21:58:03 +00:00
Tom Lane
85a24f0dd9 Improve GRANT documentation to point out that UPDATE and DELETE typically
require SELECT privilege as well, since you normally need to read existing
column values within such commands.  This behavior is according to spec,
but we'd never documented it before.  Per gripe from Volkan Yazici.
2008-05-28 00:45:47 +00:00
Tom Lane
dcab19c084 Require bind_textdomain_codeset() not just gettext() to enable NLS support.
GNU gettext before 0.10.36 does not have that function, and is generally too
incomplete to be usable.
2008-05-27 22:18:11 +00:00
Tom Lane
764b10c978 Clarify description of typmod input function, per Jeff Davis. 2008-05-27 18:05:20 +00:00
Magnus Hagander
4bdc742231 Explicitly bind gettext() to the UTF8 locale when in use.
This is required on Windows due to the special locale
handling for UTF8 that doesn't change the full environment.

Fixes crash with translated error messages per bugs 4180
and 4196.

Tom Lane
2008-05-27 12:24:46 +00:00
Tom Lane
ed91252bc2 Fix an old corner-case bug in set_config_option: push_old_value has to be
called before, not after, calling the assign_hook if any.  This is because
push_old_value might fail (due to palloc out-of-memory), and in that case
there would be no stack entry to tell transaction abort to undo the GUC
assignment.  Of course the actual assignment to the GUC variable hasn't
happened yet --- but the assign_hook might have altered subsidiary state.
Without a stack entry we won't call it again to make it undo such actions.
So this is necessary to make the world safe for assign_hooks with side
effects.  Per a discussion a couple weeks ago with Magnus.

Back-patch to 8.0.  7.x did not have the problem because it did not have
allocatable stacks of GUC values.
2008-05-26 18:54:36 +00:00
Tom Lane
888706a883 Adjust timestamp regression tests to prevent two low-probability failure
cases.  Recent buildfarm experience shows that it is sometimes possible
to execute several SQL commands in less time than the granularity of
Windows' not-very-high-resolution gettimeofday(), leading to a failure
because the tests expect the value of now() to change and it doesn't.
Also, it was recognized some time ago that the same area of the tests
could fail if local midnight passes between the insertion and the checking
of the values for 'yesterday', 'tomorrow', etc.  Clean all this up per
ideas from myself and Greg Stark.

There remains a window for failure if the transaction block is entered
exactly at local midnight (so that 'now' and 'today' have the same value),
but that seems low-probability enough to live with.

Since the point of this change is mostly to eliminate buildfarm noise,
back-patch to all versions we are still actively testing.
2008-05-25 21:51:11 +00:00
Heikki Linnakangas
2035da3ed9 Remove arbitrary 10MB limit on two-phase state file size. It's not that hard
to go beoynd 10MB, as demonstrated by Gavin Sharry's example of dropping a
schema with ~25000 objects. The really bogus thing about the limit was that
it was enforced when a state file file was read in, not when it was written,
so you would end up with a prepared transaction that you can't commit or
abort, and the only recourse was to shut down the server and remove the file
by hand.

Raise the limit to MaxAllocSize, and enforce it also when a state file is
written. We could've removed the limit altogether, but reading in a file
larger than MaxAllocSize would fail anyway because we read it into a
palloc'd buffer.

Backpatch down to 8.1, where 2PC and this issue was introduced.
2008-05-19 18:16:46 +00:00
Tom Lane
7e1cb82469 Coercion sanity check in ri_HashCompareOp failed to allow for enums, as per
example from Rod Taylor.  On reflection the correct test here is for any
polymorphic type, not specifically ANYARRAY as in the original coding.
2008-05-19 04:14:33 +00:00
Tom Lane
2d7a219b0d 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:57 +00:00
Magnus Hagander
53397b1e68 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:54:02 +00:00
Michael Meskes
f496eb31b2 Check for non-existant connection in prepare statement handling.
Do not close files that weren't opened.
2008-05-12 16:30:17 +00:00
Andrew Dunstan
cc22720644 Backpatch fixes for contrib makefiles. 2008-05-10 16:07:56 +00:00
Tom Lane
2773195802 Fix an ancient oversight in change_varattnos_of_a_node: it neglected to update
varoattno along with varattno.  This resulted in having Vars that were not
seen as equal(), causing inheritance of the "same" constraint from different
parent relations to fail.  An example is

create table pp1 (f1 int check (f1>0));
create table cc1 (f2 text, f3 int) inherits (pp1);
create table cc2(f4 float) inherits(pp1,cc1);

Backpatch as far as 7.4.  (The test case still fails in 7.4, for reasons
that I don't feel like investigating at the moment.)

This is a backpatch commit only.  The fix will be applied in HEAD as part
of the upcoming pg_constraint patch.
2008-05-09 22:37:34 +00:00
Heikki Linnakangas
1a107363e2 Fix Assert introduced in previous patch. 2008-05-09 15:28:01 +00:00
Heikki Linnakangas
48bf6642c3 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:28:08 +00:00
Tom Lane
65a1e96c1d Fix contrib/xml2 makefile to not override CFLAGS, and in passing make it
auto-configure properly for libxslt present or not.
2008-05-08 16:49:48 +00:00
Alvaro Herrera
d67134d129 Add Simon Riggs' email address. 2008-05-07 22:06:11 +00:00
Magnus Hagander
2804eb27ad Add more dependencies from libpgport required by
standalone msvc build of libpq.

Hiroshi Saito
2008-05-05 19:31:45 +00:00
Tom Lane
5c27e396de The 8.2 patch that added support for an alias on the target table of
UPDATE/DELETE forgot to teach ruleutils.c to display the alias.
Per bug #4141 from Mathias Seiler.
2008-05-03 23:19:27 +00:00
Tom Lane
90cdbe43e0 Fix nodeTidscan.c to not trigger an error if the block number portion of
a user-supplied TID is out of range for the relation.  This is needed to
preserve compatibility with our pre-8.3 behavior, and it is sensible anyway
since if the query were implemented by brute force rather than optimized
into a TidScan, the behavior for a non-existent TID would be zero rows out,
never an error.  Per gripe from Gurjeet Singh.
2008-04-30 23:28:37 +00:00
Alvaro Herrera
6750c7a751 Fix REASSIGN OWNED so that it works on procedural languages too.
The capability for changing language owners is new in 8.3, so that's how
far back this needs to be backpatched.

Per bug #4132 by Kirill Simonov.
2008-04-29 19:37:13 +00:00
Tom Lane
8209e1a987 Fix broken configure test for libxslt: it was probing for xsltLibxmlVersion,
which is a global variable not a function, and so the probe failed on machines
where the linker makes a distinction (cf. Red Hat bug #444317).  Probe for
an actual function instead.
2008-04-28 22:47:11 +00:00
Tom Lane
f7288cde49 Back-patch Heikki's fix to make TransactionIdIsCurrentTransactionId() use
binary search instead of linear search when checking child-transaction XIDs.
Per example from Robert Treat, the speed of TransactionIdIsCurrentTransactionId
is significantly more important in 8.3 than it was in prior releases, so
this seems worth taking back-patching risk for.
2008-04-26 23:35:33 +00:00
Tom Lane
701e71cf09 Fix ALTER TABLE ADD COLUMN ... PRIMARY KEY so that the new column is correctly
checked to see if it's been initialized to all non-nulls.  The implicit NOT
NULL constraint was not being checked during the ALTER (in fact, not even if
there was an explicit NOT NULL too), because ATExecAddColumn neglected to
set the flag needed to make the test happen.  This has been broken since
the capability was first added, in 8.0.

Brendan Jurd, per a report from Kaloyan Iliev.
2008-04-24 20:17:59 +00:00