Commit Graph

201 Commits

Author SHA1 Message Date
Bruce Momjian c18ed2f5a7 Parser cleanup for expr and subqueries. 1998-02-03 01:53:24 +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
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
Bruce Momjian 7015dfef4b Add LOCK command as DELETE FROM ... WHERE false. 1998-01-22 23:05:18 +00:00
Bruce Momjian 412a5e6539 Parser cleanup.
Add lock to i386 asm.
1998-01-20 05:05:08 +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
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 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 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 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 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
Bruce Momjian a68a132a6c Add VARHDRSZ where needed. Many places just used 4. 1997-12-06 22:57:36 +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
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 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
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
Bruce Momjian 1c32d285a6 Remove pg_magic, defaults, server, hosts, and demon tables. unused. 1997-11-15 20:58:05 +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 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
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
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
Bruce Momjian f3af1368bd Rename strNcpy to StrNCpy, and change third parameter. 1997-10-25 01:10:58 +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 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
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
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
Bruce Momjian fe54c54da3 Allow SELECT NULL as EMPTY_FIELD, Patrick. 1997-09-12 22:14:48 +00:00
Bruce Momjian 23db70bf73 Lex/yacc source cleanup like indent. 1997-09-08 03:20:18 +00:00
Vadim B. Mikheev bad4bc40b9 CREATE/DROP TRIGGER syntax 1997-09-04 13:24:26 +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
Vadim B. Mikheev becd2f9b82 Fix for "default = '...'" in CREATE TYPE 1997-08-28 05:02: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
Vadim B. Mikheev e3accffe66 Syntax for [CONSTRAINT name] CHECK ... 1997-08-21 01:34:44 +00:00
Vadim B. Mikheev 4527172b80 CHECK/DEFAULT syntax 1997-08-20 01:12:38 +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 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
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
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 803a2b13f2 Fix for 'SET var_name TO var_value': var_name already defined. 1997-04-05 06:25:59 +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
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
Bruce Momjian cf2403896d Only allow NULL in the prpoer places. 1997-02-13 15:40:03 +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 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
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
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
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 c9c0e111b8 More compile cleanups 1996-11-08 20:46:33 +00:00
Bruce Momjian f59a46a8c8 Parser Overhaul 1996-10-30 02:02:41 +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 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 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 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 7344d69898 Finished merging in src/backend from Dr. George's source tree 1996-07-23 02:23:54 +00:00
Marc G. Fournier d31084e9d1 Postgres95 1.01 Distribution - Virgin Sources 1996-07-09 06:22:35 +00:00