Commit Graph

2559 Commits

Author SHA1 Message Date
Thomas G. Lockhart
ef0747fe5a Remove extraneous -DPARSEDEBUG from CFLAGS options. 1998-05-13 04:54:16 +00:00
Bruce Momjian
1b70585d4b Someone remove a #define too much from pg_proc.h which breaks
compiling nbtsearch.c after configuring with --enable-cassert.
Patch below.

-- --------------------------------------------- Göran Thyni,
sysadm, JMS Bildbasen, Kiruna
1998-05-12 17:46:50 +00:00
Thomas G. Lockhart
3ace5fd082 Add capabilities for automatic type conversion. 1998-05-09 23:31:34 +00:00
Thomas G. Lockhart
54b5577cb6 Add TIMEZONE_HOUR, TIMEZONE_MINUTE keywords per SQL92 specs. 1998-05-09 23:28:49 +00:00
Thomas G. Lockhart
cd692f2347 llow more variations on valid floating point numbers (e.g. ".1", "1e6").
Reintroduce fixes for unary minus parsing with leading spaces.
1998-05-09 23:27:39 +00:00
Thomas G. Lockhart
f4f0e9d608 Implement TIMEZONE_HOUR, TIMEZONE_MINUTE per SQL92 specs.
Check for and properly ignore FOREIGN KEY column constraints
 (already had fixed same for table constraints).
Define USER as synonym for CURRENT_USER per SQL92 specs
 (no longer allowed as bare column name, sorry).
Re-enable HAVING clause but no fixes elsewhere yet.
Other stuff from today's update of gram.y...
1998-05-09 23:27:14 +00:00
Thomas G. Lockhart
8ff34188f7 Add parse_coerce.c for type conversion handling. 1998-05-09 23:24:27 +00:00
Thomas G. Lockhart
ca354d9027 Implement TIMEZONE_HOUR, TIMEZONE_MINUTE per SQL92 specs.
Check for and properly ignore FOREIGN KEY column constraints
 (already had fixed same for table constraints).
Define USER as synonym for CURRENT_USER per SQL92 specs
 (no longer allowed as bare column name, sorry).
Re-enable HAVING clause but no fixes elsewhere yet.
Make "char" type a synonum for "char(1)" (actually implemented as bpchar).
Compress/compact row-style subselect and operator definitions
 (cut out ~140 lines of code with no change in functionality).
Save string type if specified for DEFAULT clause handling.
Enough for now...
1998-05-09 23:22:15 +00:00
Thomas G. Lockhart
d4a95fd7ab Allow more variations on valid floating point numbers (e.g. ".1", "1e6").
Reintroduce fixes for unary minus parsing with leading spaces.
1998-05-09 23:15:20 +00:00
Bruce Momjian
29c20d498d Fix for missing parens with \g causing psql to get completely
confused.
1998-05-04 02:02:09 +00:00
Bruce Momjian
09baa3cc81 This patch...
1. Removes the unnecessary "#define AbcRegProcedure 123"'s from
pg_proc.h.

2. Changes those #defines to use the names already defined in
fmgr.h.

3. Forces the make of fmgr.h in backend/Makefile instead of having
it
   made as a dependency in access/common/Makefile  *hack*hack*hack*

4. Rearranged the #includes to a less helter-skelter arrangement,
also
    changing <file.h> to "file.h" to signify a non-system header.

5. Removed "pg_proc.h" from files where its only purpose was for
the
   #defines removed in item #1.

6. Added "fmgr.h" to each file changed for completeness sake.

Turns out that #6 was not necessary for some files because fmgr.h
was being included in a roundabout way SIX levels deep by the first
include.

"access/genam.h"
 ->"access/relscan.h"
   ->"utils/rel.h"
     ->"access/strat.h"
       ->"access/skey.h"
	 ->"fmgr.h"

So adding fmgr.h really didn't add anything to the compile, hopefully
just made it clearer to the programmer.

S Darren.
1998-04-27 04:08:07 +00:00
Bruce Momjian
0d203b745d Re-apply Darren's char2-16 removal code. 1998-04-26 04:12:15 +00:00
Bruce Momjian
323fefdb9d Update HISTORY/TODO. Disable HAVING. 1998-04-17 04:12:56 +00:00
Marc G. Fournier
83fd305f78 A few minor mods:
gram.c updated
	scan.c updated
	ecpg/Makefile added LDFLAGS
	configure requires sfio for those systems with it installed...
1998-04-17 03:06:35 +00:00
Bruce Momjian
1957f2402c Update gram.c.nd *.h files. 1998-04-14 03:28:50 +00:00
Bruce Momjian
8eb08ae6b9 Cleanup up code. 1998-04-13 21:07:15 +00:00
Thomas G. Lockhart
242b347877 Prepare the EXTRACT() clause for supporting TIMEZONE_HOUR
and TIMEZONE_MINUTE but don't introduce until v6.4.
Fix SET TIMEZONE LOCAL to pass null pointer
 rather than older "default" string.
Fix handling of NULL pointer returns from FOREIGN KEY clauses
 which are currently ignored.
Allow START as a table/column name.
1998-04-08 06:39:01 +00:00
Thomas G. Lockhart
31b9e3fc68 Temporarily back out fixes for unary minus parsing.
Will re-introduce for v6.4 but requires fixes for automatic type
 conversion beforehand.
1998-04-08 06:35:02 +00:00
Bruce Momjian
db21523314 Back out char2-char16 removal. Add later. 1998-04-07 18:14:38 +00:00
Bruce Momjian
1e801a8f16 Hi,
Attached you'll find a (big) patch that fixes make dep and make
depend in all Makefiles where I found it to be appropriate.

It also removes the dependency in Makefile.global for NAMEDATALEN
and OIDNAMELEN by making backend/catalog/genbki.sh and bin/initdb/initdb.sh
a little smarter.

This no longer requires initdb.sh that is turned into initdb with
a sed script when installing Postgres, hence initdb.sh should be
renamed to initdb (after the patch has been applied :-) )

This patch is against the 6.3 sources, as it took a while to
complete.

Please review and apply,

Cheers,

Jeroen van Vianen
1998-04-06 00:32:26 +00:00
Bruce Momjian
8dc48ba877 Small HAVING cleanup. 1998-03-31 23:31:10 +00:00
Bruce Momjian
d7050cb68c Merge rename name page into alter table. Fix UNION with DISTINCT
or ORDER BY bug.
1998-03-31 04:44:35 +00:00
Bruce Momjian
57b5966405 The following uuencoded, gzip'd file will ...
1. Remove the char2, char4, char8 and char16 types from postgresql
2. Change references of char16 to name in the regression tests.
3. Rename the char16.sql regression test to name.sql.  4. Modify
the regression test scripts and outputs to match up.

Might require new regression.{SYSTEM} files...

Darren King
1998-03-30 17:28:21 +00:00
Bruce Momjian
9a0dd4fb18 There's a patch attached to fix gcc 2.8.x warnings, except for the
yyerror ones from bison. It also includes a few 'enhancements' to
the C programming style (which are, of course, personal).

The other patch removes the compilation of backend/lib/qsort.c, as
qsort() is a standard function in stdlib.h and can be used any
where else (and it is). It was only used in
backend/optimizer/geqo/geqo_pool.c, backend/optimizer/path/predmig.c,
and backend/storage/page/bufpage.c

> > Some or all of these changes might not be appropriate for v6.3,
since we > > are in beta testing and since they do not affect the
current functionality.  > > For those cases, how about submitting
patches based on the final v6.3 > > release?

There's more to come. Please review these patches. I ran the
regression tests and they only failed where this was expected
(random, geo, etc).

Cheers,

Jeroen
1998-03-30 16:47:35 +00:00
Bruce Momjian
c579ce0fb0 I started adding the Having Clause and it works quite fine for
sequential scans! (I think it will also work with hash, index, etc
but I did not check it out! I made some High level changes which
should work for all access methods, but maybe I'm wrong. Please
let me know.)

Now it is possible to make queries like:

select s.sname, max(p.pid), min(p.pid) from part p, supplier s
where s.sid=p.sid group by s.sname having max(pid)=6 and min(pid)=1
or avg(pid)=4;

Having does not work yet for queries that contain a subselect
statement in the Having clause, I'll try to fix this in the next
days.

If there are some bugs, please let me know, I'll start to read the
mailinglists now!

Now here is the patch against the original 6.3 version (no snapshot!!):

Stefan
1998-03-30 16:36:43 +00:00
Bruce Momjian
0d8a7dc6a4 BETWEEN and LIKE patch from Thomas 1998-03-26 21:08:10 +00:00
Thomas G. Lockhart
561aead3f1 Allow parsing expressions with ") -" (scan.l, scan.c only).
Make "TABLE" optional in "LOCK TABLE" command
 and "... INTO TABLE..." clause.
Explicitly parse CREATE SEQUENCE options to allow a negative integer
 as an argument; this is an artifact of unary minus handling in scan.l.
Add "PASSWORD" as an allowed column identifier.
These fixes will require a "make clean install" but not a dump/reload.
1998-03-18 16:50:25 +00:00
Bruce Momjian
c530fbfb2f Add checks for UNION target fields, and add optional TABLE to LOCK
and SELECT manual pages and psql help.
1998-03-18 15:49:08 +00:00
Thomas G. Lockhart
2d87654aeb Repair "LIKE" behavior with two adjacent wildcard characters ("_").
Was ignoring second wildcard.
1998-03-07 06:04:59 +00:00
Marc G. Fournier
794fedc735 From: Darren King <darrenk@insightdist.com>
Two incorrect printf formats in parser/parse_type.c.  Prolly done
by me a long time ago when I cleaned up int's and Oid's...

Format flag is really just %u, not %ud.  Harmless, but results in
"type id lookup of 25d failed" instead of only "...25 failed"
1998-02-27 19:44:51 +00:00
Vadim B. Mikheev
b0571ebf65 In '(a,b,...) Op [ANY|ALL] (SubSelect)' Op is restricted to
'=' and '<>'.
1998-02-27 16:07:02 +00:00
Marc G. Fournier
296a942b56 From: Darren King <darrenk@insightdist.com>
This patch will...

1. Remove the "-Wall" option from the ecpg/lib and ecpg/preproc Makefile.

2. Remove the addition of $(SRCDIR)/include and-or $(SRCDIR)/backend from
   ecpg/lib, ecpg/preproc, libpq and utils Makefiles. Already in CFLAGS...

3. Set MK_NO_LORDER and RANLIB in Makefile.aix to avoid a couple of extra
   steps taken care of by the 'ld' command anyways.
1998-02-27 02:41:21 +00:00
Bruce Momjian
a32450a585 pgindent run before 6.3 release, with Thomas' requested changes. 1998-02-26 04:46:47 +00:00
Marc G. Fournier
780068f812 From: Jan Wieck <jwieck@debis.com>
seems  that  my last post didn't make it through. That's good
    since  the  diff  itself  didn't  covered  the  renaming   of
    pg_user.h to pg_shadow.h and it's new content.

    Here  it's  again.  The  complete regression test passwd with
    only some  float  diffs.  createuser  and  destroyuser  work.
    pg_shadow cannot be read by ordinary user.
1998-02-25 13:09:49 +00:00
Marc G. Fournier
7b30490bc9 First step done,
below  is  the patch to have views to override the permission
    checks for the accessed tables. Now we can do the following:

    CREATE VIEW db_user AS SELECT
         usename,
         usesysid,
         usecreatedb,
         usetrace,
         usecatupd,
         '**********'::text as passwd,
         valuntil
        FROM pg_user;

    REVOKE ALL ON pg_user FROM public;
    REVOKE ALL ON db_user FROM public;
    GRANT SELECT ON db_user TO public;
1998-02-21 06:32:15 +00:00
Thomas G. Lockhart
3d18ca70a7 Start shipping gram.y products gram.c and parse.h to avoid having to build
them from scratch. gram.y has now grown so that some non-bison yaccs
 (including FreeBSDs) run out of room and quit.
1998-02-18 07:37:05 +00:00
Thomas G. Lockhart
8a9fbcc9c3 Include products of gram.y to allow systems without bison to build Postgres.
The parser recently grew too big for some yaccs, including FreeBSD.
1998-02-18 07:28:08 +00:00
Thomas G. Lockhart
64ebb583bc Allow LIKE expression in constraint clause.
Allow USER and VALID as column names and identifiers.
1998-02-18 07:25:57 +00:00
Thomas G. Lockhart
5ac4dcaa19 Fix parsing for <identifier>-<number> which was mis-identified as a unary
minus. Example is SELECT f1-2 FROM INT4_TBL;
1998-02-18 07:23:22 +00:00
Vadim B. Mikheev
581166da91 Fix useor for (a,b...) Op ANY/ALL 1998-02-18 03:26:54 +00:00
Bruce Momjian
edd3668895 Atttypmod cleanup. 1998-02-13 19:46:22 +00:00
Vadim B. Mikheev
6eeb3d9eac gram.y: ALL_SUBLINK type was returned for x Op (subquery).
parse_expr.c: only Op of bool type are supported currently...
1998-02-13 08:10:33 +00:00
Marc G. Fournier
64e7adb07b From: Tom I Helbekkmo <tih@Hamartun.Priv.NO>
Apart from this Makefile hack, all I've done is to make dynamically
loaded code modules fail properly (as was already done for __mips__,
although I think this is too loose: I believe NetBSD for the pmax can
do dynamic linking), and to add test-and-set lock handling.  As Bruce
suggested, this is done in a maximally efficient inlined way: I was
not aware that this code was so important, speed-wise.
1998-02-13 05:10:06 +00:00
Vadim B. Mikheev
7fab67a8ac Fix for EXISTS. 1998-02-13 03:41:23 +00:00
Thomas G. Lockhart
cad3c5d35b Try bumping to version two... 1998-02-11 04:11:19 +00:00
Thomas G. Lockhart
878b8d64c8 Define ROW and STATEMENT as parser tokens.
Use explicit tokens to decode CREATE TRIGGER clauses.
Allow ROW and STATEMENT as column identifiers.
Fix CAST syntax to require parens per SQL92 spec.
Define TypeId to allow correct translation of type names in CREATE FUNCTION
 and other statements. Need to do this without looking up defined type
 names because CREATE FUNCTION can specify undefined (new) types.
Define UserId to complete removal of "Id" generic entity.
Define xlateSqlFunc() to convert SQL92 CHARACTER_LENGTH() and CHAR_LENGTH()
 functions to calls to length().
Define func_name parser entity for contexts requiring a function name.
Have xlateSqlType() translate "float" to "float8".
1998-02-11 04:09:54 +00:00
Thomas G. Lockhart
5e9e8849c9 Automatically promote out of range integers to floats.
Throw elog(NOTICE) to flag promotion.
1998-02-11 03:56:08 +00:00
Bruce Momjian
0386a50f31 Pass around typmod as int16. 1998-02-10 16:04:38 +00:00
Bruce Momjian
2c482cdbf2 Pass attypmod through to executor by adding to Var and Resdom. 1998-02-10 04:02:59 +00:00
Bruce Momjian
65faaf3046 atttypmod now -1. 1998-02-07 06:11:56 +00:00
Bruce Momjian
b20fd6c42d FIx hasSubLinks for Vadim. 1998-02-06 16:46:29 +00:00
Bruce Momjian
fe0154ba87 FIx for varchar(), char() and INSERT .. SELECT. 1998-02-05 22:48:44 +00:00
Bruce Momjian
e3f2eb1f39 Fix for varchar functions, and indextyple j-1 fix. 1998-02-05 17:22:41 +00:00
Marc G. Fournier
7b6cbd53f7 func_error() changed so that if caller is passed with NULL value, its
output at least doesn't appear that its missing something.

wasn't particularly confident with removing 'caller' altogether :(
1998-02-05 04:08:44 +00:00
Marc G. Fournier
03febc634b Clean up func_error() function completely removing caller variable as
"more info then user requires"
1998-02-05 03:35:48 +00:00
Thomas G. Lockhart
c1dcd59c48 Allow most expressions in BETWEEN clause. Allow all expressions if
surrounded by parentheses (but not all are meaningful).
Remove unused keywords ACL, APPEND, MERGE.
Requires a "make clean" to recompile all code since keyword numeric
 assignments have changed with keyword removal.
1998-02-04 06:11:48 +00:00
Bruce Momjian
00f325d510 Subselects with =, >, etc.
Cleanup for vacuum help, manual page, and error message
1998-02-03 19:27:30 +00:00
Thomas G. Lockhart
a90b6a4464 Remove unused keyword CHANGE. 1998-02-03 16:04:05 +00:00
Bruce Momjian
c18ed2f5a7 Parser cleanup for expr and subqueries. 1998-02-03 01:53:24 +00:00
Marc G. Fournier
7264c8226e set "caller" value in parse_func.h to func_get_detail instead of just "" 1998-02-02 02:12:34 +00:00
Marc G. Fournier
e6e364088a Move all the isinf() stuff from float.c to isinf.c, and build it according to
configure vs port specific #ifdef's...
1998-02-02 00:04:08 +00:00
Bruce Momjian
79f99a3888 Fix for psort. fixes regression tests. 1998-02-01 22:20:47 +00:00
Bruce Momjian
6159ba3ab1 AIX patch from Darren King and Univel patch from Billy Allie, mostly
related to grammar and parser issues, with one postmaster fix.
1998-02-01 19:43:54 +00:00
Bruce Momjian
b4564a98fa Deadlock ceallnup.
(void) change for aix and hp compilers.

protocol cleanup.
1998-01-27 15:35:30 +00:00
Marc G. Fournier
c4213aede1 From: Phil Thompson <phil@river-bank.demon.co.uk>
Cleanup patches for previous protocol changes patch
1998-01-27 03:25:14 +00:00
Marc G. Fournier
81dc201921 Wish ppl would make up their mnd :) 1998-01-25 04:12:28 +00:00
Marc G. Fournier
47ad8d1cf5 OOps...missed the second patch of patch two that uses pfree() instead of
free()

From: James Hughes <jamesh@interpath.com>
1998-01-25 04:10:32 +00:00
Marc G. Fournier
151a1238d2 This is the second of two patches required to fix the the grant and
revoke statements.

From: James Hughes <jamesh@interpath.com>
1998-01-25 04:08:54 +00:00
Marc G. Fournier
27317a0d7c More up to date scan.c 1998-01-24 19:40:56 +00:00
Bruce Momjian
7015dfef4b Add LOCK command as DELETE FROM ... WHERE false. 1998-01-22 23:05:18 +00:00
Bruce Momjian
7e46348e62 FIx for regression-test found bug. 1998-01-20 22:55:25 +00:00
Bruce Momjian
7f31669bea Add Var.varlevelup to code. More parser cleanup. 1998-01-20 22:12:17 +00:00
Bruce Momjian
412a5e6539 Parser cleanup.
Add lock to i386 asm.
1998-01-20 05:05:08 +00:00
Bruce Momjian
1316113ea3 Fix problem with nodes handling. 1998-01-19 18:11:10 +00:00
Bruce Momjian
3d24e75176 Added code so SubLinks make it to optimizer. 1998-01-19 05:48:55 +00:00
Bruce Momjian
588867bd7b Create SubLink nodes in parser for Vadim. 1998-01-19 05:06:41 +00:00
Bruce Momjian
53622d66d2 Gram.y cleanup. 1998-01-17 05:01:34 +00:00
Bruce Momjian
b37bc65f44 Creates the SubLink structure, and the Query->hasSubLink field,
with supporting code.

Creates SubLink node in gram.y.

psql.c patch for newatttypmod field.
1998-01-17 04:53:46 +00:00
Bruce Momjian
c65ea0e040 New pg_attribute.atttypmod for type-specific information like
varchar length.

Cleans up code so attlen is always length.

Removed varchar() hack added earlier.

Will fix bug in selecting varchar() fields, and varchar() can be
variable length.
1998-01-16 23:21:07 +00:00
Marc G. Fournier
d876c25803 Fix:
nodeAgg.c: WARN -> NOTICE for elog
parse_oper.c: was created after patch for fmgr_info, so function call wrong
scan.c: regenerated for i386_solaris using flex 2.5.4
gethostname.c: required prototype for gethostname() function
config.h.in: create prototype for isinfo() function

isinf.c: "fake" isinf() under i386_solaris using fpclass() call...
1998-01-15 20:54:52 +00:00
Bruce Momjian
763ff8aef8 Remove Query->qry_aggs and qry_numaggs and replace with Query->hasAggs.
Pass List* of Aggregs into executor, and create needed array there.
No longer need to double-processs Aggregs with second copy in Query.

Fix crash when doing:

	select sum(x+1) from test where 1 > 0;
1998-01-15 19:00:16 +00:00
Marc G. Fournier
8adc838ff6 Various cleanups for the i386_solaris environment 1998-01-13 19:28:39 +00:00
Bruce Momjian
660f458d3b Clean up of copyfuncs. 1998-01-11 20:02:32 +00:00
Bruce Momjian
600c958a30 Add UNION, GROUP, DISTINCT to INSERT. 1998-01-11 03:41:57 +00:00
Bruce Momjian
e6c714bf30 Bye CursorStmt, now use SelectStmt. 1998-01-10 04:30:11 +00:00
Bruce Momjian
e7b205b486 Remove old quel labels. 1998-01-09 21:26:12 +00:00
Bruce Momjian
3d15d1332a Remove old quel labels. 1998-01-09 20:06:08 +00:00
Bruce Momjian
e22b09c227 Fix sorting of multiple fields broken with UNION. 1998-01-06 23:58:05 +00:00
Bruce Momjian
deea69b90e Change some ABORTS to ERROR. Add line number when COPY Failure. 1998-01-05 16:40:20 +00:00
Bruce Momjian
0d9fc5afd6 Change elog(WARN) to elog(ERROR) and elog(ABORT). 1998-01-05 03:35:55 +00:00
Bruce Momjian
a65e4484da Fix for aggs on views and complex ones. I missed one file. 1998-01-04 04:53:50 +00:00
Bruce Momjian
4b05912f0b Fix for count(*), aggs with views and multiple tables and sum(3). 1998-01-04 04:31:43 +00:00
Thomas G. Lockhart
fcabd0753c Change precedence for boolean operators to match expected behavior.
Change NOTICE/NOTICE/NOTICE/WARN elog messages to a single message
 with a few newline/tab breaks embedded in the string. Much cleaner I hope.
1998-01-01 05:44:54 +00:00
Bruce Momjian
a544b605e2 Change some mallocs to palloc. 1997-12-29 05:13:57 +00:00
Bruce Momjian
a1dd409053 Fix for ORDER BY in UNION. 1997-12-29 04:31:50 +00:00
Bruce Momjian
499b13c994 UNION cleanup again. 1997-12-29 02:09:54 +00:00
Bruce Momjian
a01b085c78 Cleanup of UNION ALL fix. Manual page updates. 1997-12-29 01:13:37 +00:00
Bruce Momjian
4ce24c8aa9 UNION work for UNION ALL and other union stuff. 1997-12-27 06:41:41 +00:00
Bruce Momjian
6231e161c9 Implementation of UNIONs. 1997-12-24 06:06:58 +00:00
Thomas G. Lockhart
2c833a728f Implement CREATE TABLE ... AS SELECT borrowing code from SubSelect
and from SELECT ... INTO ... support code.
Allow NOT, IS NULL, IS NOT NULL in constraints.
Define unionall boolean flag in SubSelect structure.
Implement row descriptors: (a, b, c) = (x, y, z).
Change IS TRUE, IS FALSE, etc. to expressions using "=" rather than
 function calls to istrue() or isfalse() to allow optimization.
Force type for TRUE and FALSE to bool.
1997-12-23 19:47:32 +00:00
Thomas G. Lockhart
8ed721ffef Change variable name reference from selectClause to more appropriate unionClause.
Add a few lines of test code playing with the unique flag for unions.
 Does not do much helpful yet.
1997-12-23 19:39:42 +00:00
Thomas G. Lockhart
98f5975cb0 Fix up some elog error messages. 1997-12-23 19:36:20 +00:00
Bruce Momjian
d404f1006b Fix for select 1=1 or 2=2, select 1=1 and 2=2, and select sum(2+2). 1997-12-22 05:42:25 +00:00
Marc G. Fournier
6e337eef45 Major cleanout of PORTNAME variables from Makefiles...bound to screw up
some of the ports...
1997-12-20 00:29:35 +00:00
Thomas G. Lockhart
331a163693 Allow multiple-argument functions in constraint clauses.
Formerly allowed only single arguments.
Declare column constraints using the usual list mechanism rather
 than explicit itemized lists.
Remove NOTNULL from default clause syntax (retain "NOT NULL").
 NOTNULL is not SQL92; eventually remove it from expressions too?
Move ISNULL, NOTNULL to Postgres-specific token declarations.
Fix up tabs and indenting on new CREATE USER commands.
1997-12-16 15:50:54 +00:00
Thomas G. Lockhart
640fe03bcf Improve (well, ok, fix) generated constraint name for column CHECK clause. 1997-12-16 15:45:46 +00:00
Bruce Momjian
eb825d356e Fix order of keywords, must be alphabetical. 1997-12-16 05:04:00 +00:00
Marc G. Fournier
da72b903ff Major code cleanup following the pg_password insertion...
...malloc/free -> palloc/pfree
	...fopen/fclose -> AllocateFile/FreeFile
1997-12-09 03:11:25 +00:00
Thomas G. Lockhart
2ac4cf5502 Add information message about implicitly created indices.
Check for duplicate implicit index names and generate unique names.
1997-12-09 01:44:14 +00:00
Bruce Momjian
a68a132a6c Add VARHDRSZ where needed. Many places just used 4. 1997-12-06 22:57:36 +00:00
Bruce Momjian
5a5cb30096 Fix tolower loops to go in proper direction for cache. 1997-12-05 01:13:24 +00:00
Thomas G. Lockhart
1ac4ae4993 Add SQL92-compliant syntax for constraints.
Implement PRIMARY KEY and UNIQUE clauses using indices.
1997-12-04 23:07:23 +00:00
Marc G. Fournier
4c04f7724e From: todd brandys <brandys@eng3.hep.uiuc.edu>
An extension to the code to allow for a pg_password authentication database
that is *seperate* from the system password file
1997-12-04 00:28:15 +00:00
Bruce Momjian
333323f304 Fix vacuum analyze syntax problem. 1997-12-02 16:09:15 +00:00
Thomas G. Lockhart
8f4865bdd7 Remove premature code in constraint parsing.
Change elog WARN to NOTICE for unimplemented constraints.
1997-12-02 02:54:15 +00:00
Thomas G. Lockhart
07c1837f50 Change elog WARN messages for UNIQUE and PRIMARY, FOREIGN KEY
to NOTICE messages so that execution proceeds rather than halting.
 These clauses are ignored as stated in the messages.
Allow NOT NULL UNIQUE syntax (both were allowed individually before).
Allow Postgres-style casting ("::") of non-constants.
1997-11-30 23:11:10 +00:00
Thomas G. Lockhart
361f9e7f8d Add comments and move a few declaration blocks to help readability.
No functional changes this time!
1997-11-30 23:05:39 +00:00
Bruce Momjian
db00632e0f Cleaups of comments. 1997-11-27 02:23:02 +00:00
Bruce Momjian
bac80c218e Add README for parser directory 1997-11-26 15:36:00 +00:00
Bruce Momjian
b704426618 Make parser functions static where possible. 1997-11-26 03:43:18 +00:00
Bruce Momjian
598e86f3b3 Cleanup up include files. 1997-11-26 01:14:33 +00:00
Bruce Momjian
4a5b781d71 Break parser functions into smaller files, group together. 1997-11-25 22:07:18 +00:00
Bruce Momjian
3aff4011c7 Remove gram problems with archive. 1997-11-24 16:55:22 +00:00
Bruce Momjian
49656346b8 Move dbcommands.c to commands/. It should not be in the parser directory. 1997-11-24 05:32:56 +00:00
Bruce Momjian
36e3df0767 Move dbcommands.c to commands/. It should not be in the parser directory. 1997-11-24 05:21:03 +00:00
Bruce Momjian
f7f2e18f8e Remove tqual.h includes not needed. 1997-11-24 05:09:50 +00:00
Bruce Momjian
3fa2bb316c Remove archive stuff. 1997-11-21 18:12:58 +00:00
Bruce Momjian
e9e1ff226f Remove all time travel stuff. Small parser cleanup. 1997-11-20 23:24:03 +00:00
Bruce Momjian
d0471244e6 Remove 16 char limit on system table/index names. Rename system indexes. 1997-11-17 16:59:36 +00:00
Thomas G. Lockhart
4b19101fc3 Update UNION and subselect syntax.
Support SQL92 syntax for type coersion of strings (type 'typeval').
 Example: "DATETIME 'now'". This works only for string constants and can
 not replace the CAST and ::type syntax which behave identically in this
 context.
1997-11-17 16:37:24 +00:00
Thomas G. Lockhart
6df962668a Update generated source for scan.l. 1997-11-17 16:33:21 +00:00
Thomas G. Lockhart
3d4d1e14f8 Implement SQL92 binary and hexadecimal string decoding (b'10' and x'1F').
Check decoding of integer in x - y syntax (already done for most ints).
1997-11-17 16:31:39 +00:00
Bruce Momjian
1c32d285a6 Remove pg_magic, defaults, server, hosts, and demon tables. unused. 1997-11-15 20:58:05 +00:00
Thomas G. Lockhart
0f2189efff Include flex output in the standard distribution to fix problems with
old AT&T lexers and exclusive states (Solaris has trouble and probably
 others).
1997-11-14 15:50:22 +00:00
Thomas G. Lockhart
6eaafef1df Supress cleaning scan.c since we will try to include it in the distribution.
This should help Solaris and (presumably) other distributions with
 old AT&T-descended lex programs which can't handle "exclusive states".
1997-11-14 15:48:19 +00:00
Thomas G. Lockhart
97d2b92384 Add flag to supress one compiler warning regarding unused "unput" function
in flex-specific code.
1997-11-14 15:43:27 +00:00
Bruce Momjian
430169a5ea FIx for indexing regex stuff. Change rowoid to objoid. 1997-11-14 06:09:07 +00:00
Bruce Momjian
ea4223c45f FIx for indexing regex stuff. Change rowoid to objoid. 1997-11-14 05:57:46 +00:00
Thomas G. Lockhart
25e950fca4 Change messages regarding "TimeRange" to say that time travel is no longer
available.
Remove lots of #ifdef'd debugging print statements.
1997-11-10 15:22:36 +00:00
Thomas G. Lockhart
ced2ee8210 Clean up path handling esp. when interpreting environment variables.
Remove unused old code.
1997-11-10 15:17:44 +00:00
Thomas G. Lockhart
acc2843025 Implement CREATE DATABASE/WITH LOCATION=.
Implement SET keyword = DEFAULT and SET TIME ZONE DEFAULT.
Re-enable JOIN= option in CREATE OPERATOR statement (damaged for v6.2).
Allow more SQL and/or Postgres reserved words as column identifiers
 or, if there are shift/reduce problems, at least as column labels.
1997-11-07 07:02:10 +00:00
Thomas G. Lockhart
7d1f2f8a27 Support alternate database locations. 1997-11-07 06:38:51 +00:00
Vadim B. Mikheev
32cd09ac6d Good Bye, Time Travel! 1997-11-02 15:27:14 +00:00
Bruce Momjian
1e7ba76e43 Indexes for LIKE and ~, !~ operations. 1997-10-31 00:50:39 +00:00
Thomas G. Lockhart
770352d279 Add support for SQL92 delimited identifiers.
Add support for SQL3 IS TRUE and IS FALSE.
Augment support for SQL92 SET TIME ZONE...
1997-10-30 16:39:27 +00:00
Thomas G. Lockhart
0a9be2db9b Add support for delimited identifiers. Include new exclusive state "xd".
Remove unused ScanString variable and code.
1997-10-30 16:36:39 +00:00
Thomas G. Lockhart
0175759e17 Fix up elog messages for consistant usage of quotes around arguments. 1997-10-30 16:34:22 +00:00
Bruce Momjian
80440a51fa Fix for international identifiers, from Tatsuo Ishii 1997-10-30 15:28:25 +00:00
Bruce Momjian
d48006180c Generate error on large integer. 1997-10-30 01:55:49 +00:00
Vadim B. Mikheev
7bff4c5078 Now we are able to CREATE PROCEDURAL LANGUAGE (Thanks, Jan). 1997-10-28 15:11:45 +00:00
Thomas G. Lockhart
f10b639237 Add SQL92 "constants" CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP,
CURRENT_USER.
Add syntax for primary and foreign keys.
Change optional syntax in CREATE INDEX to avoid parsing conflict with
 TIMESTAMP WITH TIME ZONE data type (use USING <class> rather than WITH...).
Decouple various categories of data type syntax to allow the most possible
 non-ambiguous extensions to SQL92 for column names and labels. This should
 make the parser a bit more understandable, or at least easier to find
 where and how the data types are handled.
Support syntax for IN and EXISTS clauses with subselects.
Support SQL92 syntax for IS TRUE/IS FALSE/IS NOT TRUE/IS NOT FALSE.
1997-10-25 05:56:41 +00:00
Thomas G. Lockhart
27d0d1a159 Add SQL92 reserved words for primary and foreign keys.
Add keywords for national character types.
Shorted date/time keyword token names for convenience.
Add SQL3 reserved words TRUE and FALSE.
1997-10-25 05:44:11 +00:00
Bruce Momjian
f3af1368bd Rename strNcpy to StrNCpy, and change third parameter. 1997-10-25 01:10:58 +00:00
Vadim B. Mikheev
9b10d6ffda Ignore copies of columns specified in ORDER/GROUP BY 1997-10-16 06:58:38 +00:00
Thomas G. Lockhart
b0df88745d Include SQL/92 string continuation across newlines.
Allows the following example:
  select 'first string'
  '---'
  'last string';
 to be output as 'first string---last string'.
1997-10-15 01:12:21 +00:00
Vadim B. Mikheev
defb10a450 DEFAULT is handled by analyze.c now. 1997-10-12 07:09:20 +00:00
Thomas G. Lockhart
c927f80fe4 Use P_TYPE rather than TYPE_P (which will be the name in the next release). 1997-10-09 05:43:59 +00:00
Thomas G. Lockhart
0f66d799a3 Allow both TIME and TYPE as column and table names. 1997-10-09 05:35:30 +00:00
Thomas G. Lockhart
f54cc390e1 Allow TIME in column and table names (SQL/92 non-reserved word). 1997-10-09 05:00:54 +00:00
Vadim B. Mikheev
5a447b4a26 MOVE implementation. 1997-09-29 05:59:16 +00:00
Thomas G. Lockhart
b105324f7e Fix SUBSTRING(str FROM int TO int) parsing. 1997-09-26 15:09:11 +00:00
Thomas G. Lockhart
5004b99e92 Tatsuo's patch to fix alignment problems in structure for RISC machines. 1997-09-25 14:11:42 +00:00
Thomas G. Lockhart
e008c68408 One more change to recover v6.1.1 escaped-text input behavior.
Should be changed for v6.3!
1997-09-25 14:10:23 +00:00
Thomas G. Lockhart
16d65f5c25 Add SQL/92 "constants" current_date, current_time, and current_timestamp.
Add SQL/92 types decimal and numeric (temporary for syntax support).
 These types need more support in the backend to be really implemented,
 and the parser will need to be changed at that time.
Adjust limits on precision parameters for FLOAT(p) to match IEEE-compliant
 arithmetic. Perhaps these limits should be processor-specific or obtained
 from system include files instead.
1997-09-24 17:53:53 +00:00
Thomas G. Lockhart
ba8763c500 Add SQL/92 types decimal and numeric.
Add SQL/92 "constants" current_date, current_time, and current_timestamp.
1997-09-24 17:49:56 +00:00
Thomas G. Lockhart
53ad0aa262 Restore proper behavior for escaped quotes and for escaped literals
like newline inside quoted strings.
1997-09-24 17:48:25 +00:00
Vadim B. Mikheev
f79b7a56b4 Allow use functions with no arguments in DEFAULT
Allow use IDENT as arguments of trigger functions
1997-09-24 08:31:04 +00:00
Thomas G. Lockhart
3bb89a27ee Add support for FLOAT(p) SQL/92 data type.
Allow ALTER TABLE ADD ( column ) syntax.
1997-09-20 16:11:44 +00:00
Bruce Momjian
3f365ba0fc Inline memset() as MemSet(). 1997-09-18 20:22:58 +00:00
Vadim B. Mikheev
4948a51d74 Convert sequence names tolower. 1997-09-18 14:32:15 +00:00
Thomas G. Lockhart
c407a38742 Add syntax and warnings for unsupported ALTER TABLE commands
including DROP COLUMN, SET CONSTRAINT, etc.
1997-09-18 03:46:18 +00:00
Thomas G. Lockhart
43163cf5d6 Fix string conversions for operators in DEFAULT and CHECK clauses. 1997-09-16 16:11:20 +00:00
Thomas G. Lockhart
bc85dbf893 Remove backdoor strings from scan.l for DEFAULT and CHECK.
Reconstruct string input for DEFAULT and CHECK.
Add DOUBLE PRECISION, CHARACTER (VARYING) SQL-92 data types.
1997-09-13 03:15:46 +00:00
Thomas G. Lockhart
9ea74630fc Add a few keywords for SQL-92 support. 1997-09-13 03:13:37 +00:00
Thomas G. Lockhart
0fbfba11f6 Use exclusive state to help fix unary minus parsing.
Remove "backdoor" for DEFAULT and CHECK.
1997-09-13 03:12:55 +00:00
Thomas G. Lockhart
c1d3c04d38 Fix up error messages. 1997-09-13 03:11:51 +00:00
Bruce Momjian
fe54c54da3 Allow SELECT NULL as EMPTY_FIELD, Patrick. 1997-09-12 22:14:48 +00:00
Vadim B. Mikheev
4379ce8380 Quick hack to get CHECK working for incoming betta. 1997-09-12 09:01:46 +00:00
Bruce Momjian
1ea01720d5 heapattr functions now return a Datum, not char *. 1997-09-12 04:09:08 +00:00
Bruce Momjian
59f6a57e59 Used modified version of indent that understands over 100 typedefs. 1997-09-08 21:56:23 +00:00
Bruce Momjian
075cede748 Add typdefs to pgindent run. 1997-09-08 20:59:27 +00:00
Bruce Momjian
23db70bf73 Lex/yacc source cleanup like indent. 1997-09-08 03:20:18 +00:00
Bruce Momjian
319dbfa736 Another PGINDENT run that changes variable indenting and case label indenting. Also static variable indenting. 1997-09-08 02:41:22 +00:00
Bruce Momjian
1ccd423235 Massive commit to run PGINDENT on all *.c and *.h files. 1997-09-07 05:04:48 +00:00
Bruce Momjian
ae50c8d84b Cleanups needed for indent. 1997-09-05 19:32:44 +00:00
Bruce Momjian
a1635450b3 Cleanups needed for indent. Remove }; 1997-09-05 18:13:45 +00:00
Vadim B. Mikheev
c753a6a1e2 Restore CurScanPosition() for flex.
Fix it for lex.
1997-09-05 09:05:48 +00:00
Bruce Momjian
868d708188 Add // comments. 1997-09-05 00:09:47 +00:00
Vadim B. Mikheev
bad4bc40b9 CREATE/DROP TRIGGER syntax 1997-09-04 13:24:26 +00:00
Thomas G. Lockhart
ec70b3c07c Remove comment line in rules section. Keith reports trouble on Solaris
and O'Reilly "lex & yacc" book claims ATT-lex has trouble with comments.
1997-09-02 02:32:35 +00:00
Thomas G. Lockhart
570620c569 Add SQL92 string handling features (SUBSTRING, TRIM, EXTRACT).
Add parsing for UNION and outer JOINs.
Implement SQL92 "WITH TIME ZONE".
Allow some reserved words as identifiers and column labels.
Clean up indentation and "orphan spaces and tabs".
1997-09-01 06:00:35 +00:00
Thomas G. Lockhart
05cdb99bfb Add detection and warnings for UNION and HAVING clauses.
Generate non-fatal warning only and proceed by ignoring clauses.
1997-09-01 05:56:34 +00:00
Thomas G. Lockhart
05eb632864 Add more reserved words, mostly for SQL92 compliance.
Include reserved words for string handling, outer joins, and unions.
1997-09-01 05:53:31 +00:00
Thomas G. Lockhart
559a28747a Use exclusive states for parsing quoted strings.
Implement extended comments ("/* ... */") using exclusive states.
Modify definitions of operators to remove some restrictions on characters
 and character order.
1997-09-01 05:51:52 +00:00
Vadim B. Mikheev
becd2f9b82 Fix for "default = '...'" in CREATE TYPE 1997-08-28 05:02:01 +00:00
Vadim B. Mikheev
c0784f6d96 Restore CONSTRAINT keyword (was lost ... by unknown way) 1997-08-22 14:33:21 +00:00
Bruce Momjian
021778eed3 We store Cash/money as int of size 4, so make it an int rather than a long. 1997-08-22 07:13:01 +00:00
Vadim B. Mikheev
9b6d8878fd There is no NULL constraint in CREATE TABLE - only NOT NULL one. 1997-08-22 03:17:55 +00:00
Bruce Momjian
3dd23aadf0 Allow functions and operators on internally-identical types to succeed. 1997-08-22 00:02:19 +00:00
Vadim B. Mikheev
e3accffe66 Syntax for [CONSTRAINT name] CHECK ... 1997-08-21 01:34:44 +00:00
Vadim B. Mikheev
0c001f080b CHECK/DEFAULT syntax (some tricks to get current scan position). 1997-08-20 01:50:06 +00:00
Vadim B. Mikheev
4527172b80 CHECK/DEFAULT syntax 1997-08-20 01:12:38 +00:00
Bruce Momjian
1d8bbfd2e7 Make functions static where possible, enclose unused functions in #ifdef NOT_USED. 1997-08-19 21:40:56 +00:00
Vadim B. Mikheev
b992e200b8 NOT NULL implementation (submitted by Robson Paniago de Miranda). 1997-08-19 04:46:15 +00:00
Bruce Momjian
b99c63cfc0 Now that names are null terminated, no need to do all that NAMEDATALEN stuff. 1997-08-18 20:53:48 +00:00
Bruce Momjian
022903f22e Reduce open() calls. Replace fopen() calls with calls to fd.c functions. 1997-08-18 02:15:04 +00:00
Bruce Momjian
ea5b5357cd Remove more (void) and fix -Wall warnings. 1997-08-12 22:55:25 +00:00
Bruce Momjian
edb58721b8 Fix pgproc names over 15 chars in output. Add strNcpy() function. remove some (void) casts that are unnecessary. 1997-08-12 20:16:25 +00:00
Bruce Momjian
6ed1715b1f Cleanup for NAMEDATALEN use. 1997-08-03 02:38:47 +00:00
Bruce Momjian
ea210dc611 Comment out code that makes no sense, and Purify complains about. 1997-08-03 02:28:10 +00:00
Vadim B. Mikheev
ac994a69d6 Allow use parameters in target list having aggregates in functions. 1997-07-30 04:42:26 +00:00
Bruce Momjian
3ac9d2fff3 Various compile errors concerning overflow due to shifts, unsigned, and bad prototypes, from Solaris, from Diab Jerius 1997-07-24 20:19:10 +00:00
Bruce Momjian
43deb7a45f Fox case-sensitivity for \d and allow trailing ; on backslash commands. 1997-06-29 17:29:28 +00:00
Vadim B. Mikheev
ad01dd270d If there is no table in RangeTable for colname then
elog (WARN, "attribute %s not found", colname);
1997-05-31 07:10:25 +00:00
Marc G. Fournier
4800abc7c1 From: Darren King <aixssd!darrenk@abs.net>
To: pgsql-patches@postgreSQL.org
Subject: [PATCHES] DROP AGGREGATE gram.y typo...


Somehow I dropped a comma in the gram.y part (line 129) of my
patch for drop aggregate.  Here's a correct patch for gram.y.

PS. I hope I got the right comma, manually applied :) (scrappy)
1997-05-22 00:24:07 +00:00
Marc G. Fournier
5e7c0a0b9a From: Darren King <aixssd!darrenk@abs.net>
Subject: [PATCHES] DROP AGGREGATE patch/fix.


Here's a patch that fixes the DROP AGGREGATE command to delete
the desired aggregate for a specific type.
1997-05-22 00:17:24 +00:00
Bruce Momjian
91f4df2f2c Fix typechecking problem pointed out by Thomas. 1997-05-08 02:45:53 +00:00
Vadim B. Mikheev
a1fbd470a9 Fix GroupBy: enable functions over aggregates and GroupBy-ed fields
in target list.
1997-04-29 04:32:50 +00:00
Thomas G. Lockhart
ee2f8e0472 Modify references to function manager to use lower-case calls. 1997-04-27 19:16:44 +00:00
Vadim B. Mikheev
24d48db32d 1. SHOW/RESET var fixed.
2. New VACUUM syntax (ANALYZE ...).
1997-04-23 06:04:46 +00:00
Marc G. Fournier
4b5319129c To: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: Re: [PATCHES] SET DateStyle patches

On Tue, 22 Apr 1997, Thomas Lockhart wrote:

> Some more patches! These (try to) finish implementing SET variable TO value
> for "DateStyle" (changed the name from simply "date" to be more descriptive).
> This is based on code from Martin and Bruce (?), which was easy to modify.
> The syntax is
>
> SET DateStyle TO 'iso'
> SET DateStyle TO 'postgres'
> SET DateStyle TO 'sql'
> SET DateStyle TO 'european'
> SET DateStyle TO 'noneuropean'
> SET DateStyle TO 'us'         (same as "noneuropean")
> SET DateStyle TO 'default'    (current same as "postgres,us")
>
> ("european" is just compared for the first 4 characters, and "noneuropean"
> is compared for the first 7 to allow less typing).
>
> Multiple arguments are allowed, so SET datestyle TO 'sql,euro' is valid.
>
> My mods also try to implement "SHOW variable" and "RESET variable", but
> that part just core dumps at the moment. I would guess that my errors
> are obvious to someone who knows what they are doing with the parser stuff,
> so if someone (Bruce and/or Martin??) could have it do the right thing
> we will have a more complete set of what we need.
>
> Also, I would like to have a floating point precision global variable to
> implement "SET precision TO 10" and perhaps "SET precision TO 10,2" for
> float8 and float4, but I don't know how to do that for integer types rather
> than strings. If someone is fixing the SHOW and RESET code, perhaps they can
> add some hooks for me to do the floats while they are at it.
>
> I've left some remnants of variable structures in the source code which
> I did not use in the interests of getting something working for v6.1.
> We'll have time to clean things up for the next release...
1997-04-23 03:18:27 +00:00
Vadim B. Mikheev
8466811335 Fix for -Wno-error 1997-04-18 08:57:39 +00:00
Marc G. Fournier
953ac7b55a Fix up the -Wno-error problem for non-gcc compilers
Pointed out by many many ppl
1997-04-15 17:24:26 +00:00
Vadim B. Mikheev
cc11cfdd46 Now we can GROUP BY func_results. 1997-04-05 06:29:03 +00:00
Vadim B. Mikheev
803a2b13f2 Fix for 'SET var_name TO var_value': var_name already defined. 1997-04-05 06:25:59 +00:00
Marc G. Fournier
c7b40e6058 This commit represents a clean compile with the new templates under
FreeBSD

The Makefile(s) have all been cleaned up such that there is a single
LDFLAGS vs LD_ADD or LDADD or LDFLAGS or LDFLAGS_BE.  The Makefile(s)
should be alot more straightforward then they were before...and
consistent
1997-04-04 10:43:16 +00:00
Marc G. Fournier
a51df14a69 From: "Martin J. Laubach" <mjl@CSlab.tuwien.ac.at>
Subject: [HACKERS] Patch: SET var TO 'val'

  Here is a patch that adds a "SET variable TO 'somevalue'" capability
to the parser, and then calls the SetPGVariable() function (which does
just issue a elog(NOTICE) to see whether it works).

  That's the framework for adding timezone/date format/language/...
stuff.
1997-04-02 18:24:52 +00:00
Marc G. Fournier
5b1311acfb From: Oleg Bartunov <oleg@sai.msu.su>
Subject: [HACKERS] locale patches !

Hi there,

here are little patches to get Postgres 6.1 works with locale stuff.
This is a patch against 970402.tar.gz, there are no problem to apply them
by hand to 6.0 release. Collate stuff tested about 1-2 months in real
working database but I'm sure there must be no problem. US hackers
could vote against locale implementation ( locale for sure will affect to
speed of postgres ), so I introduce variable USE_LOCALE which
controls locale stuff. Non-US users now could use ~* operator
for searching and <order by> for strings with nation alphabet.
Please, don't forget, as I did first time, to set environment variable
LC_CTYPE and LC_COLLATE because backend get locale information from them.
I start postmaster from a little script, assuming that shell is Bash shell
it looks like:

#!/bin/sh

export LC_CTYPE=koi8-r
export LC_COLLATE=koi8-r
postmaster -B 1024 -S -D/usr/local/pgsql/data/ -o '-Fe'
1997-04-02 18:13:47 +00:00
Vadim B. Mikheev
a10a951a46 New keyword: SEQUENCE. 1997-04-02 04:49:13 +00:00
Vadim B. Mikheev
9729f6ca0d CREATE/DROP SEQUENCE ...
Check nextval/currval permission in analyze.c.
1997-04-02 04:01:03 +00:00
Vadim B. Mikheev
7d336625c0 Added syntax for multi-column indices. 1997-03-26 02:52:49 +00:00
Marc G. Fournier
127826978a From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] equal column and table name patch

This fixes a bug where selects fail when there is a column with the same
name as the table it's a part of.
1997-03-12 20:51:33 +00:00
Marc G. Fournier
e4949f9fe5 From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] better access control error messages

This patch replaces the 'no such class or insufficient privilege' with
distinct error messages that tell you whether the table really doesn't
exist or whether access was denied.
1997-03-12 20:48:48 +00:00
Bruce Momjian
34fd62c512 Remove case-sensitive identifiers. Thanks for Dan McGuirk for a reversal patch. 1997-03-02 01:03:44 +00:00
Bruce Momjian
38f4f67830 Allow update x =-3, not just x = -3. 1997-02-28 13:25:16 +00:00
Bruce Momjian
6eb0525185 Prevent under/over flow of float8 constants in parser. Small regression fix. 1997-02-19 20:11:05 +00:00
Bruce Momjian
b8518449a3 Oper_right added, broken with const. conversion. 1997-02-14 23:02:29 +00:00
Bruce Momjian
31c8e94b34 Remove WIN32 defines. They never worked. 1997-02-14 04:19:07 +00:00
Bruce Momjian
cf2403896d Only allow NULL in the prpoer places. 1997-02-13 15:40:03 +00:00
Bruce Momjian
2300ac0dc4 Add attribute optimization statistics. 1997-02-07 16:24:12 +00:00
Marc G. Fournier
427a964c30 |From: Keith Parks <emkxp01@mtcc.demon.co.uk>
|Subject: [PATCH] adding SYS_TIME just for fun.
|
|Hi,
|
|Whilst I was playing round with the European dates patch I noticed the sysfunc()
|that allows you to do :-
|
|create table test ( da date);
|insert into test values (SYS_DATE);
|
|and have the current system date inserted.
|
|So I thought it would be nice to have the SYS_TIME facility too.
|
|I've cloned the function and changed a few things and there you have it,
|you can now do:
|
|create table test2 ( ti time);
|insert into test2 values (SYS_TIME);
1997-01-26 17:28:48 +00:00
Marc G. Fournier
632c44d829 Bring in a patch from Keith Parks to move the use of European dates
from a #define to a run-time option '-e'

Man page was updated to reflect new option
1997-01-26 15:32:28 +00:00
Bruce Momjian
84876289cc Cast constants to the type of the other binary operand.
Invalidate vacuum relation cache to use new row counts from vacuum.
1997-01-22 01:44:02 +00:00
Bruce Momjian
3a02ccfa1d Change EXPLAIN options to just use VERBOSE. 1997-01-16 14:56:59 +00:00
Bruce Momjian
0d3bf78e0b Added VERBOSE option to vacuum command. 1997-01-13 03:45:33 +00:00
Bruce Momjian
a5dd06f763 include sem.h added, include string.h neede, from Erik Bertelsen for Ultrix 1997-01-10 20:19:49 +00:00
Bruce Momjian
28a08fd4ac I have this annoying habit (among others) of putting
%ud in a printf format strings instead of just %u.

There were three occurances of this in catalog_utils.c,
two in parser.c and one in rewriteSupport.c in the oid
patch that I submitted and was applied.  They won't crash
anything, but the error messages will have a 'd' after the
Oid.  Annoying, but none are db-threatening.

Sorry about that folks...I'll be more careful in the future...

Darren King
1996-12-26 17:47:42 +00:00
Bruce Momjian
4371756f16 Improve handling of semicolons ending statements. 1996-12-20 20:33:12 +00:00
Bruce Momjian
db7a90f1d9 Make GROUP BY work with aliases, ORDER BY with column numbers 1996-12-17 01:53:43 +00:00
Bruce Momjian
7af262d2a7 Require seimcolons between statements. 1996-12-11 22:55:53 +00:00
Bryan Henderson
7439ba64b1 Use "Oid" type where applicable and %ud instead of %d. Thanks Darren King. 1996-12-11 03:18:12 +00:00
Bruce Momjian
c0941ab7f0 Remove Dan's fix of SELECT NULL to fix INSERT NULL. 1996-12-07 04:38:11 +00:00
Bruce Momjian
64397b758f Remove duplicate patch for COUNT fix. 1996-12-04 14:23:16 +00:00
Bruce Momjian
071797f539 Change tests to lowercase for esthetics. 1996-12-03 17:01:35 +00:00
Bruce Momjian
f2af019645 Make COUNT,SUM case insensitive. 1996-12-03 05:06:35 +00:00
Bruce Momjian
63df35e249 This patch changes quite a few instances of references of Oid's
as ints and longs.  Touches on quite a few function args as
well.  Most other files look ok as far as Oids go...still checking
though...

Since Oids are type'd as unsigned ints, they should prolly be used
with the %ud format string in elog and sprintf messages.  Not sure
what kind of strangeness that could produce.

Darren King
1996-11-30 18:07:02 +00:00
Bruce Momjian
f0a9e64afd As someone asked for this feature - patch for 1.09 follows.
Now You can do queries like

select sum(some_func(x)) from ...
select min(table1.x + table2.y) from table1, table2 where ...

and so on.

Vadim
1996-11-30 17:49:02 +00:00
Bruce Momjian
2d7aacb052 Added BETWEEN and IN to grammar. Map != to <>. 1996-11-30 03:38:09 +00:00
Bruce Momjian
a3d773a693 Allow select oid,* from table. Allow * anywhere in target list. 1996-11-29 15:56:18 +00:00
Bruce Momjian
ba876c150a Changed saved_relname size to save memory. 1996-11-28 05:46:08 +00:00
Bryan Henderson
46d58fba33 Make it compile on Ultrix. Thanks Erik Bertelson. 1996-11-26 03:20:35 +00:00
Bruce Momjian
6c2925b884 Prevent empty queries from crashing server. 1996-11-25 03:03:48 +00:00
Bruce Momjian
58802bf39a Can't add a keyword without making it a keyword. :-)
D'Arcy J.M. Cain                           |  Democracy is three wolves
1996-11-20 22:58:22 +00:00
Bruce Momjian
2abbf392bd Removed old Assert's used during development. 1996-11-19 05:06:39 +00:00
Bruce Momjian
7085aba53c Remove quote removal. Moved to parser. 1996-11-15 18:38:55 +00:00
Bryan Henderson
902d2b8bac Use -Wno-error option only if compiler is gcc. 1996-11-14 07:33:34 +00:00
Marc G. Fournier
07a65b2255 Commit of a *MAJOR* patch from Dan McGuirk <djm@indirect.com>
Changes:

        * Unique index capability works using the syntax 'create unique
          index'.

        * Duplicate OID's in the system tables are removed.  I put
          little scripts called 'duplicate_oids' and 'find_oid' in
          include/catalog that help to find and remove duplicate OID's.
          I also moved 'unused_oids' from backend/catalog to
          include/catalog, since it has to be in the same directory
          as the include files in order to work.

        * The backend tries converting the name of a function or aggregate
          to all lowercase if the original name given doesn't work (mostly
          for compatibility with ODBC).

        * You can 'SELECT NULL' to your heart's content.

        * I put my _bt_updateitem fix in instead, which uses
          _bt_insertonpg so that even if the new key is so big that
          the page has to be split, everything still works.

        * All literal references to system catalog OID's have been
          replaced with references to define'd constants from the catalog
          header files.

        * I added a couple of node copy functions.  I think this was a
          preliminary attempt to get rules to work.
1996-11-13 20:56:15 +00:00
Marc G. Fournier
2bdded3540 Various cleanups from D'Arcy 1996-11-11 12:14:45 +00:00
Bruce Momjian
13d44b4aac Warning removal cleanup 1996-11-11 04:54:54 +00:00
Bruce Momjian
77f8dff617 prototype cleanup 1996-11-10 03:30:46 +00:00
Bruce Momjian
aaeef4d17d All external function definitions now have prototypes that are checked. 1996-11-10 03:06:38 +00:00
Bryan Henderson
bf5cbbf789 Quiet compiler warnings. 1996-11-10 02:27:15 +00:00
Bruce Momjian
a0990e1884 Makefile cleanup after reorganization 1996-11-09 06:24:51 +00:00
Bruce Momjian
c9c0e111b8 More compile cleanups 1996-11-08 20:46:33 +00:00
Bruce Momjian
4b2b8592a0 Compile and warning cleanup 1996-11-08 06:02:30 +00:00
Marc G. Fournier
7d8b794a9a Add some missing includes
From: Randy Terbush <randy@zyzzyva.com>
1996-11-08 00:56:17 +00:00
Marc G. Fournier
ce4c0ce1de Some compile failure fixes from Keith Parks <emkxp01@mtcc.demon.co.uk> 1996-11-06 06:52:23 +00:00
Bruce Momjian
0108fddf13 Remove NULL_PATCH define 1996-11-04 04:35:48 +00:00
Bruce Momjian
8edbc3bde4 Remove ARRAY_PATCH define 1996-11-04 04:19:55 +00:00
Bruce Momjian
e43dfad289 Remove ESCAPE_PATCH define 1996-11-04 04:05:16 +00:00
Marc G. Fournier
b17c49e95d Add #include "postgres.h" 1996-10-31 11:09:44 +00:00
Bruce Momjian
4cf9d03ec7 Added prototypes missing from parser patch.
Added needed include file.
1996-10-31 05:54:27 +00:00
Bruce Momjian
f59a46a8c8 Parser Overhaul 1996-10-30 02:02:41 +00:00
Bryan Henderson
b0d6f0aa63 Simplify make files, add full dependencies. 1996-10-27 09:55:05 +00:00
Bryan Henderson
3010f46d2a E Use EUROPEAN_DATES from config.h instead of -D option 1996-10-25 06:00:49 +00:00
Bruce Momjian
83cb729887 More closing of relations left open by parser. 1996-10-14 03:53:53 +00:00
Bruce Momjian
abb1b3e770 I checked the alter table code, and started suspecting the relation
cache.  I found if I manually added a line to flush the whole relation
cache, the assert error disappeared.  Looking through the code, I found
that the relation cache is flushed at the end of each query if the
reference count is zero for the relation.  However, printf's showed that
the rd_relcnt(reference count) for the accessed query was not returning
to zero after each query.

It turns out the parser was doing a heap_ropen in parser/analyze.c to
get information about the table's columns, but was not doing a
heap_close.

This was causing the query after the ALTER TABLE ADD to see the old
table structure, and the executor's assert was reporting the problem.
1996-10-13 04:26:39 +00:00
Bruce Momjian
2baf2150e9 Fixed YACC depenencies and 'make clean' now cleans totally. 1996-09-26 15:40:45 +00:00
Marc G. Fournier
ee420c049f |This fixes the bug introduced yesterday that causes "not found" errors
|with gram.c and parser.h.
|
|--
|Bryan Henderson                                    Phone 408-227-6803
|San Jose, California
|
1996-09-21 06:29:09 +00:00
Marc G. Fournier
1a003fbcc2 Various patches from Bryan that *should* clean up the compile problems
ppl are seeing with v2.0
1996-09-20 08:34:39 +00:00
Marc G. Fournier
4978d3f4bb modifications required to reflect centralized include files 1996-08-28 22:50:24 +00:00
Marc G. Fournier
870be9fa8e Clean up th ecompile process by centralizing the include files
- code compile tested, but due to a yet unresolved problem with
          parse.h's creation, compile not completed...
1996-08-28 07:27:54 +00:00
Marc G. Fournier
e1f31a2bb6 added #include "config.h" for ESCAPE_PATCH define 1996-08-27 07:42:29 +00:00
Marc G. Fournier
2fd6061e1c Quick fix of the PG-GiST import pointed out by Dan 1996-08-26 19:59:15 +00:00
Marc G. Fournier
a2740a455f There, now we support GiST...now what? :) 1996-08-26 06:32:06 +00:00
Marc G. Fournier
208a30f23d The patch does several things:
It adds a WITH OIDS option to the copy command, which allows
dumping and loading of oids.

        If a copy command tried to load in an oid that is greater than
its current system max oid, the system max oid is incremented.  No
checking is done to see if other backends are running and have cached
oids.

        pg_dump as its first step when using the -o (oid) option, will
copy in a dummy row to set the system max oid value so as rows are
loaded in, they are certain to be lower than the system oid.

        pg_dump now creates indexes at the end to speed loading


Submitted by:  Bruce Momjian <maillist@candle.pha.pa.us>
1996-08-24 20:49:41 +00:00
Marc G. Fournier
926a066d40 Added a SVR4 port
---

below my signature, there are a coupls of diffs and files in a shell
archive, which were needed to build postgres95 1.02 on Siemens Nixdorfs
MIPS based SINIX systems. Except for the compiler switches "-W0" and
"-LD-Blargedynsym" these diffs should also apply for other SVR4 based
systems. The changes in "Makefile.global" and "genbki.sh" can probably
be ignored (I needed gawk, to make the script run).

There is one bugfix thou. In "src/backend/parser/sysfunc.c" the
function in this file didn't honor the EUROPEAN_DATES ifdef.

---

Submitted by:  Frank Ridderbusch <ridderbusch.pad@sni.de>
1996-08-19 13:52:54 +00:00
Marc G. Fournier
a4402ecc8c Fixes a bug in 'create index'
Submitted by: Dan McGuirk <mcguirk@indirect.com>
1996-08-15 07:42:52 +00:00
Marc G. Fournier
59f29714aa Fixes:
This patch forces postgres95 to assume any floating-point value is a
float8.  It removes the requirement that you cast all floating-point
constants to float8.

We can remove alot of casts in the regression test after we are sure
this works.

If I have missed anything, would someone let me know.  I have tested
inserts of floating-point values into float8 fields, and it worked well.
Casting the number to float4 showed the same precision loss as previous
uncast values showed.

Submitted by: Bruce Momjian <maillist@candle.pha.pa.us>
1996-08-13 01:29:34 +00:00
Marc G. Fournier
ae4725295a Fix an Inccorect Error Message...
Submitted by: Dan McGuirk <mcguirk@indirect.com>
1996-08-09 19:06:59 +00:00
Marc G. Fournier
bb0bdfd101 Fixes:
I've enclosed two patches.  The first affects Solaris compilability.  The
bug stems from netdb.h (where MAXHOSTNAMELEN is defined on a stock
system).  If the user has installed the header files from BIND 4.9.x,
there will be no definition of MAXHOSTNAMELEN.  The patch will, if all
else fails, try to include <arpa/nameser.h> and set MAXHOSTNAMELEN to
MAXDNAME, which is 256 (just like MAXHOSTNAMELEN on a stock system).

The second patch adds aliases for "ISNULL" to "IS NULL" and likewise for
"NOTNULL" to "IS NOT NULL".  I have not removed the postgres specific
ISNULL and NOTNULL.  I noticed this on the TODO list, and figured it would
be easy to remove.

The full semantics are:
        [ expression IS NULL ]
        [ expression IS NOT NULL ]

--Jason


Submitted by: Jason Wright <jason@oozoo.vnet.net>
1996-08-06 16:43:41 +00:00
Marc G. Fournier
6c684b1847 Fixes:
Previously Postgres95 wouldn't accept 'order by' clauses with fields
referred to as '<table>.<field>', e.g.:

        select t1.field1, t2.field2 from table1 t1, table2 t2
                order by t2.field2;

This syntax is required by the ODBC SQL spec.

Submitted by: Dan McGuirk <mcguirk@indirect.com>
1996-08-06 16:38:03 +00:00
Marc G. Fournier
ab22b34891 Fixes:
While a normal SELECT statement can contain a GROUP BY clause, a cursor
declaration cannot. This was not the case in PG-1.0. Was there a good
reason why this was changed? Are cursors being phased out? Is there any way
to get data with just a SELECT (and without a DECLARE CURSOR ...)?

The patch below seems to fix things. If anyone can see a problem with it,
please let me know. Thanks.

Submitted by:  David Smith <dasmith@perseus.tufts.edu>
1996-08-06 16:27:59 +00:00
Marc G. Fournier
48cde8d83b fix a redeclaration error
submitted by Kurt
1996-07-29 20:49:02 +00:00
Marc G. Fournier
18367ced1b Ack, missed two files from the merge...looks like a .11 is goin gto have
to go out after all :(
1996-07-23 05:51:29 +00:00
Marc G. Fournier
7344d69898 Finished merging in src/backend from Dr. George's source tree 1996-07-23 02:23:54 +00:00
Marc G. Fournier
94215d51c8 Fixes:
The updating of array fields is broken in Postgres95-1.01, An array can
be only replaced with a new array but not have some elements modified.
This is caused by two bugs in the parser and in the array utilities.
Furthermore it is not possible to update array with a base type of
variable length.


- submitted by: Massimo Dal Zotto <dz@cs.unitn.it>
1996-07-20 07:59:41 +00:00
Marc G. Fournier
20288400f3 Fixes:
I have written some patches which add support for NULLs to Postgres95.
In fact support for NULLs was already present in postgres, but it had been
disabled because not completely debugged, I believe. My patches simply add
some checks here and there. To enable the new code you must add -DNULL_PATCH
to CFLAGS in Makefile.global. After recompiling you can do things like:

insert into a (x, y) values (1, NULL);
update a set x = NULL where x = 0;

You can't still use a "where x=NULL" clause, you must use ISNULL instead.
This could probably be an easy fix to do.




Submitted by: Massimo Dal Zotto <dz@cs.unitn.it>
1996-07-19 07:24:11 +00:00
Marc G. Fournier
d31084e9d1 Postgres95 1.01 Distribution - Virgin Sources 1996-07-09 06:22:35 +00:00