Commit Graph

15854 Commits

Author SHA1 Message Date
Bruce Momjian 63e464a5e6 Remove ancient AIX structure workaround. 2006-06-06 16:20:11 +00:00
Bruce Momjian ed3b2e696b Have BCC echo output "" using "", rather than \"\" as earlier reported.
Backpatch to 8.1.X.
2006-06-06 16:17:20 +00:00
Michael Meskes 0251602fc9 Fixed two more memory leaks in ecpglib.
Synced parser.
2006-06-06 11:31:55 +00:00
Tom Lane ff0ac57db9 Remove extremely old, incomplete, broken example code.
Per my proposal a few days ago.
2006-06-05 21:16:32 +00:00
Tom Lane 7868590c61 While making the seq_page_cost changes, I was struck by the fact that
cost_nonsequential_access() is really totally inappropriate for its only
remaining use, namely estimating I/O costs in cost_sort().  The routine
was designed on the assumption that disk caching might eliminate the need
for some re-reads on a random basis, but there's nothing very random in
that sense about sort's access pattern --- it'll always be picking up the
oldest outputs.  If we had a good fix on the effective cache size we
might consider charging zero for I/O unless the sort temp file size
exceeds it, but that's probably putting much too much faith in the
parameter.  Instead just drop the logic in favor of a fixed compromise
between seq_page_cost and random_page_cost per page of sort I/O.
2006-06-05 20:56:33 +00:00
Bruce Momjian b7af62e4a9 Avoid longjump/vfork warning about line_saved_in_history variable by
making it volatile.
2006-06-05 14:47:38 +00:00
Bruce Momjian a073a70415 Have psql history save \e editor contents to history before query is
executed, like it did for 8.1.X.
2006-06-05 03:55:00 +00:00
Tom Lane e4de635a2b Increase the default value of cpu_index_tuple_cost from 0.001 to 0.005.
This shouldn't affect simple indexscans much, while for bitmap scans that
are touching a lot of index rows, this seems to bring the estimates more
in line with reality.  Per recent discussion.
2006-06-05 03:03:42 +00:00
Tom Lane eed6c9ed7e Add a GUC parameter seq_page_cost, and use that everywhere we formerly
assumed that a sequential page fetch has cost 1.0.  This patch doesn't
in itself change the system's behavior at all, but it opens the door to
people adopting other units of measurement for EXPLAIN costs.  Also, if
we ever decide it's worth inventing per-tablespace access cost settings,
this change provides a workable intellectual framework for that.
2006-06-05 02:49:58 +00:00
Bruce Momjian a837851dc0 Fix psql so \r is separate in the history, rather than at the end of
the query.
2006-06-04 04:35:55 +00:00
Tom Lane f2de12e50e Don't choke during startup if the environment offers an invalid value
for LC_MESSAGES; instead, just press forward, leaving the effective setting
at 'C'.  There is not any very good reason to complain when we are going
to replace the value soon with whatever postgresql.conf says.  This change
should solve the occasionally-reported problem of initdb failing with
'failed to initialize lc_messages'; the current theory is that that is
a reflection of either wrong LANG/LC_MESSAGES or completely broken locale
support.
2006-06-03 17:36:10 +00:00
Tom Lane 84e741f4f9 Fix copy-and-pasteo in Russian translation: message complaining about
HAVE_INT64_TIMESTAMP was mentioning PG_CONTROL_VERSION instead.
Victor Snezhko
2006-06-03 16:48:59 +00:00
Bruce Momjian be05b260a9 Remove pg_resetxlog -r flag, feature has problems referenced here:
http://archives.postgresql.org/pgsql-hackers/2006-05/msg00002.php
2006-06-03 02:19:24 +00:00
Tom Lane 87e8014d31 Respond to Jeremy Drake's original gripe that \copy needs to recognize
E'...' syntax for strings in order to track the backend.
2006-06-01 01:28:00 +00:00
Tom Lane 6178762fcf Fix up hack to suppress escape_string_warning so that it actually works
and there's only one place that's a kluge, ie, appendStringLiteralConn.
Note that pg_dump itself doesn't use appendStringLiteralConn, so its
behavior is not affected; only the other utility programs care.
2006-06-01 00:15:36 +00:00
Tom Lane c6d3c1b817 Fix seriously broken patch for psql '' ... per its comment, emit() is
NOT the thing to use here.
2006-05-31 22:11:44 +00:00
Tom Lane 8f165ee13b Make PG_MODULE_MAGIC required in shared libraries that are loaded into
the server.  Per discussion, there seems no point in a waiting period
before making this required.
2006-05-31 20:58:09 +00:00
Bruce Momjian c3c3902611 Support '' for literal ' in psql single-quote strings, documentation update. 2006-05-31 11:35:17 +00:00
Bruce Momjian eaca1175e9 Escape processing patch:
o  turns off escape_string_warning in pg_dumpall.c
        o  optionally use E'' for \password (undocumented option?)
        o  honor standard_conforming-strings for \copy (but not
           support literal E'' strings)
        o  optionally use E'' for \d commands
        o  turn off escape_string_warning for createdb, createuser,
           droplang
2006-05-31 11:02:42 +00:00
Bruce Momjian 751d985805 Update cvs command example to show diff -rBASE. 2006-05-31 10:24:29 +00:00
Michael Meskes 085e7c2fd8 Somehow a ";" got lost which changed the logic. This btw is the first fix resulting from SoC. 2006-05-31 08:12:48 +00:00
Tom Lane a0ffab351e Magic blocks don't do us any good unless we use 'em ... so install one
in every shared library.
2006-05-30 22:12:16 +00:00
Tom Lane e60cb3a35c Code review for magic-block patch. Remove separate header file pgmagic.h,
as this seems only likely to create headaches for module developers.  Put
the macro in the pre-existing fmgr.h file instead.  Avoid being too cute
about how many fields we can cram into a word, and avoid trying to fetch
from a library we've already unlinked.
Along the way, it occurred to me that the magic block really ought to be
'const' so it can be stored in the program text area.  Do the same for
the existing data blocks for PG_FUNCTION_INFO_V1 functions.
2006-05-30 21:21:30 +00:00
Tom Lane a18ebc5541 Code review for EXPLAIN patch. Fix some typos, make it behave sanely
across multiple loops, get rid of the shaky assumption that exactly one
tuple is returned per node iteration.
2006-05-30 19:24:25 +00:00
Tom Lane 3993bd8e07 PostmasterIsAlive test really ought to be in the inner loop for safety. 2006-05-30 17:08:14 +00:00
Tom Lane 03f963640f Remove pqsignalinquire(), which is unused and has portability issues. 2006-05-30 15:57:56 +00:00
Tom Lane d898de1f3b Update ppport.h to not cause warnings with newest Perl versions.
This is just the minimal necessary change; we might want to adopt
later PPPort output instead.
2006-05-30 15:48:20 +00:00
Bruce Momjian 01b2168c90 Add pgmagic header block to store compile-time constants:
It now only checks four things:

Major version number (7.4 or 8.1 for example)
NAMEDATALEN
FUNC_MAX_ARGS
INDEX_MAX_KEYS

The three constants were chosen because:

1. We document them in the config page in the docs
2. We mark them as changable in pg_config_manual.h
3. Changing any of these will break some of the more popular modules:

FUNC_MAX_ARGS changes fmgr interface, every module uses this NAMEDATALEN
changes syscache interface, every PL as well as tsearch uses this
INDEX_MAX_KEYS breaks tsearch and anything using GiST.

Martijn van Oosterhout
2006-05-30 14:09:32 +00:00
Bruce Momjian 87bd07d979 Make EXPLAIN sampling smarter, to avoid excessive sampling delay.
Martijn van Oosterhout
2006-05-30 14:01:58 +00:00
Tom Lane 53d669e5c6 Clarify the HINT for 'checkpoint request failed', per recent complaint
demonstrating that its intent wasn't obvious.
2006-05-30 13:58:49 +00:00
Bruce Momjian 4d06e86d04 Revert patch, needs more work:
---------------------------------------------------------------------------

Add dynamic record inspection to PL/PgSQL, useful for generic triggers:

  tval2 := r.(cname);

or

  columns := r.(*);

Titus von Boxberg
2006-05-30 13:40:56 +00:00
Bruce Momjian fc079f8411 Move conversion dependency patch to the proper branch, out of 8.1.X,
into HEAD.
2006-05-30 13:36:30 +00:00
Bruce Momjian 9eb0d6a6b2 Prevent multiple archivers from starting. Backpatch to 8.1.X.
Simon Riggs
2006-05-30 13:30:49 +00:00
Bruce Momjian 26cfefabad Fix printf mask for SizeVfdCache
Qingqing Zhou
2006-05-30 13:04:59 +00:00
Bruce Momjian 39b031d417 Add "inline" compile fix for MSVC/BCC:
#define inline __inline

Backpatch to 8.1.X.

Hiroshi Saito
2006-05-30 12:43:28 +00:00
Bruce Momjian 38c7700f56 Add dynamic record inspection to PL/PgSQL, useful for generic triggers:
tval2 := r.(cname);

or

  columns := r.(*);

Titus von Boxberg
2006-05-30 12:03:13 +00:00
Bruce Momjian 88ba64d396 Back out patch, wrong previous commit message. 2006-05-30 11:58:05 +00:00
Bruce Momjian b6477c6295 Add regexp_replace() to string functions section.
Joachim Wieland
2006-05-30 11:54:51 +00:00
Tom Lane d52a97dd7e Fix ancient misdescription of namegt/namege in comment. Greg Stark 2006-05-30 05:22:59 +00:00
Bruce Momjian e8ea69e3fa Patch reverted because of random buildfarm failures:
---------------------------------------------------------------------------

Delay write of pg_stats file to once every five minutes, during
shutdown, or when requested by a backend:

It changes so the file is only written once every 5 minutes (changeable
of course, I just picked something) instead of once every half second.
It's still written when the stats collector shuts down, just as before.
And it is now also written on backend request. A backend requests a
rewrite by simply sending a special stats message. It operates on the
assumption that the backends aren't actually going to read the
statistics file very often, compared to how frequent it's written today.

Magnus Hagander
2006-05-30 02:35:39 +00:00
Bruce Momjian fa54cd0432 Add PQclear() calls, for completeness (exits shortly anyway). 2006-05-29 19:52:46 +00:00
Andrew Dunstan 21e343da35 Make plperl's $_TD trigger data a global rather than a lexical variable,
with a fresh local value for each invocation, to avoid unexpected sharing
violations. Per recent -hackers discussion.
2006-05-29 13:51:23 +00:00
Teodor Sigaev b32000eda4 Som improve page split in multicolumn GiST index.
If user picksplit on n-th column generate equals
left and right unions then it calls picksplit on n+1-th
column.
2006-05-29 12:50:06 +00:00
Teodor Sigaev 0a6fde5a26 Correct cheking in findParents(). i
From Andreas Seltenreich <andreas+pg@gate450.dyndns.org>
2006-05-29 08:39:44 +00:00
Tom Lane fd15c87ad7 enlargePQExpBuffer, alone among the functions exported by pqexpbuffer.h,
wasn't exported by exports.txt.  Ooops.  Per buildfarm results.
2006-05-28 22:42:05 +00:00
Tom Lane 134b463f02 Fix up pg_dump to do string escaping fully correctly for client encoding
and standard_conforming_strings; likewise for the other client programs
that need it.  As per previous discussion, a pg_dump dump now conforms
to the standard_conforming_strings setting of the source database.
We don't use E'' syntax in the dump, thereby improving portability of
the SQL.  I added a SET escape_strings_warning = off command to keep
the dumps from getting a lot of back-chatter from that.
2006-05-28 21:13:54 +00:00
Alvaro Herrera 117d73a9e7 Don't call PQclear until the struct is really no longer going to be used.
Per Coverity bug #304.  Thanks to Martijn van Oosterhout for reporting it.

Zero out the pointer fields of PGresult so that these mistakes are more
easily catched, per discussion.
2006-05-28 17:23:29 +00:00
Andrew Dunstan 7a6676d9df fix typo 2006-05-28 03:12:00 +00:00
Andrew Dunstan 3a9ae3d206 TG_table_name and TG_table_schema for plpgsql, plus docs and regression. 2006-05-28 03:03:17 +00:00
Alvaro Herrera 3d58a1c168 Remove traces of otherwise unused RELKIND_SPECIAL symbol. Leave the psql bits
in place though, so that it plays nicely with older servers.

Per discussion.
2006-05-28 02:27:08 +00:00