Commit Graph

4985 Commits

Author SHA1 Message Date
Tom Lane 11333426f1 Implement DROP SCHEMA. It lacks support for dropping conversions and
operator classes, both of which are schema-local and so should really
be droppable.
2002-07-18 16:47:26 +00:00
Bruce Momjian e6f02c8231 REVOKE ALL ON FUNCTION nonexistant() FROM PUBLIC;
Used to report that GRANT could not find function nonexistant.

Rod Taylor
2002-07-18 04:50:10 +00:00
Bruce Momjian a90db34b54 The attached patch (against HEAD) implements
COPY x (a,d,c,b) from stdin;
  COPY x (a,c) to stdout;

as well as the corresponding changes to pg_dump to use the new
functionality.  This functionality is not available when using
the BINARY option.  If a column is not specified in the COPY FROM
statement, its default values will be used.

In addition to this functionality, I tweaked a couple of the
error messages emitted by the new COPY <options> checks.

Brent Verner
2002-07-18 04:43:51 +00:00
Bruce Momjian 3e22406ec6 Finished the Between patch Christopher started.
Implements between (symmetric / asymmetric) as a node.

Executes the left or right expression once, makes a Const out of the
resulting Datum and executes the >=, <= portions out of the Const sets.

Of course, the parser does a fair amount of preparatory work for this to
happen.

Rod Taylor
2002-07-18 04:41:46 +00:00
Bruce Momjian 7ea5f1d7f1 Here is a patch for the Table Function API. It fixes a bug found by Neil
Conway (BuildTupleFromCStrings sets NULL for pass-by-value types when
intended value is 0). It also implements some other improvements
suggested by Neil.

Joe Conway
2002-07-18 04:40:30 +00:00
Bruce Momjian 404e9a12a5 Move libc replacement files from src/backend/port to src/port. 2002-07-18 04:13:59 +00:00
Tatsuo Ishii eb335a034b I have committed many support files for CREATE CONVERSION. Default
conversion procs and conversions are added in initdb. Currently
supported conversions are:

UTF-8(UNICODE) <--> SQL_ASCII, ISO-8859-1 to 16, EUC_JP, EUC_KR,
		    EUC_CN, EUC_TW, SJIS, BIG5, GBK, GB18030, UHC,
		    JOHAB, TCVN

EUC_JP <--> SJIS
EUC_TW <--> BIG5
MULE_INTERNAL <--> EUC_JP, SJIS, EUC_TW, BIG5

Note that initial contents of pg_conversion system catalog are created
in the initdb process. So doing initdb required is ideal, it's
possible to add them to your databases by hand, however. To accomplish
this:

psql -f your_postgresql_install_path/share/conversion_create.sql your_database

So I did not bump up the version in cataversion.h.

TODO:
Add more conversion procs
Add [CASCADE|RESTRICT] to DROP CONVERSION
Add tuples to pg_depend
Add regression tests
Write docs
Add SQL99 CONVERT command?
--
Tatsuo Ishii
2002-07-18 02:02:30 +00:00
Tom Lane 5af19e4227 Add more dependency insertions --- this completes the basic pg_depend
functionality.  Of note: dropping a table that has a SERIAL column
defined now drops the associated sequence automatically.
2002-07-16 22:12:20 +00:00
Bruce Momjian 846ea08d34 Oops, sometimes strtol isn't called in pg_atoi, so we do need that badp
check.
2002-07-16 18:34:16 +00:00
Bruce Momjian 7aee5ed3b7 Fix tid to in/out as unsigned. 2002-07-16 17:55:25 +00:00
Tatsuo Ishii 3c7798f068 Add conversion procs for CREATE CONVERSION 2002-07-16 09:25:06 +00:00
Tatsuo Ishii 743b747264 Fix typo 2002-07-16 06:58:44 +00:00
Tatsuo Ishii d49108fd73 Add FindDefaultConversionProc 2002-07-16 06:58:14 +00:00
Tom Lane 30ec31604d Add code to extract dependencies from an expression tree, and use it
to build dependencies for rules, constraint expressions, and default
expressions.  Repair some problems in the original design of
recursiveDeletion() exposed by more complex dependency sets.  Fix
regression tests that were deleting things in illegal sequences.
2002-07-16 05:53:34 +00:00
Bruce Momjian 1e07ab78cc Add DLLINIT mention in port/Makefile. 2002-07-16 05:49:38 +00:00
Bruce Momjian 3cbb9eb265 Move few remaining src/utils files to backend/port so everything is in
one place.  Everything may be moved to src/utils eventually.

Add DLLINIT variable to simplify makfiles.
2002-07-16 05:46:36 +00:00
Bruce Momjian b3341ddbf2 Mark 'line' as 'not implemented' in SGML and psql \dT, per Thomas
Lockhart.  initdb not forced.
2002-07-16 03:30:27 +00:00
Bruce Momjian b9104e3a97 Remove certain Makefile dependencies by using full pathnames in
configure.in.
2002-07-15 21:34:05 +00:00
Tom Lane 7bd631bfa4 Use the dependency mechanism to manage column defaults. We need this
so that dependencies in default expressions (on operators, functions,
etc) can be expressed properly.
2002-07-15 16:33:32 +00:00
Bruce Momjian e552e9e512 Improve relcache.c error reporting for the next guy who has to debug
this thing.
2002-07-15 01:57:51 +00:00
Tom Lane d5fa19c6ee Add COMMENT ON CONSTRAINT facility (from Rod Taylor's pg_constraint patch).
Fix comment.c to not depend on parser token values, per discussion awhile
back.
2002-07-14 23:38:13 +00:00
Tom Lane df3f5dfd19 In DeleteAttributeTuples, use a single indexscan instead of the multiple
scans that will most likely be caused by SearchSysCache probes.  Also,
share some code between index deletion and table deletion.
2002-07-14 21:08:08 +00:00
Tom Lane 942a2e94fa Fix testing of partial-index predicates to work correctly in cases where
varno of index's relation is not 1.  This embarrassing oversight pointed
out by Dmitry Tkach 12-Jul-02.
2002-07-13 19:20:34 +00:00
Bruce Momjian 4db8718e84 Add SET statement_timeout capability. Timeout is in ms. A value of
zero turns off the timer.
2002-07-13 01:02:14 +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
Tatsuo Ishii fcc962566a Add new CREATE CONVERSION/DROP CONVERSION command.
This is the first cut toward CREATE CONVERSION/DROP CONVERSION implementaion.
The commands can now add/remove tuples to the new pg_conversion system
catalog, but that's all. Still need work to make them actually working.
Documentations, regression tests also need work.
2002-07-11 07:39:28 +00:00
Bruce Momjian 92a77cb870 Oops, proper initialization for domainTypMod was none at all, not 0. 2002-07-09 13:52:14 +00:00
Bruce Momjian 81e7e71941 Fix compiler warning:
int32           domainTypMod = NULL;

should be:

	int32           domainTypMod = 0;
2002-07-09 05:21:35 +00:00
Bruce Momjian 1666970275 I've fixed up the way domain constraints (not null and type length)
are managed as per request.

Moved from merging with table attributes to applying themselves during
coerce_type() and coerce_type_typmod.

Regression tests altered to test the cast() scenarios.

Rod Taylor
2002-07-06 20:16:36 +00:00
Bruce Momjian c8c2b7fff9 Fix compile error in assert coded added by new DISTINCT ON patch. 2002-07-04 16:44:08 +00:00
Thomas G. Lockhart 68d9fbeb55 Implement the IS DISTINCT FROM operator per SQL99.
Reused the Expr node to hold DISTINCT which strongly resembles
 the existing OP info. Define DISTINCT_EXPR which strongly resembles
 the existing OPER_EXPR opType, but with handling for NULLs required
 by SQL99.
We have explicit support for single-element DISTINCT comparisons
 all the way through to the executor. But, multi-element DISTINCTs
 are handled by expanding into a comparison tree in gram.y as is done for
 other row comparisons. Per discussions, it might be desirable to move
 this into one or more purpose-built nodes to be handled in the backend.
Define the optional ROW keyword and token per SQL99.
 This allows single-element row constructs, which were formerly disallowed
 due to shift/reduce conflicts with parenthesized a_expr clauses.
Define the SQL99 TREAT() function. Currently, use as a synonym for CAST().
2002-07-04 15:24:11 +00:00
Bruce Momjian c9a7345217 >the extra level of struct naming for pd_opaque has no obvious
>usefulness.
>
>> [...] should I post a patch that puts pagesize directly into
>> PageHeaderData?
>
>If you're so inclined.  Given that pd_opaque is hidden in those macros,
>there wouldn't be much of any gain in readability either, so I haven't
>worried about changing the declaration.

Thanks for the clarification.  Here is the patch.  Not much gain, but at
least it saves the next junior hacker from scratching his head ...


Manfred Koizar
2002-07-02 06:18:57 +00:00
Bruce Momjian 33f1687879 There already was a macro PageGetItemId; this is now used in (almost)
all places, where pd_linp is accessed.  Also introduce new macros
SizeOfPageHeaderData and BTMaxItemSize. This is just source code
cosmetic, no behaviour changed.

Manfred Koizar
2002-07-02 05:48:44 +00:00
Bruce Momjian 8864603f3c Minor code cleanup in bufmgr.c and bufmgr.h, mainly by moving repeated
lines of code into internal routines (drop_relfilenode_buffers,
release_buffer) and by hiding unused routines (PrintBufferDescs,
PrintPinnedBufs) behind #ifdef NOT_USED. Remove AbortBufferIO()
declaration from bufmgr.c (already declared in bufmgr.h)

Manfred Koizar
2002-07-02 05:47:37 +00:00
Bruce Momjian 97bfffe50e This patch, which is built upon the "HeapTupleHeader accessor macros"
patch from 2002-06-10, is supposed to reduce the heap tuple header size
by four bytes on most architectures.  Of course it changes the on-disk
tuple format and therefore requires initdb.

This overlays cmin/cmax/xmax fields into only two fields.

Manfred Koizar
2002-07-02 05:46:14 +00:00
Tom Lane 131f801d37 First phase of applying Rod Taylor's pg_depend patch. This just adds
RESTRICT/CASCADE syntax to the DROP commands that need it, and propagates
the behavioral option through the parser to the routines that execute
drops.  Doesn't do anything useful yet, but I figured I'd commit these
changes so I could get out of the parser area while working on the rest.
2002-07-01 15:27:56 +00:00
Bruce Momjian 4f0de24486 Restore error message I accidentally changed. 2002-06-26 22:16:54 +00:00
Bruce Momjian 73ad6ca96c 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.

Error messages remain unchanged until a vote.

Neil Conway
2002-06-26 21:58:56 +00:00
Tom Lane 893fe4919d Treat \r as white space when parsing pg_hba and related files.
Should make life easier for DBAs who insist on editing files with
Windoze tools.
2002-06-26 14:52:08 +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
Bruce Momjian 8a9462867a Here is a patch for a memory leak in rtree.c, version 7.2.1 (in code
that I submitted last year, alas).

Kenneth Been
2002-06-25 17:26:11 +00:00
Bruce Momjian 5a15149736 It seems that ExecInit/EndIndexScan is leaking some memory...
For example, if I run a query, that uses an index scan, and call
MemoryContextSt ats (CurrentMemoryContext) before ExecutorStart() and
after ExecutorEnd() in ProcessQuery(), I am consistently see ing that
the 'after' call shows 256 bytes more used, then 'before'...

The problem seems to be in ExecEndIndexScan - it does not release
scanstate, ind exstate, indexstate->iss_RelationDescs and indexstate ->
iss_ScanDescs...

Dmitry Tkach
2002-06-23 21:29:32 +00:00
Thomas G. Lockhart 90edb265e3 Implement SQL99 CREATE CAST and DROP CAST statements.
Also implement alternative forms to expose the PostgreSQL CREATE FUNCTION
 features.
Implement syntax for READ ONLY and READ WRITE clauses in SET TRANSACTION.
 READ WRITE is already implemented (of course).
Implement syntax for "LIKE table" clause in CREATE TABLE. Should be fairly
 easy to complete since it resembles SELECT INTO.
Implement MATCH SIMPLE clause for foreign key definitions. This is explicit
 SQL99 syntax for the default behavior, so we now support it :)
Start implementation of shorthand for national character literals in
 scanner. For now, just swallow the leading "N", but sometime soon let's
 figure out how to pass leading type info from the scanner to the parser.
 We should use the same technique for binary and hex bit string literals,
 though it might be unusual to have two apparently independent literal
 types fold into the same storage type.
2002-06-22 02:04:55 +00:00
Bruce Momjian db650b451e Remove Jan's copyright, with his approval. 2002-06-21 02:59:38 +00:00
Bruce Momjian 42ef2c9cb7 Clean up some copyrights. 2002-06-20 20:51:45 +00:00
Bruce Momjian 27bce57766 Add missing SRF file. 2002-06-20 20:37:00 +00:00
Bruce Momjian d84fe82230 Update copyright to 2002. 2002-06-20 20:29:54 +00:00
Bruce Momjian ba790a5608 Here is a patch for Composite and Set returning function support. I made
two small changes to the API since last patch, which hopefully completes
the decoupling of composite function support from SRF specific support.

Joe Conway
2002-06-20 17:19:08 +00:00