Commit Graph

39 Commits

Author SHA1 Message Date
Tom Lane 2f63232d30 Promote row expressions to full-fledged citizens of the expression syntax,
rather than allowing them only in a few special cases as before.  In
particular you can now pass a ROW() construct to a function that accepts
a rowtype parameter.  Internal generation of RowExprs fixes a number of
corner cases that used to not work very well, such as referencing the
whole-row result of a JOIN or subquery.  This represents a further step in
the work I started a month or so back to make rowtype values into
first-class citizens.
2004-05-10 22:44:49 +00:00
Tom Lane 7665d1bc16 Teach psql to show the location of syntax errors visually, per recent
discussions.  Patch by Fabien Coelho and Tom Lane.  Still needs to be
taught about multi-screen-column kanji characters; Tatsuo has promised
to provide the needed infrastructure for that.
2004-03-14 04:25:18 +00:00
Tom Lane 0e319c7ad7 Improve context display for failures during COPY IN, as recently
discussed on pghackers.
2003-09-29 22:06:40 +00:00
Peter Eisentraut be1d437e01 Forget to update the real source of the regression test results after
message editing.
2003-09-25 15:48:17 +00:00
Tom Lane ec7aa4b515 Error message editing in backend/access. 2003-07-21 20:29:40 +00:00
Tom Lane 5e6d691e0d Error message editing in backend/executor. 2003-07-21 17:05:12 +00:00
Tom Lane a56ff9a0bd Another round of error message editing, covering backend/parser/. 2003-07-19 20:20:53 +00:00
Tom Lane 9fbd52808e Adopt latest bison's spelling of 'syntax error' rather than 'parse error'
for grammar-detected problems.  Revert Makefile hack that kept it looking
like the pre-bison-1.875 output.
2003-05-29 20:40:36 +00:00
Tom Lane f690920a75 Infrastructure for upgraded error reporting mechanism. elog.c is
rewritten and the protocol is changed, but most elog calls are still
elog calls.  Also, we need to contemplate mechanisms for controlling
all this functionality --- eg, how much stuff should appear in the
postmaster log?  And what API should libpq expose for it?
2003-04-24 21:16:45 +00:00
Bruce Momjian 4b26e7d24b More changes to match new error format. 2002-08-18 03:00:17 +00:00
Bruce Momjian 7312c19ab5 Change messages like this:
ERROR:  ExecInsert: rejected due to CHECK constraint insert_con

To be like this:

ERROR:  ExecInsert: rejected due to CHECK constraint "insert_con" on
"insert_tbl"

Updated regression tests to match.

I got sick of seeing 'rejected due to CHECK constraint "$1" in my log and
not being able to find the bug in our website code...

Christopher Kings-Lynne
2002-08-04 05:04:40 +00:00
Tom Lane 7c6df91dda Second phase of committing Rod Taylor's pg_depend/pg_constraint patch.
pg_relcheck is gone; CHECK, UNIQUE, PRIMARY KEY, and FOREIGN KEY
constraints all have real live entries in pg_constraint.  pg_depend
exists, and RESTRICT/CASCADE options work on most kinds of DROP;
however, pg_depend is not yet very well populated with dependencies.
(Most of the ones that are present at this point just replace formerly
hardwired associations, such as the implicit drop of a relation's pg_type
entry when the relation is dropped.)  Need to add more logic to create
dependency entries, improve pg_dump to dump constraints in place of
indexes and triggers, and add some regression tests.
2002-07-12 18:43:19 +00:00
Bruce Momjian 29dfd5fa26 Change error messages ExecAppend->ExecInsert and ExecReplace->ExecUpdate
as discussed on hackers.
2002-07-11 21:36:20 +00:00
Bruce Momjian e2c007046f Back out cleanup patch. Got old version and needs work.
Neil Conway
2002-06-25 17:58:10 +00:00
Bruce Momjian ed275aea42 The attached patch fixes some spelling mistakes, makes the
comments on one of the optimizer functions a lot more
clear, adds a summary of the recent KSQO discussion to the
comments in the code, adds regression tests for the bug with
sequence state Tom fixed recently and another reg. test, and
removes some PostQuel legacy stuff: ExecAppend -> ExecInsert,
ExecRetrieve -> ExecSelect, etc. This was changed because the
elog() messages from this routine are user-visible, so we
should be using the SQL terms.

Neil Conway
2002-06-25 17:27:20 +00:00
Tom Lane 5f4745adf4 Further cleanups for relations in schemas: teach nextval and other
sequence functions how to cope with qualified names.  Same code is
also used for int4notin, currtid_byrelname, pgstattuple.  Also,
move TOAST tables into special pg_toast namespace.
2002-03-30 01:02:42 +00:00
Bruce Momjian 7ce0f9c375 Adjust elog() tags so source and regression tests match. 2002-03-07 20:18:15 +00:00
Tom Lane ce7a4f06a2 Cause regression tests to pass again after elog changes. 2002-03-03 01:05:22 +00:00
Bruce Momjian 434077c4e6 Remove "ADD" from TABLE / ADD UNIQUE-PRIMARY error message because the
same code is called for both creation and alter.  Not worth worrying
about.
2001-11-04 02:41:09 +00:00
Bruce Momjian e7fc0604cd Modify *.po files and regression expected output for new clearer error
message spacing.
2001-10-31 05:14:33 +00:00
Bruce Momjian 4911c85e86 Add ALTER TABLE ADD UNIQUE regression tests from Christopher Kings-Lynne.
Add space between slash for ALTER TABLE / ADD ....

Regression and *.po updates to follow.
2001-10-31 04:49:44 +00:00
Tom Lane b200d0993d Adjust expected error message due to change of keyword case-folding. 2001-02-22 05:32:56 +00:00
Peter Eisentraut 7e77668e7a Make regression tests work with VPATH builds. 2000-10-27 20:00:22 +00:00
Tom Lane 553b5da6a1 Change to report COPY line number in error messages affects
results of constraints regress test.
2000-02-15 19:45:31 +00:00
Tom Lane 6d1efd76fb Fix handling of NULL constraint conditions: per SQL92 spec, a NULL result
from a constraint condition does not violate the constraint (cf. discussion
on pghackers 12/9/99).  Implemented by adding a parameter to ExecQual,
specifying whether to return TRUE or FALSE when the qual result is
really NULL in three-valued boolean logic.  Currently, ExecRelCheck is
the only caller that asks for TRUE, but if we find any other places that
have the wrong response to NULL, it'll be easy to fix them.
2000-01-19 23:55:03 +00:00
Tom Lane a4e1304ed1 Add check that inherited constraints and defaults work. 2000-01-16 19:57:48 +00:00
Tom Lane 5e6004135b Now that new psql is fflush()'ing properly, it emerges that several
regress test expected outputs were committed with NOTICEs appearing out
of order.  Update to correct results.
2000-01-15 19:18:24 +00:00
Thomas G. Lockhart 69789bf33d Update format to add uniform headers on files.
Update output to new psql conventions.
2000-01-05 17:32:18 +00:00
Tom Lane a4fec9ec34 Oops, forgot to commit this one last week. Part of patch to update
regress test expected outputs for change in 'Cannot insert a duplicate key'
error message wording.
1999-11-27 17:56:18 +00:00
Tom Lane 79f39c4d34 My latest fixes to gram.y cause CREATE TABLE t (f1 bool default 1 < 2)
to be accepted, but constraints regress test was expecting it to fail.
1999-11-20 21:41:31 +00:00
Tom Lane eabc714a91 Reimplement parsing and storage of default expressions and constraint
expressions in CREATE TABLE.  There is no longer an emasculated expression
syntax for these things; it's full a_expr for constraints, and b_expr
for defaults (unfortunately the fact that NOT NULL is a part of the
column constraint syntax causes a shift/reduce conflict if you try a_expr.
Oh well --- at least parenthesized boolean expressions work now).  Also,
stored expression for a column default is not pre-coerced to the column
type; we rely on transformInsertStatement to do that when the default is
actually used.  This means "f1 datetime default 'now'" behaves the way
people usually expect it to.
BTW, all the support code is now there to implement ALTER TABLE ADD
CONSTRAINT and ALTER TABLE ADD COLUMN with a default value.  I didn't
actually teach ALTER TABLE to call it, but it wouldn't be much work.
1999-10-03 23:55:40 +00:00
Thomas G. Lockhart 5dd715b592 Adjust elog NOTICE messages to surround table and column names with single
quotes.
1999-05-12 07:24:01 +00:00
Bruce Momjian 4390b0bfbe Add TEMP tables/indexes. Add COPY pfree(). Other cleanups. 1999-02-02 03:45:56 +00:00
Bruce Momjian 845f82e541 Regression cleanup of WARN. 1998-01-06 19:25:19 +00:00
Thomas G. Lockhart 405740ace6 Include informational messages added for implicit index creation. 1997-12-09 01:46:31 +00:00
Thomas G. Lockhart 733f2a43cc Change constraint syntax to SQL92 style.
Add tests for PRIMARY KEY and UNIQUE clauses.
1997-12-05 00:01:22 +00:00
Vadim B. Mikheev fcfb4d1df6 Changes due to fixed DEFAULT behaviour. 1997-10-17 09:59:09 +00:00
Thomas G. Lockhart 2b4be93787 Modify to match current expected output
after adding separate sections for DEFAULT and CHECK.
1997-09-16 16:17:19 +00:00
Vadim B. Mikheev 174bc0c1e7 Tests for CHECK/DEFAULT 1997-08-28 04:49:34 +00:00