Commit Graph

8738 Commits

Author SHA1 Message Date
Tom Lane cae7ad906a Fix dblink_connect() so that it verifies that a password is supplied in the
conninfo string *before* trying to connect to the remote server, not after.
As pointed out by Marko Kreen, in certain not-very-plausible situations
this could result in sending a password from the postgres user's .pgpass file,
or other places that non-superusers shouldn't have access to, to an
untrustworthy remote server.  The cleanest fix seems to be to expose libpq's
conninfo-string-parsing code so that dblink can check for a password option
without duplicating the parsing logic.

Joe Conway, with a little cleanup by Tom Lane
2008-09-22 13:55:14 +00:00
Tom Lane 3290e6180f Add a PQfireResultCreateEvents function to allow applications to mimic the
sequence of operations that libpq goes through while creating a PGresult.
Also, remove ill-considered "const" decoration on parameters passed to
event procedures.
2008-09-19 20:06:13 +00:00
Tom Lane 4e57668da4 Create a selectivity estimation function for the text search @@ operator.
Jan Urbanski
2008-09-19 19:03:41 +00:00
Tom Lane e2b7d0c65c Improve the recently-added libpq events code to provide more consistent
guarantees about whether event procedures will receive DESTROY events.
They no longer need to defend themselves against getting a DESTROY
without a successful prior CREATE.

Andrew Chernow
2008-09-19 16:40:40 +00:00
Tom Lane 9fe79c39ca Preliminary release notes for upcoming back branch releases. 2008-09-17 20:57:35 +00:00
Tom Lane 32f159cc55 Add an "events" system to libpq, whereby applications can get callbacks that
enable them to manage private data associated with PGconns and PGresults.

Andrew Chernow and Merlin Moncure
2008-09-17 04:31:08 +00:00
Tom Lane 4adc2f72a4 Change hash indexes to store only the hash code rather than the whole indexed
value.  This means that hash index lookups are always lossy and have to be
rechecked when the heap is visited; however, the gain in index compactness
outweighs this when the indexed values are wide.  Also, we only need to
perform datatype comparisons when the hash codes match exactly, rather than
for every entry in the hash bucket; so it could also win for datatypes that
have expensive comparison functions.  A small additional win is gained by
keeping hash index pages sorted by hash code and using binary search to reduce
the number of index tuples we have to look at.

Xiao Meng

This commit also incorporates Zdenek Kotala's patch to isolate hash metapages
and hash bitmaps a bit better from the page header datastructures.
2008-09-15 18:43:41 +00:00
Magnus Hagander 440b3384b0 Add missing quotes. 2008-09-15 12:41:54 +00:00
Magnus Hagander 9872381090 Parse pg_hba.conf in postmaster, instead of once in each backend for
each connection. This makes it possible to catch errors in the pg_hba
file when it's being reloaded, instead of silently reloading a broken
file and failing only when a user tries to connect.

This patch also makes the "sameuser" argument to ident authentication
optional.
2008-09-15 12:32:57 +00:00
Magnus Hagander 5a1d35ce5c Polish and Turkish FAQ also needed converting to UTF8 2008-09-15 08:50:09 +00:00
Magnus Hagander 3a58d2e172 Convert Russian FAQ to UTF8, to make it render properly on the website. 2008-09-15 08:40:46 +00:00
Tom Lane ffea8fd381 Update citext's documentation to match the recently-applied patch,
per David Wheeler.
2008-09-12 18:29:49 +00:00
Peter Eisentraut cdd0895978 Update man page build instructions. 2008-09-12 08:43:53 +00:00
Tom Lane cff4aa6ad6 Add a duration option to pgbench, so that test length can be specified in seconds
instead of by number of transactions to run.  Takahiro Itagaki
2008-09-11 23:52:48 +00:00
Tom Lane 06edce4c3f Tighten up to_date/to_timestamp so that they are more likely to reject
erroneous input, rather than silently producing bizarre results as formerly
happened.

Brendan Jurd
2008-09-11 17:32:34 +00:00
Tom Lane 70530c808b Adjust the parser to accept the typename syntax INTERVAL ... SECOND(n)
and the literal syntax INTERVAL 'string' ... SECOND(n), as required by the
SQL standard.  Our old syntax put (n) directly after INTERVAL, which was
a mistake, but will still be accepted for backward compatibility as well
as symmetry with the TIMESTAMP cases.

Change intervaltypmodout to show it in the spec's way, too.  (This could
potentially affect clients, if there are any that analyze the typmod of an
INTERVAL in any detail.)

Also fix interval input to handle 'min:sec.frac' properly; I had overlooked
this case in my previous patch.

Document the use of the interval fields qualifier, which up to now we had
never mentioned in the docs.  (I think the omission was intentional because
it didn't work per spec; but it does now, or at least close enough to be
credible.)
2008-09-11 15:27:30 +00:00
Alvaro Herrera 3b9ec4682c Add "source file" and "source line" information to each GUC variable.
initdb forced due to changes in the pg_settings view.

Magnus Hagander and Alvaro Herrera.
2008-09-10 18:09:20 +00:00
Tom Lane a0b76dc662 Create a separate grantable privilege for TRUNCATE, rather than having it be
always owner-only.  The TRUNCATE privilege works identically to the DELETE
privilege so far as interactions with the rest of the system go.

Robert Haas
2008-09-08 00:47:41 +00:00
Tom Lane 8818f3793e Clarify description of pg_restore's handling of large objects. 2008-09-07 19:12:57 +00:00
Tom Lane 2cf3f6694f Add a few more details in the source-code-formatting documentation.
This isn't exhaustive but it covers some of the more common layout
mistakes I've seen in submitted patches.
2008-09-07 02:01:04 +00:00
Bruce Momjian 1cfd878643 Clarify documention workding for xip_list().
Simon Riggs
2008-09-07 01:29:36 +00:00
Tom Lane 409c144d83 Adjust psql's new \ef command to present an empty CREATE FUNCTION template
for editing if no function name is specified.  This seems a much cleaner way
to offer that functionality than the original patch had.  In passing,
de-clutter the error displays that are given for a bogus function-name
argument, and standardize on "$function$" as the default delimiter for the
function body.  (The original coding would use the shortest possible
dollar-quote delimiter, which seems to create unnecessarily high risk of
later conflicts with the user-modified function body.)
2008-09-06 20:18:08 +00:00
Tom Lane 2c863ca818 Implement a psql command "\ef" to edit the definition of a function.
In support of that, create a backend function pg_get_functiondef().
The psql command is functional but maybe a bit rough around the edges...

Abhijit Menon-Sen
2008-09-06 00:01:25 +00:00
Peter Eisentraut 11f53b1063 Code coverage testing with gcov. Documentation is in the regression test
chapter.

Author: Michelle Caisse <Michelle.Caisse@Sun.COM>
2008-09-05 12:11:18 +00:00
Alvaro Herrera 7ad60b49dc Fixup pg_dumpall adding --lock-wait-timeout, to match pg_dump.
David Gould
2008-08-29 17:28:43 +00:00
Peter Eisentraut 7c31742a07 Remove all traces that suggest that a non-Bison yacc might be supported, and
change build system to use only Bison.  Simplify build rules, make file names
uniform.  Don't build the token table header file where it is not needed.
2008-08-29 13:02:33 +00:00
Tom Lane 6741688b16 Fix pg_dump docs to acknowledge that you can use -Z with plain text output. Pointed out by Daniel Migowski. 2008-08-26 00:03:15 +00:00
Tom Lane e36716a653 Add standard boilerplate sentence about when stats_temp_directory can be changed. 2008-08-25 19:03:37 +00:00
Magnus Hagander f1e237b6b2 Unconditionally write the statsfile when SIGHUP is received, to minimize
the window during which backends have no statistics file to read.
2008-08-25 18:55:43 +00:00
Alvaro Herrera 2bb4d09cac Have man page generation work on VPATH builds too. 2008-08-25 15:34:05 +00:00
Magnus Hagander be8d6c5c34 Make stats_temp_directory PGC_SIGHUP, and document how it may cause a temporary
"outage" of the statistics views.

This requires making the stats collector respond to SIGHUP, like the other
utility processes already did.
2008-08-25 15:11:01 +00:00
Bruce Momjian 42d313f546 Update link to developer's FAQ from main FAQ. 2008-08-23 01:55:36 +00:00
Bruce Momjian 8ddb739e9d Make "log_temp_files" super-user set only, like other logging options.
Simon Riggs
2008-08-22 18:47:07 +00:00
Bruce Momjian 8875a16ee1 Mention that pg_dump does not dump ALTER DATABASE ... SET commands;
backpatch to 8.3.X. Also fix markup that had just one bullet.
2008-08-21 22:25:44 +00:00
Alvaro Herrera edb6a4c02a Update URL. 2008-08-21 20:15:31 +00:00
Bruce Momjian 3c35de85e7 Remove tools and documention for generating TODO.html. 2008-08-20 18:22:28 +00:00
Bruce Momjian a8cd6cd109 TODO now in wiki, html version removed. 2008-08-20 18:21:33 +00:00
Bruce Momjian cbcd3f9a92 New TODO list URL wiki location listed; contents truncated. 2008-08-20 18:20:46 +00:00
Bruce Momjian 7303b20964 Not done:
< 	o -Allow an existing index to be marked as a table's primary key
> 	o Allow an existing index to be marked as a table's primary key
2008-08-19 19:19:53 +00:00
Tom Lane 9650830bc8 Cause the output from debug_print_parse, debug_print_rewritten, and
debug_print_plan to appear at LOG message level, not DEBUG1 as historically.
Make debug_pretty_print default to on.  Also, cause plans generated via
EXPLAIN to be subject to debug_print_plan.  This is all to make
debug_print_plan a reasonably comfortable substitute for the former behavior
of EXPLAIN VERBOSE.
2008-08-19 18:30:04 +00:00
Bruce Momjian 2aaca8e314 TODO done:
!       o Allow an existing index to be marked as a table's primary key
2008-08-19 16:56:42 +00:00
Alvaro Herrera a3faf37f49 Fix some issues that prevent this file to be processed by scripts.
While at it, mark a couple of items completed in 8.4:
!   o -Prevent long-lived temporary tables from causing frozen-xid
      advancement starvation

! * -Improve performance of shared invalidation queue for multiple CPUs

Also remove a couple of obsolete assignments.
2008-08-19 03:08:56 +00:00
Bruce Momjian 48a9d92159 Add to TODO:
>
> * Fix all set-returning system functions so they support a wildcard
>   target list
>
>   SELECT * FROM pg_get_keywords() works but SELECT * FROM
>   pg_show_all_settings() does not.
2008-08-18 15:02:46 +00:00
Bruce Momjian 909346eff0 Update instructions on generating TODO.html. 2008-08-16 19:39:03 +00:00
Bruce Momjian 58e8f9630a Add URL for:
* Improve ability to modify views via ALTER TABLE
<
>   http://archives.postgresql.org/pgsql-hackers/2008-08/msg00300.php
2008-08-16 02:36:58 +00:00
Bruce Momjian ef270fb9d2 Add to TODO:
>
> * Prevent query cancel packets from being replayed by an attacker,
>   especially when using SSL
>
>   http://archives.postgresql.org/pgsql-hackers/2008-08/msg00345.php
>
2008-08-16 02:15:33 +00:00
Bruce Momjian b9984ade83 Update Russian FAQ.
corochoone@gmail.com
2008-08-16 01:14:49 +00:00
Bruce Momjian 10c935527e Add new SQL training web site to FAQ:
<LI><A href=
    "http://sqlzoo.net">http://sqlzoo.net</A>
    </LI>
2008-08-16 00:32:36 +00:00
Magnus Hagander 5b8eb2b4b9 Make the temporary directory for pgstat files configurable by the GUC
variable stats_temp_directory, instead of requiring the admin to
mount/symlink the pg_stat_tmp directory manually.

For now the config variable is PGC_POSTMASTER. Room for further improvment
that would allow it to be changed on-the-fly.
2008-08-15 08:37:41 +00:00
Tom Lane e006a24ad1 Implement SEMI and ANTI joins in the planner and executor. (Semijoins replace
the old JOIN_IN code, but antijoins are new functionality.)  Teach the planner
to convert appropriate EXISTS and NOT EXISTS subqueries into semi and anti
joins respectively.  Also, LEFT JOINs with suitable upper-level IS NULL
filters are recognized as being anti joins.  Unify the InClauseInfo and
OuterJoinInfo infrastructure into "SpecialJoinInfo".  With that change,
it becomes possible to associate a SpecialJoinInfo with every join attempt,
which permits some cleanup of join selectivity estimation.  That needs to be
taken much further than this patch does, but the next step is to change the
API for oprjoin selectivity functions, which seems like material for a
separate patch.  So for the moment the output size estimates for semi and
especially anti joins are quite bogus.
2008-08-14 18:48:00 +00:00