Commit Graph

14650 Commits

Author SHA1 Message Date
Bruce Momjian 7504f0bae8 Reverse this patch:
---------------------------------------------------------------------------

> A quick look shows that when you use --with-libraries=/foo/bar the
> generated link line for libraries says
>
>  -L/foo/bar -lpq
>
> and it should probably be the other way around (as it is for the
> executables).
>
> So I suspect we need some makefile tuning.

You were correct. This patch fixes it.

Jim C. Nasby
2005-07-04 04:17:00 +00:00
Neil Conway 3f39cbdce1 Fix build break for out of tree (vpath) builds, induced by recent zic
changes.
2005-07-04 02:55:59 +00:00
Tom Lane bee9aef43b Fix memory leak in plperl_hash_from_tuple(), per report from Jean-Max Reymond. 2005-07-03 21:56:16 +00:00
Tom Lane ae9a07bf9e Don't try to constant-fold functions returning RECORD. We were never
able to do this before, but I had tried to make an exception for functions
with OUT parameters.  Michael Fuhr found one problem with it already, and
I found another, which was it didn't work for strict functions with a
NULL input.  While both of these could be worked around, the probability
that there are more gotchas seems high; I think prudence dictates just
reverting to the former behavior for now.  Accordingly, remove the kluge
added to get_expr_result_type() for Michael's case.
2005-07-03 21:14:18 +00:00
Peter Eisentraut 85884cb1de Support cross compilation by compiling "zic" with a native compiler. This
relies on the output of zic being platform independent, but that is
currently the case.
2005-07-03 18:54:28 +00:00
Tom Lane cc9bcbc8a4 Improve outer-join-deduction logic to be able to propagate equalities
through multiple join clauses.
2005-07-03 18:26:32 +00:00
Bruce Momjian 16661d60ab > A quick look shows that when you use --with-libraries=/foo/bar the
> generated link line for libraries says
>
>  -L/foo/bar -lpq
>
> and it should probably be the other way around (as it is for the
> executables).
>
> So I suspect we need some makefile tuning.

You were correct. This patch fixes it.

Jim C. Nasby
2005-07-02 23:28:22 +00:00
Tom Lane cc5e80b8d1 Teach planner about some cases where a restriction clause can be
propagated inside an outer join.  In particular, given
LEFT JOIN ON (A = B) WHERE A = constant, we cannot conclude that
B = constant at the top level (B might be null instead), but we
can nonetheless put a restriction B = constant into the quals for
B's relation, since no inner-side rows not meeting that condition
can contribute to the final result.  Similarly, given
FULL JOIN USING (J) WHERE J = constant, we can't directly conclude
that either input J variable = constant, but it's OK to push such
quals into each input rel.  Per recent gripe from Kim Bisgaard.
Along the way, remove 'valid_everywhere' flag from RestrictInfo,
as on closer analysis it was not being used for anything, and was
defined backwards anyway.
2005-07-02 23:00:42 +00:00
Bruce Momjian 87e01d1eed Improve wrapping of long lines in postgresql.conf. 2005-07-02 18:46:45 +00:00
Bruce Momjian 6aa0fdc4aa Use on/off consistently for GUC variables in postgresql.conf and the
documentation, to match SHOW.
2005-07-02 18:29:04 +00:00
Bruce Momjian 74b49a8129 Add E'' to internally created SQL strings that contain backslashes.
Improve code clarity by using macros for E'' processing.
2005-07-02 17:01:59 +00:00
Neil Conway c425dcb4ec In PL/PgSQL, allow a block's label to be optionally specified at the
end of the block:

<<label>>
begin
    ...
end label;

Similarly for loops. This is per PL/SQL. Update the documentation and
add regression tests. Patch from Pavel Stehule, code review by Neil
Conway.
2005-07-02 08:59:48 +00:00
Tom Lane 784b948984 Fix platform-dependency in recently added regression tests.
Per buildfarm results.
2005-07-01 23:18:01 +00:00
Bruce Momjian 539bc9fc91 Add code to pg_dump to use E'' strings when backslashes are used in dump
files.
2005-07-01 21:03:25 +00:00
Tom Lane 975368e267 Avoid function name conflict when plpgsql and rangefuncs regression tests
execute in parallel.  Spotted by Peter.
2005-07-01 20:29:02 +00:00
Tom Lane e7e1694295 Migrate rtree_gist functionality into the core system, and add some
basic regression tests for GiST to the standard regression tests.
I took the opportunity to add an rtree-equivalent gist opclass for
circles; the contrib version only covered boxes and polygons, but
indexing circles is very handy for distance searches.
2005-07-01 19:19:05 +00:00
Peter Eisentraut 875efad481 Update to autoconf 2.59 as well as updates of related scripts 2005-07-01 18:17:31 +00:00
Bruce Momjian 2f7d369a5c Clarify code to double \\ and '. 2005-07-01 17:40:29 +00:00
Bruce Momjian 8f6e8e8fed Clarify documentation about log_min_duration_statement. 2005-07-01 13:29:25 +00:00
Teodor Sigaev 5350216156 Improve error messages and add comment 2005-07-01 13:18:17 +00:00
Neil Conway 555f5139e0 Adds some missing error handling to PGTYPESnumeric_div() in ecpg's
pgtypeslib: (1) we need to check the return value of sub_abs() (2) we
need to check the return value of 4 calls to digitbuf_alloc().

Per Coverity static analysis performed by EnterpriseDB.
2005-07-01 05:13:58 +00:00
Neil Conway 9fad4cb604 Fix some minor infelicities in ecpg's pgtypeslib: (1) `pstr' must be
non-NULL in this function, so there is no need to check for it (2) we
should check the return value of pgtypes_strdup(). Patch from Eric
Astor at EnterpriseDB, with slight cleanup by myself, per a report
from the Coverity tool.
2005-07-01 05:12:06 +00:00
Teodor Sigaev 898a7bd13b Bug fixes for GiST crash recovery.
- add forgotten check of lsn for insert completion
- remove level of pages: hard to check in recovery
- some cleanups
2005-06-30 17:52:14 +00:00
Peter Eisentraut 7a30b1fb96 Issue fatal error if no TCP/IP sockets could be created 2005-06-30 10:02:22 +00:00
Neil Conway 117fde2d17 Minor ecpg tweak: the return value of calloc() is guaranteed to be NULL
or zero-filled; therefore zero-filling it via memset() is pointless.
(I think setting `errno' is probably a waste of cycles as well, but I
haven't changed that.)
2005-06-30 07:27:31 +00:00
Neil Conway 4802bb57a6 Warning cleanups for ecpg tests. Avoid doing pointer arithmetic on void *,
remove old-style function declarations, and mark a function "static".
There are some remaining warnings, but this fixes most of them, anyway.
2005-06-30 07:08:59 +00:00
Neil Conway 175c25a404 Fix ecpg's test/ Makefile for out-of-tree (vpath) builds. 2005-06-30 07:01:57 +00:00
Neil Conway dd4eea257b Fix build break on BSD, OSX, and other systems: add missing <sys/time.h>
include.
2005-06-30 03:48:58 +00:00
Tom Lane 51c58812d9 Dump comments for large objects. 2005-06-30 03:03:04 +00:00
Neil Conway 4714984149 Fix a theoretical memory leak in pg_password_sendauth(). If the first
malloc() succeeded but the second failed, the buffer allocated by the
first malloc() would be leaked. Fix this by allocating both buffers
via a single malloc(), as suggested by Tom.

Per Coverity static analysis performed by EnterpriseDB.
2005-06-30 01:59:20 +00:00
Tom Lane 401de9c8be Improve the checkpoint signaling mechanism so that the bgwriter can tell
the difference between checkpoints forced due to WAL segment consumption
and checkpoints forced for other reasons (such as CREATE DATABASE).  Avoid
generating 'checkpoints are occurring too frequently' messages when the
checkpoint wasn't caused by WAL segment consumption.  Per gripe from
Chris K-L.
2005-06-30 00:00:52 +00:00
Tom Lane b5f7cff84f Clean up the rather historically encumbered interface to now() and
current time: provide a GetCurrentTimestamp() function that returns
current time in the form of a TimestampTz, instead of separate time_t
and microseconds fields.  This is what all the callers really want
anyway, and it eliminates low-level dependencies on AbsoluteTime,
which is a deprecated datatype that will have to disappear eventually.
2005-06-29 22:51:57 +00:00
Tom Lane c33d575899 More cleanup on roles patch. Allow admin option to be inherited through
role memberships; make superuser/createrole distinction do something
useful; fix some locking and CommandCounterIncrement issues; prevent
creation of loops in the membership graph.
2005-06-29 20:34:15 +00:00
Teodor Sigaev 4523e0b63a Cleanup, remove unneeded pallocs 2005-06-29 14:06:14 +00:00
Bruce Momjian b3d06e5a95 Update typedefs for pgindent. 2005-06-28 23:55:30 +00:00
Bruce Momjian 249802725d Change awk ~ pattern from "" to //.
Remove extra backslash in pattern.  Luke Lonergan
2005-06-28 23:16:33 +00:00
Tom Lane 6561372c57 Fix up problems in write_auth_file and parsing of the auth file.
In particular, make hba.c cope with zero-length tokens, which it
never did properly before.  Also, enforce rolcanlogin.
2005-06-28 22:16:45 +00:00
Tom Lane 0eaa36a16a Bring syntax of role-related commands into SQL compliance. To avoid
syntactic conflicts, both privilege and role GRANT/REVOKE commands have
to use the same production for scanning the list of tokens that might
eventually turn out to be privileges or role names.  So, change the
existing GRANT/REVOKE code to expect a list of strings not pre-reduced
AclMode values.  Fix a couple other minor issues while at it, such as
InitializeAcl function name conflicting with a Windows system function.
2005-06-28 19:51:26 +00:00
Teodor Sigaev 88b49cdc95 Code cleanup. gistfillbuffer accepts InvalidOffsetNumber. 2005-06-28 15:51:00 +00:00
Tom Lane 365205dd2a Fix broken initdb -W option, per Michael Fuhr. 2005-06-28 15:38:12 +00:00
Tom Lane 7762619e95 Replace pg_shadow and pg_group by new role-capable catalogs pg_authid
and pg_auth_members.  There are still many loose ends to finish in this
patch (no documentation, no regression tests, no pg_dump support for
instance).  But I'm going to commit it now anyway so that Alvaro can
make some progress on shared dependencies.  The catalog changes should
be pretty much done.
2005-06-28 05:09:14 +00:00
Teodor Sigaev e8cab5fe49 Concurrency for GiST
- full concurrency for insert/update/select/vacuum:
        - select and vacuum never locks more than one page simultaneously
        - select (gettuple) hasn't any lock across it's calls
        - insert never locks more than two page simultaneously:
                - during search of leaf to insert it locks only one page
                  simultaneously
                - while walk upward to the root it locked only parent (may be
                  non-direct parent) and child. One of them X-lock, another may
                  be S- or X-lock
- 'vacuum full' locks index
- improve gistgetmulti
- simplify XLOG records

Fix bug in index_beginscan_internal: LockRelation may clean
  rd_aminfo structure, so move GET_REL_PROCEDURE after LockRelation
2005-06-27 12:45:23 +00:00
Tom Lane c3be085ab7 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:17:47 +00:00
Neil Conway a159ad3048 Remove support for Kerberos V4. It seems no one is using this, it has
some security issues, and upstream has declared it "dead". Patch from
Magnus Hagander, minor editorialization from Neil Conway.
2005-06-27 02:04:26 +00:00
Tom Lane 06ae88a82e Tweak dynahash.c to not allocate so many entries at once when dealing
with a table that has a small predicted size.  Avoids wasting several
hundred K on the timezone hash table, which is likely to have only one
or a few entries, but the entries use up 10Kb apiece ...
2005-06-26 23:32:34 +00:00
Tom Lane 943b396245 Add Oracle-compatible GREATEST and LEAST functions. Pavel Stehule 2005-06-26 22:05:42 +00:00
Tom Lane d395aecffa Code review for escape-strings patch. Sync psql and plpgsql lexers
with main, avoid using a SQL-defined SQLSTATE for what is most definitely
not a SQL-compatible error condition, fix documentation omissions,
adhere to message style guidelines, don't use two GUC_REPORT variables
when one is sufficient.  Nothing done about pg_dump issues.
2005-06-26 19:16:07 +00:00
Tom Lane 3cbd6bc308 Fix overlooked regression output file. 2005-06-26 17:20:04 +00:00
Bruce Momjian bb3cce4ec9 Add E'' syntax so eventually normal strings can treat backslashes
literally.

Add GUC variables:

        "escape_string_warning" - warn about backslashes in non-E strings
        "escape_string_syntax" - supports E'' syntax?
        "standard_compliant_strings" - treats backslashes literally in ''

Update code to use E'' when escapes are used.
2005-06-26 03:04:37 +00:00
Tom Lane c96375a39b Fix a couple of items that should be declared Oid not int. Purely
cosmetic at the moment, but someday Oid might be 64 bits ...
2005-06-25 23:58:58 +00:00