Commit Graph

5896 Commits

Author SHA1 Message Date
Tom Lane de98a7e23a The default values for shared_buffers and max_connections are now 1000
and 100 respectively, if the platform will allow it.  initdb selects
values that are not too large to allow the postmaster to start, and
places these values in the installed postgresql.conf file.  This allows
us to continue to start up out-of-the-box on platforms with small SHMMAX,
while having somewhat-realistic default settings on platforms with
reasonable SHMMAX.  Per recent pghackers discussion.
2003-07-14 20:00:23 +00:00
Tom Lane b1eb992cc5 Fix a *second* buffer overrun bug in to_ascii(). Grumble. 2003-07-14 16:41:38 +00:00
Bruce Momjian cbdda3e2a9 Add description for new GUC context.
Aizaz Ahmed
2003-07-09 17:57:47 +00:00
Bruce Momjian 0ecc8ac425 Add special checks for non-super-user setting LOG_MIN_DURATION_STATEMENT
to zero.
2003-07-09 08:51:19 +00:00
Bruce Momjian bf889e649a Add new USERLIMIT GUC source level so certain options can be disabled
or increased only by super-users.

This fixes problems caused by making certain variables SUSET for
security reasons.
2003-07-09 06:47:34 +00:00
Tom Lane 841b4a2d55 tm2timestamp should return -1, not elog, on overflow. (In the backend
this is merely an API inconsistency, but in ecpg it's fatal.)  Also,
fix misconceived overflow test in HAVE_INT64_TIMESTAMP case.
2003-07-04 18:21:14 +00:00
Tom Lane b700a672fe Add --help-config facility to dump information about GUC parameters
without needing a running backend.  Reorder postgresql.conf.sample
to match new layout of runtime.sgml.  This commit re-adds work lost
in Wednesday's crash.
2003-07-04 16:41:22 +00:00
Tom Lane 79fafdf49c Some early work on error message editing. Operator-not-found and
function-not-found messages now distinguish the cases no-match and
ambiguous-match, and they follow the style guidelines too.
2003-07-04 02:51:34 +00:00
Tom Lane cdb8a844e6 Fix bug I introduced in recent rewrite of NUMERIC code: numeric to
integer conversions gave the wrong answer for values with stripped
trailing zeroes, such as 10000000.
2003-07-03 19:41:47 +00:00
Tom Lane b89140a7ec Do honest transformation and preprocessing of LIMIT/OFFSET clauses,
instead of the former kluge whereby gram.y emitted already-transformed
expressions.  This is needed so that Params appearing in these clauses
actually work correctly.  I suppose some might claim that the side effect
of 'SELECT ... LIMIT 2+2' working is a new feature, but I say this is
a bug fix.
2003-07-03 19:07:54 +00:00
Tom Lane 455891bf96 Code review for UPDATE tab SET col = DEFAULT patch ... whack it around
so it has some chance of working in rules ...
2003-07-03 16:34:26 +00:00
Tom Lane e3b1b6c0cd Aggregates can be polymorphic, using polymorphic implementation functions.
It also works to create a non-polymorphic aggregate from polymorphic
functions, should you want to do that.  Regression test added, docs still
lacking.  By Joe Conway, with some kibitzing from Tom Lane.
2003-07-01 19:10:53 +00:00
Tom Lane 02b5d8e371 Dept. of second thoughts: supporting inlining of polymorphic SQL functions
takes only a few more lines of code than preventing it, so might as well
support it.
2003-07-01 19:07:02 +00:00
Tom Lane e0016db7d2 STRENGH => STRENGTH, per Jon Jensen. 2003-07-01 13:49:47 +00:00
Tom Lane f973b74583 Department of second thoughts: even if we can't run the full parser on
a SQL function with polymorphic inputs, we can at least run the raw
parser to catch silly syntactic errors.
2003-07-01 01:28:32 +00:00
Tom Lane d6d07a0eea SQL functions can have arguments and results declared ANYARRAY or
ANYELEMENT.  The effect is to postpone typechecking of the function
body until runtime.  Documentation is still lacking.

Original patch by Joe Conway, modified to postpone type checking
by Tom Lane.
2003-07-01 00:04:39 +00:00
Peter Eisentraut 71e9f3b07f Change EXECUTE INTO to CREATE TABLE AS EXECUTE. 2003-07-01 00:04:31 +00:00
Tom Lane 219e29784d Add GUC option log_error_verbosity to control which fields of error
reports get put into the postmaster log.  Options are TERSE, DEFAULT,
VERBOSE, with the same behavior as implemented on the client side in
libpq.
2003-06-30 16:47:02 +00:00
Tom Lane 835bb975d8 Restructure building of join relation targetlists so that a join plan
node emits only those vars that are actually needed above it in the
plan tree.  (There were comments in the code suggesting that this was
done at some point in the dim past, but for a long time we have just
made join nodes emit everything that either input emitted.)  Aside from
being marginally more efficient, this fixes the problem noted by Peter
Eisentraut where a join above an IN-implemented-as-join might fail,
because the subplan targetlist constructed in the latter case didn't
meet the expectation of including everything.
Along the way, fix some places that were O(N^2) in the targetlist
length.  This is not all the trouble spots for wide queries by any
means, but it's a step forward.
2003-06-29 23:05:05 +00:00
Peter Eisentraut 4355d4fb21 Information schema views for group privileges, some corrections on column
privileges.
2003-06-29 15:14:41 +00:00
Peter Eisentraut ae20518c7e It was comparing the wrong pair of columns, which triggered the previously
mentioned bug.
2003-06-29 10:18:26 +00:00
Peter Eisentraut 823bd7d129 Add missing PO files from last commit. 2003-06-29 10:13:13 +00:00
Tom Lane bee217924d Support expressions of the form 'scalar op ANY (array)' and
'scalar op ALL (array)', where the operator is applied between the
lefthand scalar and each element of the array.  The operator must
yield boolean; the result of the construct is the OR or AND of the
per-element results, respectively.

Original coding by Joe Conway, after an idea of Peter's.  Rewritten
by Tom to keep the implementation strictly separate from subqueries.
2003-06-29 00:33:44 +00:00
Peter Eisentraut df7618020b Merge PO file updates from 7.3 branch. 2003-06-28 22:31:01 +00:00
Peter Eisentraut 2f80f81e5e Make information schema aware of arrays.
The view element_types is currently not functional, awaiting some fixes in
the planner (reported on -hackers).
2003-06-28 20:50:08 +00:00
Tom Lane ea886339b8 Add is_superuser parameter reporting, soon to be used by psql. 2003-06-27 19:08:38 +00:00
Tom Lane 7f1249a8d2 Fix compile warnings. 2003-06-27 17:07:03 +00:00
Peter Eisentraut b256f24264 First batch of object rename commands. 2003-06-27 14:45:32 +00:00
Tom Lane b3c0551eda Create real array comparison functions (that use the element datatype's
comparison functions), replacing the highly bogus bitwise array_eq.  Create
a btree index opclass for ANYARRAY --- it is now possible to create indexes
on array columns.
Arrange to cache the results of catalog lookups across multiple array
operations, instead of repeating the lookups on every call.
Add string_to_array and array_to_string functions.
Remove singleton_array, array_accum, array_assign, and array_subscript
functions, since these were for proof-of-concept and not intended to become
supported functions.
Minor adjustments to behavior in some corner cases with empty or
zero-dimensional arrays.

Joe Conway (with some editorializing by Tom Lane).
2003-06-27 00:33:26 +00:00
Tom Lane 0c985ab5a8 Add comment pointing out that XLByteToPrevSeg macro is not broken. 2003-06-26 18:23:07 +00:00
Bruce Momjian 111d8e522b Back out array mega-patch.
Joe Conway
2003-06-25 21:30:34 +00:00
Tom Lane 621691d816 In ISO datestyle, never emit just HH:MM, always emit HH:MM:SS or
HH:MM:SS.SSS... when there is a nonzero part-of-a-day field in an
interval value.  The seconds part used to be suppressed if zero,
but there's no equivalent behavior for timestamp, and since we're
modeling this format on timestamp it's probably wrong.  Per complaint
and patch from Larry Rosenman.
2003-06-25 21:14:15 +00:00
Tom Lane 5cf18b1ae3 Don't generate 'zero' typeids in the output from gen_cross_product.
This is no longer necessary or appropriate since we don't use zero typeid
as a wildcard anymore, and it fixes a nasty performance problem with
functions with many parameters.  Per recent example from Reuven Lerner.
2003-06-25 20:07:39 +00:00
Bruce Momjian ff4c69e021 Fix up JOIN .. USING with domains
The attached fixes select_common_type() to support the below case:

create table t1( c1 int);
create domain dom_c1 int;
create table t2(c1 dom_c1);
select * from t1 join t2 using( c1 );

I didn't see a need for maintaining the domain as the preferred type. A
simple getBaseType() call on all elements of the list seems to be
enough.

--
Rod Taylor <rbt@rbt.ca>
2003-06-25 04:32:03 +00:00
Bruce Momjian 53c4f1233f UPDATE ... SET <col> = DEFAULT
Rod Taylor
2003-06-25 04:19:24 +00:00
Bruce Momjian ca64391d6c Updated the pg_get_constraintdef() to use conbin. Update pg_dump to use
pg_get_constraintdef() for >= 70400.

Rod Taylor <rbt@rbt.ca>
2003-06-25 03:56:31 +00:00
Bruce Momjian c70e606a4c Includes:
- LIKE <subtable> [ INCLUDING DEFAULTS | EXCLUDING DEFAULTS ]
- Quick cleanup of analyze.c function prototypes.
- New non-reserved keywords (INCLUDING, EXCLUDING, DEFAULTS), SQL 200X

Opted not to extend for check constraints at this time.

As per the definition that it's user defined columns, OIDs are NOT
inherited.

Doc and Source patches attached.

--
Rod Taylor <rbt@rbt.ca>
2003-06-25 03:40:19 +00:00
Bruce Momjian d9ddbdaa95 > This change (I'm sure this will wrap poorly -- sorry):
> http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/include/libpq/pqcomm.h.diff?r1=1.85&r2=1.86
>
> modified SockAddr, but no corresponding change was made here
> (fe-auth.c:612):
>
>   case AUTH_REQ_KRB5:
> #ifdef KRB5
>   if (pg_krb5_sendauth(PQerrormsg, conn->sock, &conn->laddr.in,
>                        &conn->raddr.in,
>                        hostname) != STATUS_OK)
>
> It's not obvious to me what the change ought to be though.

This patch should hopefully fix both kerberos 4 and 5.

Kurt Roeckx
2003-06-25 01:19:47 +00:00
Bruce Momjian e1be2ee831 Here's a small patch to pg_hba.conf.sample that explains the use of CIDR
addresses.

Andrew Dunstan
2003-06-25 01:15:24 +00:00
Bruce Momjian dd23a882fa >> If a transaction marks a tuple for update and later commits without
>> actually having updated the tuple, [...] can we simply
>> set the HEAP_XMAX_INVALID hint bit of the tuple?
>
>AFAICS this is a reasonable thing to do.

Thanks for the confirmation.  Here's a patch which also contains some
more noncritical changes to tqual.c:
 .  make code more readable by introducing local variables for xvac
 .  no longer two separate branches for aborted and crashed.
    The actions were the same in all cases.

Manfred Koizar
2003-06-25 01:08:13 +00:00
Bruce Momjian 7f7919256a In an attempt to simplify my life I'm submitting this patch that
restructures the deferred trigger queue.  The fundamental change is to
put all the static variables to hold the deferred triggers in a single
structure.

Alvaro Herrera
2003-06-24 23:25:44 +00:00
Bruce Momjian 46bf651480 Array mega-patch.
Joe Conway
2003-06-24 23:14:49 +00:00
Bruce Momjian 4b1fe23153 Prevent compiler warning from sprintf in recent ipv6 patch. 2003-06-24 22:42:42 +00:00
Bruce Momjian 945543d919 Add ipv6 address parsing support to 'inet' and 'cidr' data types.
Regression tests for IPv6 operations added.

        Documentation updated to document IPv6 bits.

        Stop treating IPv4 as an "unsigned int" and IPv6 as an array of
        characters.  Instead, always use the array of characters so we
        can have one function fits all.  This makes bitncmp(), addressOK(),
        and several other functions "just work" on both address families.

        add family() function which returns integer 4 or 6 for IPv4 or
        IPv6.  (See examples below)  Note that to add this new function
        you will need to dump/initdb/reload or find the correct magic
        to add the function to the postgresql function catalogs.

        IPv4 addresses always sort before IPv6.

        On disk we use AF_INET for IPv4, and AF_INET+1 for IPv6 addresses.
        This prevents the need for a dump and reload, but lets IPv6 parsing
        work on machines without AF_INET6.

        To select all IPv4 addresses from a table:

                select * from foo where family(addr) = 4 ...

        Order by and other bits should all work.

Michael Graff
2003-06-24 22:21:24 +00:00
Tom Lane bff0422b6c Revise hash join and hash aggregation code to use the same datatype-
specific hash functions used by hash indexes, rather than the old
not-datatype-aware ComputeHashFunc routine.  This makes it safe to do
hash joining on several datatypes that previously couldn't use hashing.
The sets of datatypes that are hash indexable and hash joinable are now
exactly the same, whereas before each had some that weren't in the other.
2003-06-22 22:04:55 +00:00
Tom Lane 4342e6ea18 Fix for extended-query protocol: in event of error, backend was issuing
a ReadyForQuery (Z message) immediately and then another one after the
Sync message arrives.  Suppress the first one to make it work per spec.
2003-06-20 21:58:02 +00:00
Tom Lane 1bd22f55cf Disallow dollar sign in operator names, instead allow it as a non-first
character in identifiers.  The first change eliminates the current need
to put spaces around parameter references, as in "x<=$2".  The second
change improves compatibility with Oracle and some other RDBMSes.  This
was discussed and agreed to back in January, but did not get done.
2003-06-19 23:22:40 +00:00
Tom Lane eab5d643b2 Make FLOAT(p) measure the precision p in bits, not decimal digits, to
match the SQL standard.  Document FLOAT and FLOAT(p) notations in
datatype.sgml.  Per recent pghackers discussion.
2003-06-17 23:12:36 +00:00
Peter Eisentraut 596652d6eb More information schema views. 2003-06-17 18:00:48 +00:00
Tom Lane 3467b1a1f9 Fix bugs in interval-to-time conversion: HAVE_INT64_TIMESTAMP case did not
work at all, and neither case behaved sanely for negative intervals.
2003-06-16 18:56:45 +00:00