1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-26 23:43:30 +03:00
Commit Graph

5505 Commits

Author SHA1 Message Date
Tom Lane
4beb9cd5eb Adjust time qual checking code so that we always check TransactionIdIsInProgress
before we check commit/abort status.  Formerly this was done in some paths
but not all, with the result that a transaction might be considered
committed for some purposes before it became committed for others.
Per example found by Jan Wieck.
2005-05-07 21:23:24 +00:00
Tom Lane
5d0d60efe6 Make standalone backends ignore pg_database.datallowconn, so that there
is a way to recover from disabling connections to all databases at once.
2005-05-05 19:54:01 +00:00
Tom Lane
ecbc6dd3e9 Alter the signature for encoding conversion functions to declare the
output area as INTERNAL not CSTRING.  This is to prevent people from
calling the functions by hand.  This is a permanent solution for the
back branches but I hope it is just a stopgap for HEAD.
2005-05-03 19:18:48 +00:00
Tom Lane
2cfb3b6d4d Repair two TIME WITH TIME ZONE bugs found by Dennis Vshivkov. Comparison
of timetz values misbehaved in --enable-integer-datetime cases, and
EXTRACT(EPOCH) subtracted the zone instead of adding it in all cases.
Backpatch to all supported releases (except --enable-integer-datetime code
does not exist in 7.2).
2005-04-23 22:54:03 +00:00
Tom Lane
daa7e6604c Don't try to run clauseless index scans on index types that don't support
it.  Per report from Marinos Yannikos.
2005-04-20 21:48:31 +00:00
Tom Lane
7735c39aa0 Fix mis-display of negative fractional seconds in interval values for
--enable-integer-datetimes case.  Per report from Oliver Siegmar.
2005-04-20 17:15:19 +00:00
Tom Lane
aa4762e7c8 Don't try to constant-fold functions returning RECORD, since the optimizer
isn't presently set up to pass them an expected tuple descriptor.  Bug has
been there since 7.3 but was just recently reported by Thomas Hallgren.
2005-04-14 21:44:46 +00:00
Tom Lane
536b3af7e3 Prevent to_char(interval) from dumping core on month-related formats
when a zero-month interval is given.  Per discussion with Karel.
2005-03-26 00:42:44 +00:00
Tom Lane
1263d7b8d1 Check that aggregate creator has the right to execute the transition
functions of the aggregate, at both aggregate creation and execution times.
2005-01-27 23:43:45 +00:00
Tom Lane
a23133a4d7 Disallow LOAD to non-superusers. Per report from John Heasman. 2005-01-24 17:46:49 +00:00
Tom Lane
48a1dc0d5c The result of a FULL or RIGHT join can't be assumed to be sorted by the
left input's sorting, because null rows may be inserted at various points.
Per report from Ferenc Lutischá¸n.
2005-01-23 02:24:30 +00:00
Tom Lane
76f13fe78d interval_out failed to mention 'ago' for negative intervals in SQL and
GERMAN datestyles.  Ancient bug reported by Terry Lee Tucker.
2005-01-11 18:34:29 +00:00
Tom Lane
e333705b84 array_map failed to insert correct result type in an empty array.
Per example from Florian Pflug.
2004-12-17 20:58:47 +00:00
Tom Lane
bd677bb443 Back-patch fix for ALTER DATABASE failing to flush pg_database changes
to disk right away.  This is just a one-liner change rather than trying
to use FlushRelationBuffers().
2004-11-18 01:19:57 +00:00
Tom Lane
eac07f1fd7 Fix off-by-one memory allocation, as reported by Rod Taylor. Also
avoid repalloc'ing twice when once is sufficient.
2004-11-17 19:54:53 +00:00
Tom Lane
78c0692b15 Repair possible failure to update hint bits back to disk, per
http://archives.postgresql.org/pgsql-hackers/2004-10/msg00464.php.
I plan a more permanent fix in HEAD, but for the back branches it seems
best to just touch the places that actually have a problem.
2004-10-13 22:22:22 +00:00
Tom Lane
8a9b331c32 Fix breakage in hashjoin from recent backpatch of left-join bug fix.
(That's what I get for not testing the back branches *before* committing.)
2004-10-13 21:56:06 +00:00
Tom Lane
c57bcb7b2c Hashed LEFT JOIN would miss outer tuples with no inner match if the join
was large enough to be batched and the tuples fell into a batch where
there were no inner tuples at all.  Thanks to Xiaoyu Wang for finding a
test case that exposed this long-standing bug.
2004-09-17 18:29:24 +00:00
Tom Lane
25ad99245a Fix failure to guarantee that a checkpoint will write out pg_clog updates
for transaction commits that occurred just before the checkpoint.  This is
an EXTREMELY serious bug --- kudos to Satoshi Okada for creating a
reproducible test case to prove its existence.
2004-08-11 04:08:40 +00:00
Peter Eisentraut
6122f38b0a Translation updates 2004-04-05 09:02:37 +00:00
Tom Lane
a60442a446 Avoid generating invalid character encoding sequences in make_greater_string.
Not sure how this mistake evaded detection for so long.
2004-02-02 03:07:25 +00:00
Joe Conway
b59917f02e Fix text_position to not scan past end of source string in multibyte
case, per report from Korea PostgreSQL Users' Group. Copied from Tom
Lane's 7.4 branch patch.
2004-02-01 04:05:13 +00:00
Tom Lane
1b25db6a3c Repair incorrect order of operations in GetNewTransactionId(). We must
complete ExtendCLOG() before advancing nextXid, so that if that routine
fails, the next incoming transaction will try it again.  Per trouble
report from Christopher Kings-Lynne.
2004-01-26 19:16:40 +00:00
Tom Lane
15ae5d26a0 Revert ill-starred change of 13-Feb-02: it appeared to fix a problem of
incorrect permissions checking, but in fact disabled most all permissions
checks for view updates.  This corrects problems reported by Sergey
Yatskevich among others, at the cost of re-introducing the problem
previously reported by Tim Burgess.  However, since we'd lived with that
problem for quite awhile without knowing it, we can live with it awhile
longer until a proper fix can be made in 7.5.
2004-01-14 03:39:36 +00:00
Joe Conway
c9eb119353 Repair indexed bytea like operations, and related selectivity
functionality. Per bug report by Alvar Freude:
http://archives.postgresql.org/pgsql-bugs/2003-12/msg00022.php
2003-12-07 04:11:26 +00:00
Tom Lane
8d802d4edf Force zero_damaged_pages to be effectively ON during recovery from WAL,
since there is no need to worry about damaged pages when we are going to
overwrite them anyway from the WAL.  Per recent discussion.
2003-12-01 16:53:42 +00:00
Tom Lane
6144601f42 Back-patch fix to check vartypmod when matching PlannerParamVar entries.
This should prevent some obscure cases of 'variable not in subplan target
lists', although actual failures have only been reported against 7.4 in
which the bug is much easier to trigger.
2003-11-30 22:24:16 +00:00
Tom Lane
a0547f6ea2 Back-patch fix to cause stats processes to detach from shared memory,
so that they do not prevent the postmaster from deleting the shmem segment
during crash recovery.
2003-11-30 21:56:36 +00:00
Joe Conway
8582f21afd Make PQescapeBytea and byteaout consistent with each other, and
octal escape all octets outside the range 0x20 to 0x7e. This fixes
the problem pointed out by Sergey Yatskevich here:
http://archives.postgresql.org/pgsql-bugs/2003-11/msg00140.php
2003-11-30 20:52:37 +00:00
Jan Wieck
d1c496e9d5 Fix for possible referential integrity violation when a qualified ON INSERT
rule split the query into one INSERT and one UPDATE where the UPDATE
then hit's the just created row without modifying the key fields again.
In this special case, the new key slipped in totally unchecked.

Jan
2003-10-31 03:57:42 +00:00
Tom Lane
98c7f157f2 It is possible for ResolveNew to be used to insert a sublink into a
subquery that didn't previously have one.  We have traditionally made
the caller of ResolveNew responsible for updating the hasSubLinks flag
of the outermost query, but this fails to account for hasSubLinks in
subqueries.  Fix ResolveNew to handle this.  We might later want to
change the calling convention of ResolveNew so that it can fix the
outer query too, simplifying callers.  But I went with the localized
fix for now.  Per bug report from J Smith, 20-Oct-03.
2003-10-20 20:02:30 +00:00
Tom Lane
f8ee74faeb When dumping CREATE INDEX, must show opclass name if the opclass isn't
in the schema search path.  Otherwise pg_dump doesn't correctly dump
scenarios where a custom opclass is created in 'public' and then used
by indexes in other schemas.
2003-10-02 22:25:08 +00:00
Tom Lane
57040f5069 _SPI_cursor_operation forgot to check for failure return from
_SPI_begin_call.  Per gripe from Tomasz Myrta.
2003-09-23 15:11:41 +00:00
Tom Lane
64b9dfa56f Back-patch the other part of Karel's formatting bug fix. 2003-09-03 19:01:35 +00:00
Tom Lane
e6d6713ceb Repair problems with to_char() overrunning its input string.
From Karel Zak.
2003-09-03 15:00:07 +00:00
Tatsuo Ishii
0fc3b22125 Fix GB18030 to UTF-8 mapping table 2003-08-24 05:13:40 +00:00
Tatsuo Ishii
1de44349f4 Fix bug in GB18030 conversion script 2003-08-24 05:00:45 +00:00
Tom Lane
efbc85c209 Conversion functions must be STRICT to prevent them from getting null inputs. 2003-08-08 15:49:10 +00:00
Tom Lane
1b637d7cbe Fix several places where fractional-second inputs were misprocessed
in HAVE_INT64_TIMESTAMP cases, including two potential stack smashes
when more than six fractional digits were supplied.  Per bug report
from Philipp Reisner.
2003-08-05 17:39:36 +00:00
Tom Lane
d1f35b73ac SSL_read/SSL_write do not approximate the return conventions of recv()
and send() very well at all; and in any case we can't use retval==0
for EOF due to race conditions.  Make the same fixes in the backend as
are required in libpq.
2003-08-04 17:58:25 +00:00
Tom Lane
a4ffca6bdf Fix longstanding error in _bt_search(): should moveright at top of loop not
bottom.  Otherwise we fail to moveright when the root page was split while
we were "in flight" to it.  This is not a significant problem when the root
is above the leaf level, but if the root was also a leaf (ie, a single-page
index just got split) we may return the wrong leaf page to the caller,
resulting in failure to find a key that is in fact present.  Bug has existed
at least since 7.1, probably forever.
2003-07-29 22:18:48 +00:00
Tom Lane
091b9c211c Fix timestamp_date for HAVE_INT64_TIMESTAMP case. 2003-07-24 04:38:27 +00:00
Tom Lane
fa67e2ce4f Repair 7.3 breakage in timestamp-to-date conversion for dates before 2000. 2003-07-24 00:21:31 +00:00
Tom Lane
3abd1390ba wups, took out one memset too many ... 2003-07-22 19:13:25 +00:00
Tom Lane
3196738793 Back-patch fix for bugs in pgstat_initstats. 2003-07-22 19:00:36 +00:00
Tom Lane
004d2be5d9 Oh, for crying in a bucket ... relax Assert so that glibc's strxfrm
does not dump core.
2003-07-17 22:20:22 +00:00
Tom Lane
df32af15b6 Work around buggy strxfrm() present in some Solaris releases. 2003-07-17 20:52:42 +00:00
Tom Lane
19de9d2fee For COMMENT ON DATABASE where database name is unknown or not the current
database, emit a WARNING and do nothing, rather than raising ERROR.
Per recent discussion in which we concluded this is the best way to deal
with database dumps that are reloaded into a database of a new name.
2003-07-17 20:14:09 +00:00
Tom Lane
0a49e774b1 Repair boundary-case bug introduced by patch of two months ago that
fixed incorrect initial setting of StartUpID.  The logic in XLogWrite()
expects that Write->curridx is advanced to the next page as soon as
LogwrtResult points to the end of the current page, but StartupXLOG()
failed to make that happen when the old WAL ended exactly on a page
boundary.  Per trouble report from Hannu Krosing.
2003-07-17 16:45:25 +00:00
Tom Lane
537c1c1983 Fix a *second* buffer overrun bug in to_ascii(). Grumble. 2003-07-14 16:41:46 +00:00