Commit Graph

6557 Commits

Author SHA1 Message Date
Tom Lane 94e90d9a86 Add some more Assert checks. 2000-08-22 04:00:10 +00:00
Tom Lane 7893462e44 Move pg_checkretval out of the planner (where it never belonged) into
pg_proc.c (where it's actually used).  Fix it to correctly handle tlists
that contain resjunk target items, and improve error messages.  This
addresses bug reported by Krupnikov 6-July-00.
2000-08-21 20:55:31 +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 e67ff6b670 fmgr interface mopup work. Use new DatumGetBool and BoolGetDatum
macros where appropriate (the code used to have several different ways
of doing that, including Int32, Int8, UInt8, ...).  Remove last few
references to float32 and float64 typedefs --- it's all float4/float8
now.  The typedefs themselves should probably stay in c.h for a release
or two, though, to avoid breaking user-written C functions.
2000-08-21 17:22:36 +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 d594eecde2 Standardize on just one spelling of BITSPERBYTE. 2000-08-20 19:31:37 +00:00
Peter Eisentraut a67343d67d Substitute libdir into createlang as last resort so one doesn't have to set
PGLIB or use any option anymore.
2000-08-20 11:56:29 +00:00
Peter Eisentraut 9b3d66ecbd Introduce HAVE_UNIX_SOCKETS symbol to replace repeatedly listing all the
unsupported platforms.
2000-08-20 10:55:35 +00:00
Tom Lane 4b8f1bcb9c Make functional indexes accept binary-compatible functions, for example
CREATE INDEX fooi ON foo (lower(f1)) where f1 is varchar rather than text.
2000-08-20 00:44:19 +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 766fb7f707 Mop-up for removal of ':' and ';' operators ... like, say, actually
take 'em out of pg_operator.  Also remove from scan.l's set of legal
operator characters.  Update documentation.
2000-08-12 05:15:24 +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 c333d2b329 Update comments for some parse node types. 2000-08-11 23:46:54 +00:00
Tom Lane 4951a8826d copyObject() and equal() now know about all parse-time node types,
including utility statements.  Still can't copy or compare executor
state, but at present that doesn't seem to be necessary.  This makes
it possible to execute most (all?) utility statements in plpgsql.
Had to change parsetree representation of CreateTrigStmt so that it
contained only legal Nodes, and not bare string constants.
2000-08-11 23:45:35 +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
Hiroshi Inoue b0d5036c7c CREATE btree INDEX takes dead tuples into account when old transactions
are running.
2000-08-10 02:33:20 +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
Philip Warner 8fc32374be Buf fix to pg_restire -S option in getopts 2000-08-08 11:48:59 +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
Philip Warner a222f3afe9 - version # change in header
CVs: ----------------------------------------------------------------------
2000-08-07 12:39:37 +00:00
Philip Warner 74e3311085 - Support for iscachable when dumping functions 2000-08-07 12:32:54 +00:00
Thomas G. Lockhart 7f6e021ca8 Allow LIKE and ILIKE as TokenId (and hence ColId) to make sure that they
are allowed in the func_name production. Otherwise, we can't define
 more like() and ilike() functions for new data types.
2000-08-07 06:54:51 +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
Thomas G. Lockhart 371a485dba Include the case-insensitive LIKE prototypes. 2000-08-07 01:43:35 +00:00
Thomas G. Lockhart 701de35a3f Forgot to update the regression test output. 2000-08-07 01:43:14 +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 259489bab7 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:13: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
Thomas G. Lockhart df40234639 Support SQL99 embedded double-quote syntax for quoted identifiers.
Allow this in the parser and in pg_dump, but it is probably not enough
 for a complete solution.
Better to have the feature started then never here.
2000-08-06 17:50:48 +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 8ae23135bc Clean up inefficiency in ExecRelCheck, and cause it to do the right
thing when there are multiple result relations.  Formerly, during
something like 'UPDATE foo*', foo's constraints and *only* foo's
constraints would be applied to all foo's children.  Wrong-o ...
2000-08-06 04:26:40 +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
Tom Lane 465a3b0a24 Copy sub-Query nodes to avoid trouble when same sub-Query is linked to
multiple times in the parsetree (can happen in COALESCE or BETWEEN
contexts, for example).  This is a pretty grotty solution --- it will
do for now, but perhaps we can do better when we redesign querytrees.
What we need is a consistent policy about whether querytrees should be
considered read-only structures or not ...
2000-08-06 04:13:22 +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
Philip Warner 4ebb751219 - Minor fix to create temp table for xrefs 2000-08-05 10:02:28 +00:00
Philip Warner c2e302071f - Only disable triggers for the table being loaded
- disable triggers prior to BLOB load
- better query for loading blob xrefs
- Fixes to error handling code
2000-08-05 09:57:46 +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
Hiroshi Inoue a1464e971c Subclasses inherit constraints of super classes properly 2000-08-04 06:12:11 +00:00
Tom Lane dd8ad64118 Fix tuptoaster bugs induced by making bytea toastable. Durn thing was
trying to toast tuples inserted into toast tables!  Fix is two-pronged:
first, ensure all columns of a toast table are marked attstorage='p',
and second, alter the target chunk size so that it's less than the
threshold for trying to toast a tuple.  (Code tried to do that but the
expression was wrong.)  A few cosmetic cleanups in tuptoaster too.
NOTE: initdb forced due to change in toaster chunk-size.
2000-08-04 04:16:17 +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 61aca818c4 Modify heap_open()/heap_openr() API per pghackers discussion of 11 July.
These two routines will now ALWAYS elog() on failure, whether you ask for
a lock or not.  If you really want to get a NULL return on failure, call
the new routines heap_open_nofail()/heap_openr_nofail().  By my count there
are only about three places that actually want that behavior.  There were
rather more than three places that were missing the check they needed to
make under the old convention :-(.
2000-08-03 19:19:38 +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
Philip Warner 92bd532c1e - Added --create, --no-owner, --superuser, --no-reconnect (pg_dump & pg_restore)
- Added code to dump 'Create Schema' statement (pg_dump)
- Don't bother to disable/enable triggers if we don't have a superuser (pg_restore)
- Cleaned up code for reconnecting to database.
- Force a reconnect as superuser before enabling/disabling triggers.
- Added & Removed --throttle (pg_dump)
- Fixed minor bug in language dumping code: expbuffres were not being reset.
- Fixed version number initialization in _allocAH (pg_backup_archiver.c)
- Added second connection when restoring BLOBs to allow temp. table to survive
  (db reconnection causes temp tables to be lost).
2000-08-01 15:51:45 +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