Commit Graph

734 Commits

Author SHA1 Message Date
Peter Eisentraut 32163099d7 Add distprep target to take some of the job of the release_prep script.
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.
2000-07-19 16:30:27 +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
Tom Lane e40492ec6e Remove useless and dangerous 'opt_type' option from CREATE INDEX. 2000-07-15 00:01:41 +00:00
Thomas G. Lockhart be703cd9e8 Implement nested block comments in the backend and in psql.
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.
2000-07-14 15:43:57 +00:00
Thomas G. Lockhart a4d92053d8 Include rule to build include/parser/parse.h since nothing else can
build in this directory otherwise :(
2000-07-14 15:32:04 +00:00
Peter Eisentraut b54faa1b15 oidvectortypes: use SQL type names and separate by commas
psql \df: use format_type and oidvectortypes
map type REAL to float4, not float8
psql \dd :work around UNION bug
2000-07-09 21:30:21 +00:00
Peter Eisentraut de85dd1d51 - format_type function, in use by psql
- added bigint as synonym of int8
- set typelem of varlen non-array types to 0
2000-07-07 19:24:43 +00:00
Tom Lane 40f64064ff Update textin() and textout() to new fmgr style. This is just phase
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.
2000-07-05 23:12:09 +00:00
Jan Wieck 57d8080a40 TOAST
WARNING: This is actually broken - we have self-deadlocks
	         due to concurrent changes in buffer management.
			 Vadim and me are working on it.

Jan
2000-07-03 23:10:14 +00:00
Bruce Momjian 80c646958a Attached is a new patch which addresses this problem. (oids in
regression tests).

Chris Bitmead
2000-07-02 22:01:27 +00:00
Tom Lane 72164e86a6 Remove memory leak from VACUUM parsing. 2000-07-02 04:04:09 +00:00
Peter Eisentraut c446509565 Second pass over run-time configuration system. Adjust priorities on some
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.
2000-06-22 22:31:24 +00:00
Tom Lane 996659f255 Fix handling of type tuple associated with a temp relation. We have
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
2000-06-20 01:41:22 +00:00
Tom Lane d03a933ec5 Fix performance problems with pg_index lookups (see, for example,
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.
2000-06-17 21:49:04 +00:00
Bruce Momjian 946e80c435 Final #include cleanup. 2000-06-15 04:10:30 +00:00
Bruce Momjian df43800fc8 Clean up #include's. 2000-06-15 03:33:12 +00:00
Peter Eisentraut 44d1abebb4 Big warnings cleanup for Solaris/GCC. Down to about 40 now, but
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.
2000-06-14 18:18:01 +00:00
Tom Lane f2d1205322 Another batch of fmgr updates. I think I have gotten all old-style
functions that take pass-by-value datatypes.  Should be ready for
port testing ...
2000-06-13 07:35:40 +00:00
Bruce Momjian 332f0f5fc0 Rename rule CURRENT to OLD in source tree. Add mapping for backward
compatiblity with old rules.
2000-06-12 19:40:58 +00:00
Bruce Momjian 3357e1d29e Back out pg_shadow changes to allow create table and locking permissions. 2000-06-12 03:41:03 +00:00
Tom Lane 3477957b44 Update sequence-related functions to new fmgr style. Remove downcasing,
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.
2000-06-11 20:08:01 +00:00
Bruce Momjian 85add42a57 I have large database and with this DB work more users and I very need
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
2000-06-09 15:51:02 +00:00
Bruce Momjian 8c1d09d591 Inheritance overhaul by Chris Bitmead <chris@bitmead.com> 2000-06-09 01:44:34 +00:00
Bruce Momjian 20ad43b576 Mark functions as static and ifdef NOT_USED as appropriate. 2000-06-08 22:38:00 +00:00
Peter Eisentraut e3059fc0f5 Gen_fmgrtab.sh is strange: it is a platform dependent way (because it uses
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.
2000-06-07 16:27:00 +00:00
Tom Lane 05cd91a582 typeTypeName() must return a pstrdup'd copy of the type name, not a
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.
2000-06-06 16:50:37 +00:00
Tom Lane 48165ec226 Latest round of fmgr updates. All functions with bool,char, or int2
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.
2000-06-05 07:29:25 +00:00
Bruce Momjian 2ea370a3ce New warning code about auto-created range table entries. 2000-06-03 04:41:34 +00:00
Tom Lane 0672a3c081 Lexer defended us against overlength plain identifiers, but not against
overlength quoted identifiers.  Death and destruction ensue...
2000-06-01 22:21:05 +00:00
Peter Eisentraut 6a68f42648 The heralded `Grand Unified Configuration scheme' (GUC)
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)
2000-05-31 00:28:42 +00:00
Tom Lane 0f1e39643d Third round of fmgr updates: eliminate calls using fmgr() and
fmgr_faddr() in favor of new-style calls.  Lots of cleanup of
sloppy casts to use XXXGetDatum and DatumGetXXX ...
2000-05-30 04:25:00 +00:00
Bruce Momjian a12a23f0d0 Remove unused include files. Do not touch /port or includes used by defines. 2000-05-30 00:49:57 +00:00
Tom Lane 091126fa28 Generated header files parse.h and fmgroids.h are now copied into
the src/include tree, so that -I backend is no longer necessary anywhere.
Also, clean up some bit rot in contrib tree.
2000-05-29 05:45:56 +00:00
Tom Lane 0a7fb4e918 First round of changes for new fmgr interface. fmgr itself and the
key call sites are changed, but most called functions are still oldstyle.
An exception is that the PL managers are updated (so, for example, NULL
handling now behaves as expected in plperl and plpgsql functions).
NOTE initdb is forced due to added column in pg_proc.
2000-05-28 17:56:29 +00:00
Tom Lane 67ad9a18c0 define YY_NEVER_INTERACTIVE for flex, to persuade flex that it's not
necessary to call isatty() for each and every received query.  That's
one less kernel call per query cycle ...
2000-05-27 05:13:38 +00:00
Tom Lane 8bba4b4e0e Generate a reasonable error message when an aggregate function is applied
to an undecorated relation name (cf. example from Ed Loehr, 5/25/00).
2000-05-26 03:56:40 +00:00
Tom Lane ff566b2241 Modify raw parsetree representation returned by gram.y for SubLinks:
the oper field should be a valid Node structure so it can be dumped by
outfuncs.c without risk of coredump.  (We had been using a raw pointer
to character string, which surely is NOT a valid Node.)  This doesn't
cause any backwards compatibility problems for stored rules, since
raw unanalyzed parsetrees are never stored.
2000-05-25 22:42:19 +00:00
Tom Lane 01911c98db Repair list-vs-node confusion that resulted in failure for INNER JOIN ON.
Make it behave correctly when there are more than two tables being
joined, also.  Update regression test expected outputs.
2000-05-12 01:33:56 +00:00
Bruce Momjian 52f77df613 Ye-old pgindent run. Same 4-space tabs. 2000-04-12 17:17:23 +00:00
Tom Lane bb7e5dc2c0 Tweak TypeCategory to treat new BIT types as of STRING category, rather
than not knowing what they are at all.  Perhaps they should have their own
type category?  Hard to say.  In the meantime, doing it this way allows
SELECT 'unknown' || 'unknown' to continue being resolved as textcat,
instead of spitting out an ambiguous-operator error.
2000-04-08 19:29:40 +00:00
Thomas G. Lockhart a349733bbb Add transcendental math functions (sine, cosine, etc)
Add a random number generator and seed setter (random(), SET SEED)
Fix up the interval*float8 math to carry partial months
 into the time field.
Add float8*interval so we have symmetry in the available math.
Fix the parser and define.c to accept SQL92 types as field arguments.
Fix the parser to accept SQL92 types for CREATE TYPE, etc. This is
 necessary to allow...
Bit/varbit support in contrib/bit cleaned up to compile and load
 cleanly. Still needs some work before final release.
Implement the "SOME" keyword as a synonym for "ANY" per SQL92.
Implement ascii(text), ichar(int4), repeat(text,int4) to help
 support the ODBC driver.
Enable the TRUNCATE() function mapping in the ODBC driver.
2000-04-07 13:40:45 +00:00
Tom Lane 5717dcb8a7 New coding for SET provoked a 'var might be used uninitialized' warning
from gcc.  Which wasn't actually a code bug, but I don't like warnings.
2000-03-31 02:11:03 +00:00
Thomas G. Lockhart 362575b782 Enable more flexible syntax for the SET command. Now allows single floats,
single integers, and lists of names, without surrounding them with quotes.
Remove all tokens which are defined as operators from ColID and ColLabel
 to avoid precedence confusion. Thanks to Tom Lane for catching this.
2000-03-30 06:02:36 +00:00
Thomas G. Lockhart 2dabd2cd1f Allow full type names in CREATE FUNCTION arguments and return type.
Move CREATE FUNCTION/WITH clause to end of statement to get around
 shift/reduce conflicts with type names containing "WITH".
Add lots of tokens as allowed ColId's and/or ColLabel's,
 so this should be a complete set for the v7.0 release.
2000-03-27 17:12:06 +00:00
Tom Lane 5c462baebc transformCreateStmt should put Ident nodes, not ColumnDef nodes, into
keys lists of Constraint nodes.  This eliminates a type pun that would
probably have caused trouble someday, and eliminates circular references
in the parsetree that were causing trouble now.
Also, change parser's uses of strcasecmp() to strcmp().  Since scan.l
has downcased any unquoted identifier, it is never correct to check an
identifier with strcasecmp() in the parser.  For example,
	CREATE TABLE FOO (f1 int, UNIQUE("F1"));
was accepted, which is wrong, and xlateSqlFunc did more than it should:
select datetime();
ERROR:  Function 'timestamp()' does not exist
(good)
select "DateTime"();
ERROR:  Function 'timestamp()' does not exist
(bad)
2000-03-24 23:34:19 +00:00
Tom Lane 37ab088770 Remove no-longer-necessary restriction against uplevel correlation vars
outside WHERE clause.  Fix a couple of places that didn't handle uplevel
refs cleanly.
2000-03-23 07:38:30 +00:00
Tom Lane dadb14fa60 Hack parse_coerce so it won't try to constant-fold the dummy Const
nodes introduced by make_subplan().  It'd be better if we used a
different node type for subplan result placeholders, but for now...
2000-03-23 07:36:03 +00:00
Thomas G. Lockhart dcdcada7e9 Add syntax for BIT() and BIT VARYING(), but no underlying implementation
is available yet.
Remove redundant call to xlateSqlType() in the character
 type handling code.
2000-03-21 06:00:41 +00:00
Bruce Momjian 2216584bcf Reverse out BYTEA type coersion. 2000-03-20 15:42:47 +00:00
Tom Lane 3caa56fe5e Emit 'this operator is deprecated' warnings for ':' and ';'. 2000-03-20 05:20:34 +00:00