Commit Graph

1050 Commits

Author SHA1 Message Date
Peter Eisentraut 424f0edcb8 Fix relative path references so that make knowns which dependencies refer
to one another. Sort out builddir vs srcdir variable namings. Remove some
now obsoleted make variables.
2000-08-31 16:12:35 +00:00
Hiroshi Inoue 3498ea8308 Improve the following.
=# create table t (id int4 unique);
NOTICE:  CREATE TABLE/UNIQUE will create implicit index 't_id_key' for table 't'
 =# begin;
 query: drop table t;
NOTICE:  Caution: DROP TABLE cannot be rolled back, so don't abort now
NOTICE:  Caution: DROP INDEX cannot be rolled back, so don't abort now
 =# rollback;
 =# drop table t;
NOTICE:  mdopen: couldn't open t: No such file or directory
NOTICE:  RelationIdBuildRelation: smgropen(t): No such file or directory
NOTICE:  mdopen: couldn't open t: No such file or directory
NOTICE:  mdopen: couldn't open t: No such file or directory
NOTICE:  mdopen: couldn't open t_id_key: No such file or directory
NOTICE:  RelationIdBuildRelation: smgropen(t_id_key): No such file or directory
NOTICE:  mdopen: couldn't open t: No such file or directory
NOTICE:  RelationIdBuildRelation: smgropen(t): No such file or directory
NOTICE:  mdopen: couldn't open t: No such file or directory
ERROR:  cannot open relation t
2000-08-30 08:48:55 +00:00
Bruce Momjian dffd8cac3d * to_char:
- full support for IW (ISO week) and vice versa conversion for IW too
    (the to_char 'week' support is now complete and I hope correct).

  Thomas, I use for IW code from timestamp.c, for this I create separate
  function date2isoweek() from original 'case DTK_WEEK:' code in the
  timestamp_part(). I mean will better use one code for same feature in
  date_part() and in to_char(). The isoweek2date() is added to timestamp.c
  too. Right?

  IMHO in 7.1 will all to_char's features complete. It is cca 41 templates
  for date/time and cca 21 for numbers.

 * to_ascii:

   - gcc, is it correct now? :-)


  In the patch is documentation for to_char's IW and for to_ascii().

                                                        Karel
2000-08-29 04:41:48 +00:00
Peter Eisentraut 3ce5c6f4d8 Maybe "shared_buffers" is a slightly better name than "shmem_buffers" for -B. 2000-08-28 11:57:41 +00:00
Peter Eisentraut f03fc94e7d New configure test for flex, which recognizes only flex but does so in all
incarnations (I hope). When an acceptable flex version is not found, print
instructive error messages from both configure and the makefiles, so that
users can continue building anyway.
2000-08-28 11:53:23 +00:00
Tatsuo Ishii bfdd6a716d Change pg_mblen and pg_encoding_mblen return types from void
to int so that they return the number of whcars.
2000-08-27 10:40:48 +00:00
Tom Lane 196d6f4e35 Tired of seeing these warnings ... 2000-08-26 21:56:23 +00:00
Tom Lane d70bf0dd35 Rename BITSPERBYTE to BITS_PER_BYTE to avoid conflict with <values.h>
on some platforms.
2000-08-26 21:53:44 +00:00
Tom Lane 3d3ca010aa Avoid creating a TOAST table if we can prove that the maximum tuple
length is < TOAST_TUPLE_THRESHOLD, even with toastable column types
present.  For example, CREATE TABLE foo (f1 int, f2 varchar(100))
does not require a toast table, even though varchar is a toastable
type.
2000-08-25 18:05:54 +00:00
Peter Eisentraut 996832caee Make the location of the Kerberos server key file run time configurable
(rather than compile time). For libpq, even when Kerberos support is
compiled in, the default user name should still fall back to geteuid()
if it can't be determined via the Kerberos system.

A couple of fixes for string type configuration parameters, now that there
is one.
2000-08-25 10:00:35 +00:00
Tom Lane 782c16c6a1 SQL-language functions are now callable in ordinary fmgr contexts ...
for example, an SQL function can be used in a functional index.  (I make
no promises about speed, but it'll work ;-).)  Clean up and simplify
handling of functions returning sets.
2000-08-24 03:29:15 +00:00
Thomas G. Lockhart 8a35cbe1db Add functions to convert to and from text, and to truncate to MAC OUI.
Remove hardcoded macaddr_manuf(), which had really old, obsolete info.
 Replace this with some contrib/mac/ code to maniag OUI info from IEEE.
2000-08-23 06:04:49 +00:00
Tatsuo Ishii 88d7b4a250 Add multibyte support for both LIKE and ILIKE
Eliminate up-to-4-times memory allocation problem
2000-08-22 06:33:57 +00:00
Tom Lane 94e90d9a86 Add some more Assert checks. 2000-08-22 04:00:10 +00:00
Tom Lane 469673f966 Fix format_type() to display correct lengths for BIT/BIT VARYING.
Also, make it depend on type OIDs rather than type names for more
consistency with rest of backend.
2000-08-21 18:23:18 +00:00
Tom Lane b503cbe319 First pass at integrating BIT and BIT VARYING code from Adriaan Joubert.
Update functions to new-style fmgr, make BIT and VARBIT be binary-
equivalent, add entries to allow these types to be btree indexed,
correct a few bugs.  BIT/VARBIT are now toastable, too.
NOTE: initdb forced due to catalog updates.
2000-08-21 04:48:57 +00:00
Tom Lane 37168b8da4 Clean up handling of variable-free qual clauses. System now does the
right thing with variable-free clauses that contain noncachable functions,
such as 'WHERE random() < 0.5' --- these are evaluated once per
potential output tuple.  Expressions that contain only Params are
now candidates to be indexscan quals --- for example, 'var = ($1 + 1)'
can now be indexed.  Cope with RelabelType nodes atop potential indexscan
variables --- this oversight prevents 7.0.* from recognizing some
potentially indexscanable situations.
2000-08-13 02:50:35 +00:00
Tom Lane 134fdf34d6 Fix ruleutils to produce correct output for array assignment, such
as UPDATE foo SET arr[3] = 42.
2000-08-12 04:04:53 +00:00
Tom Lane 66fd8f854f Remove debugging Assert that should never have been committed in the
first place :-(
2000-08-11 18:35:50 +00:00
Tom Lane 7090c3e858 Make debug_assertions default to ON, when compiled in at all, for
backwards compatibility with old behavior.
2000-08-11 18:31:10 +00:00
Thomas G. Lockhart 5ab40f0b85 Reimplement MULTIBYTE support (oops). Not tested, but it does compile. 2000-08-09 14:13:03 +00:00
Tom Lane 62e29fe2e7 Remove 'func_tlist' from Func expression nodes, likewise 'param_tlist'
from Param nodes, per discussion a few days ago on pghackers.  Add new
expression node type FieldSelect that implements the functionality where
it's actually needed.  Clean up some other unused fields in Func nodes
as well.
NOTE: initdb forced due to change in stored expression trees for rules.
2000-08-08 15:43:12 +00:00
Tom Lane 0224177400 TOAST mop-up work: update comments for tuple-size-related symbols such
as MaxHeapAttributeNumber.  Increase MaxAttrSize to something more
reasonable (given what it's used for, namely checking char(n) declarations,
I didn't make it the full 1G that it could theoretically be --- 10Mb
seemed a more reasonable number).  Improve calculation of MaxTupleSize.
2000-08-07 20:16:13 +00:00
Thomas G. Lockhart 12e1c9efad Clean up code to remove the explicit backslash cruft.
If the backslash default is still wanted, just pass a backslash
 to MatchText() for the two-parameter callable routines.
2000-08-07 01:45:00 +00:00
Tom Lane 9426047021 Clean up bogosities in use of random(3) and srandom(3) --- do not assume
that RAND_MAX applies to them, since it doesn't.  Instead add a
config.h parameter MAX_RANDOM_VALUE.  This is currently set at 2^31-1
but could be auto-configured if that ever proves necessary.  Also fix
some outright bugs like calling srand() where srandom() is appropriate.
2000-08-07 00:51:42 +00:00
Thomas G. Lockhart 30ab107dbf Implement LIKE/ESCAPE. Change parser to use like()/notlike()
rather than the "~~" operator; this made it easy to add ESCAPE features.
Implement ILIKE, NOT ILIKE, and the ESCAPE clause for them.
 afaict this is not MultiByte clean, but lots of other stuff isn't either.
Fix up underlying support code for LIKE/NOT LIKE.
 Things should be faster and does not require internal string copying.
Update regression test to add explicit checks for
 LIKE/NOT LIKE/ILIKE/NOT ILIKE.
Remove colon and semi-colon operators as threatened in 7.0.
Implement SQL99 COMMIT/AND NO CHAIN.
 Throw elog(ERROR) on COMMIT/AND CHAIN per spec
 since we don't yet support it.
Implement SQL99 CREATE/DROP SCHEMA as equivalent to CREATE DATABASE.
 This is only a stopgap or demo since schemas will have another
 implementation soon.
Remove a few unused production rules to get rid of warnings
 which crept in on the last commit.
Fix up tabbing in some places by removing embedded spaces.
2000-08-06 18:06:44 +00:00
Tom Lane c3e2a951b4 Toast all the system-table columns that seem to need it. It turns out
that giving pg_proc a toast table required solving the same problems
we'd have to solve for pg_class --- pg_proc is one of the relations
that gets bootstrapped in relcache.c.  Solution is to go back at the
end of initialization and read in the *real* pg_class row to replace
the phony entry created by formrdesc().  This should work as long as
there's no need to touch any toasted values during initialization,
which seems a reasonable assumption.
Although I did not add a toast-table for every single system table
with a varlena attribute, I believe that it would work to just do
ALTER TABLE pg_class CREATE TOAST TABLE.  So anyone who's really
intent on having several thousand ACL entries for a rel could do it.
NOTE: I didn't force initdb, but you must do one to see the effects
of this patch.
2000-08-06 04:40:08 +00:00
Tom Lane 925418d2fa Ensure that catcache 'busy' flags are reset at transaction abort.
Without this, an elog during cache-entry load leaves that catcache
unusable.  elog in that segment of code is pretty unusual but it can
happen.
2000-08-06 04:17:47 +00:00
Bruce Momjian 75b61043b0 > I had to back out the patch. It only compiles with multi-byte enabled.
Ooops, I forget... here it is again.

> > >  If encoding is not supported returns ERROR.

 and if multibyte not enabled too....


 Thanks.

                                Karel
~
2000-08-05 14:59:29 +00:00
Bruce Momjian 129f1a31aa Back out to_ascii patch from Karel. 2000-08-04 20:46:47 +00:00
Bruce Momjian 403e522f15 Add missing files from Karel, tip from Jan. 2000-08-04 20:22:52 +00:00
Bruce Momjian 317ff59ced to_ascii( text )
- encode 'text' from database encoding to ASCII

        to_ascii('\256\341k')


 to_ascii( text, int4 )

        - encode 'text' from 'int4' encoding to ASCII

          to_ascii('\256\341k', 8)


 to_ascii( text, name )

        - encode 'text' from 'name' encoding to ASCII

          to_ascii('\256\341k', 'LATIN2')


  Now is supported LATIN1, LATIN2, WIN1250. For other character sets I
haven't good resources. Add new encoding is easy...

 If encoding is not supported returns ERROR.

 Note --- not exists total corect conversion to ASCII, this function try
        convert chars those is _probably_ interpret-able in ASCII for
        others use ' '. But for example for all Czech characters it is
        sufficient ... hmm Chinese / JAP and other complicated langs
have
        bad luck here :-(

                                                Karel
2000-08-04 15:45:12 +00:00
Tom Lane ed9ca68758 Convert inet-related functions to new fmgr style. I have also taken it
on myself to do something about the non-self-consistency of the inet
comparison functions.  The results are probably still semantically wrong
(inet and cidr should have different comparison semantics, I think)
but at least the boolean operators now agree with each other and with
the sort order of indexes on inet/cidr.
2000-08-03 23:07:51 +00:00
Tom Lane c298d74d49 More functions updated to new fmgr style --- money, name, tid datatypes.
We're reaching the mopup stage here (good thing too, this is getting
tedious).
2000-08-03 16:35:08 +00:00
Tom Lane 1bd3a8f58b Repair bug noted by Paul Caskey: neqsel() has been generating a bogus
result, in fact nearly the opposite of what it should, because it
was passing the not-equal operator to eqsel() which would use it to
compare the value against the most common value in the column, and
of course obtain the wrong result therefrom.  Must pass the equality
operator to eqsel() instead.  Fortunately that's easy to get from
the oprnegate link.
2000-08-03 00:58:22 +00:00
Tom Lane 463f1f5cda Convert all remaining float4 and float8 functions to new fmgr style.
At this point I think it'd be possible to make float4 be pass-by-value
without too much work --- and float8 too on machines where Datum is
8 bytes.  Something to try when the mood strikes, anyway.
2000-08-01 18:29:35 +00:00
Tom Lane 7d0c4188f1 Make acl-related functions safe for TOAST. Mark pg_class.relacl as
compressible but not externally storable (since we're not sure about
whether creating a toast relation for pg_class would work).
2000-07-31 22:39:17 +00:00
Tom Lane 8f9fa0e143 Type lztext is toast.
(Sorry, couldn't help it...)

Removed type filename as well, since it's unused and probably useless.
INITDB FORCED, because pg_rewrite columns are now plain text again.
2000-07-30 22:14:09 +00:00
Tom Lane 3a9a74a09d Convert all remaining geometric operators to new fmgr style. This
allows fixing problems with operators that expected to be able to
return a NULL, such as the '#' line-segment-intersection operator
that tried to return NULL when the two segments don't intersect.
(See, eg, bug report from 1-Nov-99 on pghackers.)  Fix some other
bugs in passing, such as backwards comparison in path_distance().
2000-07-30 20:44:02 +00:00
Tom Lane d70d46fd60 PATH and POLYGON datatypes are now TOASTable. Associated functions
updated to new fmgr style.  Deleted hoary old functions for compatibility
with pre-6.1 representations of these datatypes.
2000-07-29 18:46:12 +00:00
Tom Lane 1ebe1da296 bpchar, varchar, bytea, numeric are toastable --- if you initdb, which
I did not force.  I marked numeric as compressable-but-not-move-off-able,
partly to test that storage mode and partly because I've got doubts
that numerics are large enough to need external storage.
2000-07-29 03:26:51 +00:00
Tom Lane d2d7865b5b Add int2-vs-int8 comparison operators. These are now necessary because
the planner may try to generate them as a result of transitivity of the
existing int2-vs-int4 and int4-vs-int8 operators.  In fact, it is now
necessary that mergejoinable cross-datatype operators form closed sets.
Add an opr_sanity regress test to detect missing operators.
2000-07-28 05:07:49 +00:00
Tom Lane 87cdaf5491 Remove <values.h> inclusions, no-longer-needed MAXINT definitions. 2000-07-28 02:13:52 +00:00
Bruce Momjian 56c754a555 Some pedantic compile syntax errors to fix with the following patch
for today's snapshot

Andreas
2000-07-27 19:49:24 +00:00
Tom Lane c7793a731c Ensure that values stored within arrays are not toasted, per
discussion on pghackers a few days ago.
2000-07-27 03:50:52 +00:00
Tom Lane 8d77c1a8aa Clean up some sloppy casts --- Oid vs. Datum, that sort of thing. 2000-07-23 03:50:26 +00:00
Tom Lane e4e6459c0f Further cleanup of array behavior. Slice assignments to arrays with
varlena elements work now.  Allow assignment to previously-nonexistent
subscript position to extend array, but only for 1-D arrays and only
if adjacent to existing positions (could do more if we had a way to
represent nulls in arrays, but I don't want to tackle that now).
Arrange for assignment of NULL to an array element in UPDATE to be a
no-op, rather than setting the entire array to NULL as it used to.
(Throwing an error would be a reasonable alternative, but it's never
done that...)  Update regress test accordingly.
2000-07-23 01:36:05 +00:00
Tom Lane d0e17e2112 Arrays are toastable. (At least if you initdb, which I didn't force.)
Remove a bunch of crufty code for large-object-based arrays, which is
superseded by TOAST and likely hasn't worked in a long time anyway.
Clean up array code a little, and in particular eliminate its habit
of scribbling on the input array (ie, modifying the input tuple :-().
2000-07-22 03:34:43 +00:00
Jan Wieck 9b0fe4eee2 Fixed memory allocation problems when compressing multi-MB
items. Lookup history is now a double linked list, used in
a wrap-around style.

Jan
2000-07-20 14:23:28 +00:00
Tom Lane bec98a31c5 Revise aggregate functions per earlier discussions in pghackers.
There's now only one transition value and transition function.
NULL handling in aggregates is a lot cleaner.  Also, use Numeric
accumulators instead of integer accumulators for sum/avg on integer
datatypes --- this avoids overflow at the cost of being a little slower.
Implement VARIANCE() and STDDEV() aggregates in the standard backend.

Also, enable new LIKE selectivity estimators by default.  Unrelated
change, but as long as I had to force initdb anyway...
2000-07-17 03:05:41 +00:00