Commit Graph

19712 Commits

Author SHA1 Message Date
Bruce Momjian
0a056c3716 Fix date_trunct for December dates that are in the next year, e.g.:
SELECT date_trunc('week', '2002-12-31'::date);

Backpatch to 8.0.X.

Per report from Nick Johnson.
2005-07-04 14:12:45 +00:00
Tom Lane
bb630623a4 Fix memory leak in plperl_hash_from_tuple(), per report from Jean-Max Reymond. 2005-07-03 21:56:27 +00:00
Tom Lane
ddfbdd46d8 Modify pg_dump to assume that a check constraint is inherited if its
name matches the name of any parent-table constraint, without looking
at the constraint text.  This is a not-very-bulletproof workaround for
the problem exhibited by Berend Tober last month.  We really ought to
record constraint inheritance status in pg_constraint, but it's looking
like that may not get done for 8.1 --- and even if it does, we will
need this kluge for dumping from older servers.
2005-06-27 02:18:14 +00:00
Tom Lane
894889ecc4 Force a checkpoint before committing a CREATE DATABASE command. This
should fix the recent reports of "index is not a btree" failures,
as well as preventing a more obscure race condition involving changes
to a template database just after copying it with CREATE DATABASE.
2005-06-25 22:47:49 +00:00
Tom Lane
dfb30486d7 Fix ancient memory leak in index_create(): RelationInitIndexAccessInfo
was being called twice in normal operation, leading to a leak of one set
of relcache subsidiary info.  Per report from Jeff Gold.
2005-06-25 16:54:00 +00:00
Neil Conway
5ba26d48fc Correct some code in pg_restore when reading the header of a tar archive:
(1) The code doesn't initialize `sum', so the initial "does the checksum
    match?" test is wrong.

(2) The loop that is intended to check for a "null block" just checks
    the first byte of the tar block 512 times, rather than each of the
    512 bytes one time (!), which I'm guessing was the intent.

It was only through sheer luck that this worked in the first place.

Per Coverity static analysis performed by EnterpriseDB.
2005-06-22 02:02:09 +00:00
Neil Conway
5bcb851c92 Fix a potential backend crash during authentication when parsing a
malformed ident map file.  This was introduced by the linked list
rewrite in 8.0 -- mea maxima culpa.

Per Coverity static analysis performed by EnterpriseDB.
2005-06-21 01:23:25 +00:00
Tom Lane
7d32f099d7 exec_eval_datum leaks memory when dealing with ROW or REC values.
It never leaked memory before PG 8.0, so none of the callers are
expecting this.  Cleanest fix seems to be to make it allocate the needed
memory in estate->eval_econtext, where it will be cleaned up by
the next exec_eval_cleanup.  Per report from Bill Rugolsky.
2005-06-20 22:51:49 +00:00
Tom Lane
c541ca6403 plpgsql's exec_assign_value() freed the old value of a variable before
copying/converting the new value, which meant that it failed badly on
"var := var" if var is of pass-by-reference type.  Fix this and a similar
hazard in exec_move_row(); not sure that the latter can manifest before
8.0, but patch it all the way back anyway.  Per report from Dave Chapeskie.
2005-06-20 20:44:50 +00:00
Tom Lane
558ff41f27 When using C-string lookup keys in a dynahash.c hash table, use strncpy()
not memcpy() to copy the offered key into the hash table during HASH_ENTER.
This avoids possible core dump if the passed key is located very near the
end of memory.  Per report from Stefan Kaltenbrunner.
2005-06-18 20:51:44 +00:00
Bruce Momjian
9f64e10225 NetBSD uses "options" not "option". 2005-06-17 16:46:45 +00:00
Peter Eisentraut
7a91540202 Translation updates 2005-06-17 11:42:02 +00:00
Tom Lane
d9de1bb47a The random selection in function linear() could deliver a value equal to max
if geqo_rand() returns exactly 1.0, resulting in failure due to indexing
off the end of the pool array.  Also, since this is using inexact float math,
it seems wise to guard against roundoff error producing values slightly
outside the expected range.  Per report from bug@zedware.org.
2005-06-14 14:21:23 +00:00
Tatsuo Ishii
8bedb71888 Fix bug in MIC -> EUC_JP conversion. Per Atsushi Ogawa. 2005-06-11 02:46:16 +00:00
Tom Lane
887a7255d1 Repair error in description of nonblocking usage of PQgetCopyData().
Per Volkan Yazici.
2005-06-09 19:08:36 +00:00
Tom Lane
6bbd271a1e Use just NULL not NULL::TEXT --- the latter coding is unnecessary and
not schema-safe.  Per report from Jochem van Dieten.
2005-06-07 14:05:01 +00:00
Tom Lane
2f5b2558d3 Code for SET/SHOW TIME ZONE with a fixed-interval timezone was not
prepared for HAVE_INT64_TIMESTAMP.  Per report from Guillaume Beaudoin.
2005-06-05 01:48:45 +00:00
Bruce Momjian
272f23c814 Update Chinese FAQ to fix XHTML format.
Weiping (Laser)
2005-06-04 03:33:25 +00:00
Bruce Momjian
1d03f3f027 Update Russian FAQ.
Viktor Vislobokov
2005-06-03 18:17:54 +00:00
Tom Lane
543bb05a8b Push enable/disable of notify and catchup interrupts all the way down
to just around the bare recv() call that gets a command from the client.
The former placement in PostgresMain was unsafe because the intermediate
processing layers (especially SSL) use facilities such as malloc that are
not necessarily re-entrant.  Per report from counterstorm.com.
2005-06-02 21:03:46 +00:00
Michael Meskes
53b4a1ce4b Added patch by Gavin Scott <gavin@planetacetech.com> for Intel 64bit hardware.
[One half already was committed with the last commit.]
2005-06-02 12:49:26 +00:00
Michael Meskes
d014a21624 Fixed memory leak in ecpglib by adding some missing free() commands. 2005-06-02 12:37:25 +00:00
Bruce Momjian
7b21f26ea7 Fix log_statement to properly recognize SELECT INTO and CREATE TABLE AS
and DDL statements.

Backpatch fix to 8.0.X.

Per report from Murthy Kambhampaty
2005-06-01 23:27:12 +00:00
Tom Lane
64f40008ec patternsel() was improperly stripping RelabelType from the derived
expressions it constructed, causing scalarineqsel to become confused
if the underlying variable was of a domain type.  Per report from
Kevin Grittner.
2005-06-01 17:05:25 +00:00
Teodor Sigaev
babd4714f6 Prevent to divide by zero and range out of 0..1 2005-06-01 11:45:42 +00:00
Tom Lane
3b3600148d Add test to WAL replay to verify that xl_prev points back to the previous
WAL record; this is necessary to be sure we recognize stale WAL records
when a WAL page was only partially written during a system crash.
2005-05-31 19:10:39 +00:00
Tom Lane
1c69be95f9 expandRTE and get_rte_attribute_type mistakenly always imputed typmod -1
to columns of an RTE that was a function returning RECORD with a column
definition list.  Apparently no one has tried to use non-default typmod
with a function returning RECORD before.
2005-05-29 17:10:35 +00:00
Bruce Momjian
1b46bcc0c3 Update Farsi FAQ.
Mahmoud Taghizadeh
2005-05-27 22:10:20 +00:00
Neil Conway
92525dd6c9 Adjust datetime parsing to be more robust. We now pass the length of the
working buffer into ParseDateTime() and reject too-long input there,
rather than checking the length of the input string before calling
ParseDateTime(). The old method was bogus because ParseDateTime() can use
a variable amount of working space, depending on the content of the
input string (e.g. how many fields need to be NUL terminated). This fixes
a minor stack overrun -- I don't _think_ it's exploitable, although I
won't claim to be an expert.

Along the way, fix a bug reported by Mark Dilger: the working buffer
allocated by interval_in() was too short, which resulted in rejecting
some perfectly valid interval input values. I added a regression test for
this fix.
2005-05-26 02:10:03 +00:00
Peter Eisentraut
9a1a986580 Translation updates 2005-05-25 08:37:22 +00:00
Tatsuo Ishii
afc0e843b9 Fix previous patch to exprTypmod. 2005-05-25 02:17:55 +00:00
Tatsuo Ishii
2a99455ca7 Inserting 5 characters into char(10) does not produce 5 padding spaces
if they are two-byte multibyte characters. Same thing can be happen
if octet_length(multibyte_chars) == n where n is char(n).
Long standing bug since 7.3 days. Per report and fix from Yoshiyuki Asaba.
2005-05-24 23:02:54 +00:00
Tom Lane
a94ace0796 Previous fix for "x FULL JOIN y ON true" failed to handle the case
where there was also a WHERE-clause restriction that applied to the
join.  The check on restrictlist == NIL is really unnecessary anyway,
because select_mergejoin_clauses already checked for and complained
about any unmergejoinable join clauses.  So just take it out.
2005-05-24 18:02:55 +00:00
Neil Conway
6d493ed7f5 Fix typo in PL/Perl Safe.pm initialization that prevented the proper
sharing of %_SHARED. From Andrew Dunstan.
2005-05-23 02:02:52 +00:00
Bruce Momjian
29167dd3d7 Update Japanese FAQ.
Jun Kuwamura
2005-05-20 15:53:52 +00:00
Neil Conway
621d5e1d72 Fix typo in ECPG docs, per Andreas Seltenreich. 2005-05-20 12:37:51 +00:00
Tom Lane
626be474d3 Guard against duplicate IDs in input file in SortTocFromFile().
Per report from Brian Hackett.
2005-05-17 17:30:41 +00:00
Bruce Momjian
ba5684691c Convert Chinese FAQ to valid XHTML, finally. 2005-05-17 04:18:30 +00:00
Bruce Momjian
c23e15cd42 Fix Chinese markup some more. 2005-05-17 03:41:14 +00:00
Bruce Momjian
390d460138 Update Chinese FAQ to xhtml. 2005-05-16 02:50:58 +00:00
Bruce Momjian
fd4d6853b7 Add -N make flag to bcc builds from /src dir. 2005-05-13 18:13:16 +00:00
Tom Lane
011af314b7 Add missing quote, per Dave Page. 2005-05-13 16:48:22 +00:00
Tom Lane
69664f11af Fix broken markup. 2005-05-13 16:47:03 +00:00
Tom Lane
f591a227df Update createuser examples to match the current program behavior,
and add an example showing assignment of a password.  Per suggestion
from Jari Aalto (via Martin Pitt).
2005-05-13 16:31:50 +00:00
Bruce Momjian
7b32956f37 Update chinese encoding specification. 2005-05-13 13:48:05 +00:00
Neil Conway
9ac4af6847 Fix bug in COPY CSV mode: handle consecutive embedded newlines in COPY
input. Also add a regression test for this bug. From Andrew Dunstan.
2005-05-13 06:35:25 +00:00
Bruce Momjian
928d269abf Fix pg_autovacuum -s flag to handle values > 2000 by using sleep()
instead of pg_usleep.

Backpatch to 8.0.X.
2005-05-11 17:58:32 +00:00
Bruce Momjian
b5e4dc25f1 Update FAQ URLs.
Robert Treat
2005-05-11 16:13:58 +00:00
Bruce Momjian
b746e49c87 Document where to download free Microsoft and Borland development tools. 2005-05-11 16:02:59 +00:00
Bruce Momjian
4401b762c2 Document that bcc compiles now need the -N flag, backpatch to 8.0.X. 2005-05-11 15:10:56 +00:00