summaryrefslogtreecommitdiff
path: root/src/backend/parser
Commit message (Collapse)AuthorAgeFilesLines
* This is mostly the same as an earlier patch IBruce Momjian2000-08-291-2/+149
| | | | | | | | | | | | | | | | | | | didn't hear anything about, but which would have broken with the function manager changes anyway. Well, this patch checks that a unique constraint of some form (unique or pk) is on the referenced columns of an FK constraint and that the columns in the referencing table exist at creation time. The former is to move closer to SQL compatibility and the latter is in answer to a bug report. I also added a basic check of this functionality to the alter table and foreign key regression tests. Stephan Szabo sszabo@bigpanda.com
* New configure test for flex, which recognizes only flex but does so in allPeter Eisentraut2000-08-281-3/+6
| | | | | | 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.
* Rename BITSPERBYTE to BITS_PER_BYTE to avoid conflict with <values.h>Tom Lane2000-08-261-3/+3
| | | | on some platforms.
* SQL-language functions are now callable in ordinary fmgr contexts ...Tom Lane2000-08-242-26/+9
| | | | | | 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.
* Make scanner multibyte aware. Currently it may produce an incorrectTatsuo Ishii2000-08-221-1/+21
| | | | multibyte sequence while truncating identifiers.
* Make makeObjectName multibyte aware. Currently, it may produceTatsuo Ishii2000-08-221-1/+12
| | | | incorrect multibyte sequence while truncating too long names.
* Make functional indexes accept binary-compatible functions, for exampleTom Lane2000-08-201-30/+12
| | | | CREATE INDEX fooi ON foo (lower(f1)) where f1 is varchar rather than text.
* Mop-up for removal of ':' and ';' operators ... like, say, actuallyTom Lane2000-08-122-9/+7
| | | | | take 'em out of pg_operator. Also remove from scan.l's set of legal operator characters. Update documentation.
* copyObject() and equal() now know about all parse-time node types,Tom Lane2000-08-112-43/+65
| | | | | | | | 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.
* Remove 'func_tlist' from Func expression nodes, likewise 'param_tlist'Tom Lane2000-08-086-179/+79
| | | | | | | | 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.
* TOAST mop-up work: update comments for tuple-size-related symbols suchTom Lane2000-08-071-8/+10
| | | | | | | 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.
* Allow LIKE and ILIKE as TokenId (and hence ColId) to make sure that theyThomas G. Lockhart2000-08-071-3/+7
| | | | | are allowed in the func_name production. Otherwise, we can't define more like() and ilike() functions for new data types.
* Implement LIKE/ESCAPE. Change parser to use like()/notlike()Thomas G. Lockhart2000-08-062-103/+181
| | | | | | | | | | | | | | | | | | | | 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.
* Support SQL99 embedded double-quote syntax for quoted identifiers.Thomas G. Lockhart2000-08-061-1/+5
| | | | | | 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.
* Modify heap_open()/heap_openr() API per pghackers discussion of 11 July.Tom Lane2000-08-031-22/+15
| | | | | | | | | 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 :-(.
* More functions updated to new fmgr style --- money, name, tid datatypes.Tom Lane2000-08-031-2/+3
| | | | | We're reaching the mopup stage here (good thing too, this is getting tedious).
* Type lztext is toast.Tom Lane2000-07-302-8/+17
| | | | | | | (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.
* Fix acceptance of PATH as a type and column name.Thomas G. Lockhart2000-07-281-34/+46
| | | | | | Note that this has changed some of the edge cases for what is accepted as a type name and/or column id. Regression test passes, but more tweaks may be coming...
* Add distprep target to take some of the job of the release_prep script.Peter Eisentraut2000-07-191-33/+24
| | | | | | | | | | | | | The latter updated accordingly. Also add `dist' and `distcheck' targets to play with, but caveat packager. Updated backend/bootstrap and backend/parser makefile to make them marginally builddir aware and fix the usual set of things. Add rule to automatically remake config.h dependent on config.h.in and config.status. (Adopted from Autoconf manual and about every other package.) On a good day we should now have a complete and accurate set of dependencies throughout everything.
* Revise aggregate functions per earlier discussions in pghackers.Tom Lane2000-07-171-41/+13
| | | | | | | | | | | 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...
* Remove useless and dangerous 'opt_type' option from CREATE INDEX.Tom Lane2000-07-152-28/+11
|
* Implement nested block comments in the backend and in psql.Thomas G. Lockhart2000-07-144-154/+323
| | | | | | | | | | | | | | Include updates for the comment.sql regression test. Implement SET SESSION CHARACTERISTICS and SET DefaultXactIsoLevel. Implement SET SESSION CHARACTERISTICS TRANSACTION COMMIT and SET AutoCommit in the parser only. Need to add code to actually do something. Implement WITHOUT TIME ZONE type qualifier. Define SCHEMA keyword, along with stubbed-out grammar. Implement "[IN|INOUT|OUT] [varname] type" function arguments in parser only; INOUT and OUT throws an elog(ERROR). Add PATH as a type-specific token, since PATH is in SQL99 to support schema resource search and resolution.
* Include rule to build include/parser/parse.h since nothing else canThomas G. Lockhart2000-07-141-3/+6
| | | | build in this directory otherwise :(
* oidvectortypes: use SQL type names and separate by commasPeter Eisentraut2000-07-091-4/+5
| | | | | | psql \df: use format_type and oidvectortypes map type REAL to float4, not float8 psql \dd :work around UNION bug
* - format_type function, in use by psqlPeter Eisentraut2000-07-071-1/+3
| | | | | - added bigint as synonym of int8 - set typelem of varlen non-array types to 0
* Update textin() and textout() to new fmgr style. This is just phaseTom Lane2000-07-052-4/+5
| | | | | one of updating the whole text datatype, but there are so dang many calls of these two routines that it seems worth a separate commit.
* TOASTJan Wieck2000-07-032-4/+14
| | | | | | | | WARNING: This is actually broken - we have self-deadlocks due to concurrent changes in buffer management. Vadim and me are working on it. Jan
* Attached is a new patch which addresses this problem. (oids inBruce Momjian2000-07-021-1/+4
| | | | | | regression tests). Chris Bitmead
* Remove memory leak from VACUUM parsing.Tom Lane2000-07-021-19/+1
|
* Second pass over run-time configuration system. Adjust priorities on somePeter Eisentraut2000-06-221-9/+9
| | | | | | | | | | | | | | | | | | | option settings. Sort out SIGHUP vs BACKEND -- there is no total ordering here, so make explicit checks. Add comments explaining all of this. Removed permissions check on SHOW command. Add examine_subclass to the game, rename to SQL_inheritance to fit the official data model better. Adjust documentation. Standalone backend needs to reset all options before it starts. To facilitate that, have IsUnderPostmaster be set by the postmaster itself, don't wait for the magic -p switch. Also make sure that all environment variables and argv's survive init_ps_display(). Use strdup where necessary. Have initdb make configuration files (postgresql.conf, pg_hba.conf) mode 0600 -- having configuration files is no fun if you can't edit them.
* Fix handling of type tuple associated with a temp relation. We haveTom Lane2000-06-201-27/+30
| | | | | | | | | to apply the tempname->realname mapping to type name lookup as well as relation name lookup, else the type tuple will not be found when wanted. This fixes bugs like this one: create temp table foo (f1 int); select foo.f2 from foo; ERROR: Unable to locate type name 'foo' in catalog
* Fix performance problems with pg_index lookups (see, for example,Tom Lane2000-06-171-34/+27
| | | | | | | | | | discussion of 5/19/00). pg_index is now searched for indexes of a relation using an indexscan. Moreover, this is done once and cached in the relcache entry for the relation, in the form of a list of OIDs for the indexes. This list is used by the parser and executor to drive lookups in the pg_index syscache when they want to know the properties of the indexes. Net result: index information will be fully cached for repetitive operations such as inserts.
* Final #include cleanup.Bruce Momjian2000-06-151-4/+1
|
* Clean up #include's.Bruce Momjian2000-06-156-6/+12
|
* Big warnings cleanup for Solaris/GCC. Down to about 40 now, butPeter Eisentraut2000-06-142-5/+5
| | | | | | | | | | | we'll get there one day. Use `cat' to create aclocal.m4, not `aclocal'. Some people don't have automake installed. Only run the autoconf rule in the top-level GNUmakefile if the invoker specified `make configure', don't run it automatically because of CVS timestamp skew.
* Another batch of fmgr updates. I think I have gotten all old-styleTom Lane2000-06-131-2/+5
| | | | | functions that take pass-by-value datatypes. Should be ready for port testing ...
* Rename rule CURRENT to OLD in source tree. Add mapping for backwardBruce Momjian2000-06-124-16/+18
| | | | compatiblity with old rules.
* Back out pg_shadow changes to allow create table and locking permissions.Bruce Momjian2000-06-122-53/+22
|
* Update sequence-related functions to new fmgr style. Remove downcasing,Tom Lane2000-06-111-50/+8
| | | | | | | | quote-stripping, and acl-checking tasks for these functions from the parser, and do them at function execution time instead. This fixes the failure of pg_dump to produce correct output for nextval(Foo) used in a rule, and also eliminates the restriction that the argument of these functions must be a parse-time constant.
* I have large database and with this DB work more users and I very needBruce Momjian2000-06-092-22/+53
| | | | | | | | | | | | | | | | | | | | | | | | more restriction for fretful users. The current PG allow define only NO-CREATE-DB and NO-CREATE-USER restriction, but for some users I need NO-CREATE-TABLE and NO-LOCK-TABLE. This patch add to current code NOCREATETABLE and NOLOCKTABLE feature: CREATE USER username [ WITH [ SYSID uid ] [ PASSWORD 'password' ] ] [ CREATEDB | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ] -> [ CREATETABLE | NOCREATETABLE ] [ LOCKTABLE | NOLOCKTABLE ] ...etc. If CREATETABLE or LOCKTABLE is not specific in CREATE USER command, as default is set CREATETABLE or LOCKTABLE (true). A user with NOCREATETABLE restriction can't call CREATE TABLE or SELECT INTO commands, only create temp table is allow for him. Karel
* Inheritance overhaul by Chris Bitmead <chris@bitmead.com>Bruce Momjian2000-06-094-39/+76
|
* Mark functions as static and ifdef NOT_USED as appropriate.Bruce Momjian2000-06-083-12/+22
|
* Gen_fmgrtab.sh is strange: it is a platform dependent way (because it usesPeter Eisentraut2000-06-071-3/+3
| | | | | | | | | | | | | | | | | | | | | CPP) to create platform independent files. Unfortunately, that means that every config.status (or configure) run invariably causes a relink of the postmaster and also that we can't put these files in the distribution (usefully). So we make it a little smarter: when the output files already exist and it notices that it would recreate them in identical form, it doesn't touch them. In order to avoid re-running the make rule all the time we update a timestamp file instead. Update release_prep accordingly. Also make Gen_fmgrtab.sh use the awk that is detected at configure time, not necessarily named `awk' and have it check for exit statuses a little better. In other news... Remove USE_LOCALE from the templates, it was set to `no' everywhere anyway. Also remove YACC and YFLAGS from the templates, configure is smart enough to find bison or yacc itself. Use AC_PROG_YACC for that instead of the hand-crafted code. Do not set YFLAGS to `-d'. The make rules that need this flag should explicitly invoke it. YFLAGS should be a user variable. Update the makefiles to that effect.
* typeTypeName() must return a pstrdup'd copy of the type name, not aTom Lane2000-06-061-3/+5
| | | | | | | | | | direct pointer into the syscache entry for the type. In some cases the syscache entry might get flushed before we are done using the returned type name. This bug accounts for difficult-to-repeat failures seen when INSERTs into columns of certain data types are run in parallel with VACUUMs of system tables. There may be related problems elsewhere --- we need to take a harder look at uses of syscache data.
* Latest round of fmgr updates. All functions with bool,char, or int2Tom Lane2000-06-051-2/+3
| | | | | | | inputs have been converted to newstyle. This should go a long way towards fixing our portability problems with platforms where char and short parameters are passed differently from int-width parameters. Still more to do for the Alpha port however.
* New warning code about auto-created range table entries.Bruce Momjian2000-06-032-17/+28
|
* Lexer defended us against overlength plain identifiers, but not againstTom Lane2000-06-011-1/+7
| | | | overlength quoted identifiers. Death and destruction ensue...
* The heralded `Grand Unified Configuration scheme' (GUC)Peter Eisentraut2000-05-312-61/+60
| | | | | | | | | | | | | That means you can now set your options in either or all of $PGDATA/configuration, some postmaster option (--enable-fsync=off), or set a SET command. The list of options is in backend/utils/misc/guc.c, documentation will be written post haste. pg_options is gone, so is that pq_geqo config file. Also removed were backend -K, -Q, and -T options (no longer applicable, although -d0 does the same as -Q). Added to configure an --enable-syslog option. changed all callers from TPRINTF to elog(DEBUG)
* Third round of fmgr updates: eliminate calls using fmgr() andTom Lane2000-05-301-2/+5
| | | | | fmgr_faddr() in favor of new-style calls. Lots of cleanup of sloppy casts to use XXXGetDatum and DatumGetXXX ...
* Remove unused include files. Do not touch /port or includes used by defines.Bruce Momjian2000-05-306-16/+6
|