Commit Graph

628 Commits

Author SHA1 Message Date
Peter Eisentraut bdb41ad0e7 Made abstime/reltime use int4 instead of time_t (TODO item)
Made type equivalency apply to aggregates (TODO item)
Fixed parsing bug in psql
Reverted some stupid options changes I made to pg_dump
2000-01-24 19:34:19 +00:00
Tatsuo Ishii 2605ceb704 Fix error messages for the lack of multi-byte support.
Since --with-mb has been removed from configure, previous
messages were not appropriate.
2000-01-23 08:16:37 +00:00
Peter Eisentraut 49581f9848 updated install file
updated date/time types doc
fixed small psql bug
removed libpq code that lower-cased db names
make notice when long identifier is truncated
2000-01-23 01:27:39 +00:00
Peter Eisentraut fa5400c0a4 added ALTER TABLE DROP COLUMN, early version 2000-01-22 14:20:56 +00:00
Tom Lane d32cd1bb25 Forgot to handle column length defaults in ALTER TABLE ADD COLUMN. 2000-01-22 01:22:48 +00:00
Tom Lane 1c15186747 Clean up longstanding gcc warnings by adding missing extern
declarations.
2000-01-20 05:26:54 +00:00
Tom Lane 7476e3718b Assign a typmod of -1 to unadorned CHAR and NUMERIC type specs. This
allows casts without specific length requirements to continue to work
as they did before; that is, x::char will not truncate the value of x,
whereas x::char(1) will.  Likewise for NUMERIC precision/scale.
The column length defaults of char(1) and numeric(30,6) are now inserted
in analyze.c's processing of CREATE TABLE.
2000-01-20 02:24:50 +00:00
Peter Eisentraut 533d516629 Removed MBFLAGS from makefiles since it's now done in include/config.h. 2000-01-19 02:59:03 +00:00
Peter Eisentraut f565cf41ab another set of cleanups 2000-01-18 23:30:24 +00:00
Bruce Momjian 80c5fea99d Since this patch is not big I send it here instead. I do not have the
complete source checked out so I cannot commit it myself.

Michael
2000-01-18 19:08:13 +00:00
Bruce Momjian e1cce4d5ea This corrects an error in current gram.y for ALTER TABLE ... ADD
CONSTRAINT

Oliver Elphick
2000-01-18 06:12:03 +00:00
Tom Lane ac4878a060 Pass atttypmod to CoerceTargetExpr, so that it can pass it on to
coerce_type, so that the right things happen when coercing a previously-
unknown constant to a destination data type.
2000-01-17 02:04:16 +00:00
Tom Lane 49528361f5 Create a new parsetree node type, TypeCast, so that transformation of
SQL cast constructs can be performed during expression transformation
instead of during parsing.  This allows constructs like x::numeric(9,2)
and x::int2::float8 to behave as one would expect.
2000-01-17 00:14:49 +00:00
Peter Eisentraut 759fba4873 Included all yacc and lex files into the distribution. 2000-01-16 20:05:00 +00:00
Tom Lane 7d715ba063 Fix broken FOR UPDATE error message. 2000-01-16 08:21:59 +00:00
Bruce Momjian faff1b776b Fix passing of atttypmod that Tom found. 2000-01-16 05:18:19 +00:00
Peter Eisentraut 1cd4c14116 Fixed all elog related warnings, as well as a few others. 2000-01-15 02:59:43 +00:00
Peter Eisentraut 4ceb2d0cb6 * User management commands no longer user pg_exec_query_dest -> more robust
* Let unprivileged users change their own passwords.

* The password is now an Sconst in the parser, which better reflects its text datatype and also
forces users to quote them.

* If your password is NULL you won't be written to the password file, meaning you can't connect
until you have a password set up (if you use password authentication).

* When you drop a user that owns a database you get an error. The database is not gone.
2000-01-14 22:11:38 +00:00
Peter Eisentraut 46a28f1b14 Fixed everything in and surrounding createdb and dropdb to make it more
error-proof. Rearranged some old code and removed dead sections.
2000-01-13 18:26:18 +00:00
Bruce Momjian 8a093d0ae3 Make number of args to a function configurable. 2000-01-10 17:14:46 +00:00
Bruce Momjian a040281787 Move fixes for >8 indexed fields. 2000-01-10 05:20:26 +00:00
Jan Wieck b7b6d4bf53 Changed "triggered data change violation" detection code
in trigger manager.

Jan
2000-01-06 20:47:01 +00:00
Tom Lane 350cb386af Clean up handling of explicit NULL constants. Cases like
SELECT null::text;
	SELECT int4fac(null);
work as expected now.  In some cases a NULL must be surrounded by
parentheses:
	SELECT 2 + null;                 fails
	SELECT 2 + (null);               OK
This is a grammatical ambiguity that seems difficult to avoid.  Other
than that, NULLs seem to behave about like you'd expect.  The internal
implementation is that NULL constants are typed as UNKNOWN (like
untyped string constants) until the parser can deduce the right type.
1999-12-24 06:43:34 +00:00
Thomas G. Lockhart aac9f5bee8 Re-enable makeAttr() if ENABLE_OUTER_JOINS is defined.
Somehow got bracketed with #ifdef NOT_USED instead.
1999-12-17 14:47:35 +00:00
Bruce Momjian 21992ed10a Reverse out nextval patch. 1999-12-17 01:25:25 +00:00
Jan Wieck 397e9b32a3 Some changes to prepare for LONG attributes.
Jan
1999-12-16 22:20:03 +00:00
Bruce Momjian cf374febf5 >Turning nextval and currval into keywords is not an acceptable way to
>go about this.  That will risk breaking existing applications that use
>those names as column names.
>
>It should actually almost work to write sq.nextval as things stand,
>because Postgres has for a long time considered table.function and
>function(table) to be interchangeable notations for certain kinds of
>functions.  nextval doesn't seem to be one of that kind of function,
>at the moment.  I'd suggest leaving the grammar as it was, and taking a
>look at ParseFuncOrColumn in parse_func.c to see if you can't persuade
>it to accept the sequence functions in that style.

OK, good point. I tried to implement it somewhere else and ended up
extending transformAttr. Attached you'll find the patch.

Jeroen van Vianen
1999-12-16 20:07:41 +00:00
Bruce Momjian 99b8f84511 Here's the Create/Alter/Drop Group stuff that's been really overdue. I
didn't have time for documentation yet, but I'll write some. There are
still some things to work out what happens when you alter or drop users,
but the group stuff in and by itself is done.

--
Peter Eisentraut                  Sernanders väg 10:115
1999-12-16 17:24:19 +00:00
Bruce Momjian bcaabc5698 Depending on my interpreting (and programming) skills, this might solve
anywhere from zero to two TODO items.

* Allow flag to control COPY input/output of NULLs

I got this:
COPY table .... [ WITH NULL AS 'string' ]
which does what you'd expect. The default is \N, otherwise you can use
empty strings, etc. On Copy In this acts like a filter: every data item
that looks like 'string' becomes a NULL. Pretty straightforward.

This also seems to be related to

* Make postgres user have a password by default

If I recall this discussion correctly, the problem was actually that the
default password for the postgres (or any) user is in fact "\N", because
of the way copy is used. With this change, the file pg_pwd is copied out
with nulls as empty strings, so if someone doesn't have a password, the
password is just '', which one would expect from a new account. I don't
think anyone really wants a hard-coded default password.

Peter Eisentraut                  Sernanders väg 10:115
1999-12-14 00:08:21 +00:00
Bruce Momjian a82f9ffde6 New LDOUT makefile variable for QNX os. 1999-12-13 22:35:27 +00:00
Tom Lane a8ae19ec3d aggregate(DISTINCT ...) works, per SQL spec.
Note this forces initdb because of change of Aggref node in stored rules.
1999-12-13 01:27:21 +00:00
Tom Lane efb36d2be8 any_ordering_op()'s argument should be declared Oid not int. 1999-12-12 20:51:29 +00:00
Tom Lane 18c3000286 Teach grammar and parser about aggregate(DISTINCT ...). No implementation
yet, but at least we can give a better error message:
regression=> select count(distinct f1) from int4_tbl;
ERROR:  aggregate(DISTINCT ...) is not implemented yet
instead of 'parser: parse error at or near distinct'.
1999-12-10 07:37:35 +00:00
Bruce Momjian ecba5d308c Remove unneeded action. 1999-12-10 05:17:13 +00:00
Bruce Momjian 97dec77fab Rename several destroy* functions/tags to drop*. 1999-12-10 03:56:14 +00:00
Tom Lane f6baabcd0b Correct coredump in ALTER TABLE foo ADD(). Accept explicit NULL in
typecasts, eg 'NULL::text'.  Later parts of the parser don't like this
yet, but I'll work on that next.
1999-12-10 03:01:05 +00:00
Bruce Momjian 3ffd3d82db Make LD -r as macros that can be changed for QNX. 1999-12-09 19:15:45 +00:00
Tom Lane f7f41c7c8c Replace generic 'Illegal use of aggregates' error message with one that
shows the specific ungrouped variable being complained of.  Perhaps this
will reduce user confusion...
1999-12-09 05:58:56 +00:00
Tom Lane 04fa5ca544 Clean up memory leakage in find_inheritors() by using pg_list lists
(which are palloc'd) instead of DLLists (which are malloc'd).  Not very
significant, since this routine seldom has anything useful to do, but
a leak is a leak...
1999-12-07 04:09:39 +00:00
Jan Wieck b8ef7e7f82 Completed FOREIGN KEY syntax.
Added functionality for automatic trigger creation during CREATE TABLE.

Added ON DELETE RESTRICT and some others.

Jan
1999-12-06 18:02:47 +00:00
Bruce Momjian eebfb9baa5 create/alter user extension
This one should work much better than the one I sent in previously. The
functionality is the same, but the patch was missing one file resulting
in
the compilation failing. The docs also received a minor fix.

Peter Eisentraut                  Sernanders väg 10:115
1999-11-30 03:57:29 +00:00
Bruce Momjian fc955b14ea Add system indexes to match all caches.
Make all system indexes unique.
Make all cache loads use system indexes.
Rename *rel to *relid in inheritance tables.
Rename cache names to be clearer.
1999-11-22 17:56:41 +00:00
Tom Lane ea4ae10849 Fix problems with CURRENT_DATE and related functions being used in
table defaults or rules: translate them to a function call so that
parse_coerce doesn't reduce them to a date or time constant immediately.
Also, eliminate a lot of redundancy in the expression grammar by
defining a new nonterminal com_expr, which contains all the productions
that can be shared by a_expr and b_expr.
1999-11-20 21:39:36 +00:00
Tom Lane f68e11f373 Implement subselects in target lists. Also, relax requirement that
subselects can only appear on the righthand side of a binary operator.
That's still true for quantified predicates like x = ANY (SELECT ...),
but a subselect that delivers a single result can now appear anywhere
in an expression.  This is implemented by changing EXPR_SUBLINK sublinks
to represent just the (SELECT ...) expression, without any 'left hand
side' or combining operator --- so they're now more like EXISTS_SUBLINK.
To handle the case of '(x, y, z) = (SELECT ...)', I added a new sublink
type MULTIEXPR_SUBLINK, which acts just like EXPR_SUBLINK used to.
But the grammar will only generate one for a multiple-left-hand-side
row expression.
1999-11-15 02:00:15 +00:00
Bruce Momjian 86ef36c907 New NameStr macro to convert Name to Str. No need for var.data anymore.
Fewer calls to nameout.

Better use of RelationGetRelationName.
1999-11-07 23:08:36 +00:00
Tom Lane d40dbb7387 Eliminate local inefficiencies in updateTargetListEntry, make_var, and
make_const --- don't repeat cache searches that aren't needed.
1999-11-01 05:06:21 +00:00
Bruce Momjian 60f3e6b3a5 Make USING in COPY optional. 1999-10-29 23:52:22 +00:00
Bruce Momjian ba1714b654 Fix wording. 1999-10-29 23:44:42 +00:00
Bruce Momjian d426869b89 Fix compile after COMMENT problem. 1999-10-26 16:32:46 +00:00
Bruce Momjian 577e21b34f Hello.
The following patch extends the COMMENT ON functionality to the
rest of the database objects beyond just tables, columns, and views. The
grammer of the COMMENT ON statement now looks like:

COMMENT ON [
  [ DATABASE | INDEX | RULE | SEQUENCE | TABLE | TYPE | VIEW ] <objname>
|

  COLUMN <relation>.<attribute> |
  AGGREGATE <aggname> <aggtype> |
  FUNCTION <funcname> (arg1, arg2, ...) |
  OPERATOR <op> (leftoperand_typ rightoperand_typ) |
  TRIGGER <triggername> ON relname>

Mike Mascari
(mascarim@yahoo.com)
1999-10-26 03:12:39 +00:00