Commit Graph

4960 Commits

Author SHA1 Message Date
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
Bruce Momjian c2c2fd57ee Improve COPY syntax to use WITH clause, keep backward compatibility. 2002-06-20 16:00:44 +00:00
Bruce Momjian e136986afb Properly mark rules that return no value. 2002-06-19 15:40:58 +00:00
Bruce Momjian 8080ac74d5 Wrap long gram.y lines. 2002-06-18 17:56:41 +00:00
Bruce Momjian 71fd49e28d Change CREATE DATABASE to use DefElem instead of constructing structure
members in gram.y.  This is the prefered method for WITH and arbitrary
param/value pairs.
2002-06-18 17:27:58 +00:00
Bruce Momjian 3d564953cd Improve rule action ordering in gram.y, more cleanups. 2002-06-18 00:28:11 +00:00
Bruce Momjian e25f9e4f5d Mark noise keyword actions with {} rather than returning TRUE, like
opt_with and from_in.
2002-06-17 20:38:04 +00:00
Bruce Momjian 42423c7195 Manually indent gram.y to be consistent. 2002-06-17 20:27:43 +00:00
Bruce Momjian 9e1c5fba03 Fix missing 'buf' variable in SSL sources and add missing includes. 2002-06-17 15:23:36 +00:00
Bruce Momjian 7005e4c076 Fix SSL DEBUG levels to match CVS elog flags. 2002-06-17 15:19:28 +00:00
Tom Lane 507ed0332a Repair AlterTableOwner --- was failing for relations with indexes. 2002-06-17 14:31:32 +00:00
Bruce Momjian e4cd7c315f Rename DEBUG to DEBUG1 in SSL code. 2002-06-17 07:33:25 +00:00
Bruce Momjian 10f05d8127 Merge ALTER GROUP ADD/DROP rules by creating add_drop action. 2002-06-17 07:00:27 +00:00
Bruce Momjian f91ee129a7 Simplify optional WITH handling in CREATE USER, ALTER USER, CREATE
GROUP.  Make WITH optional in CREATE DATABASE for consistency.
2002-06-17 05:40:32 +00:00
Bruce Momjian 0dbfea39f3 Remove KSQO from GUC and move file to _deadcode. 2002-06-16 00:09:12 +00:00
Tom Lane b50cbbd66b Fix up memory leakage created by recent changes. 2002-06-15 22:25:40 +00:00
Tom Lane c63bc32c2c Fix up gcc warnings, improve comments. 2002-06-15 21:52:31 +00:00
Bruce Momjian eb1ad5b4b5 Patch for current_schemas to optionally include implicit ...
Second cut attached. This one just adds a boolean option to the existing
function to indicate that implicit schemas are to be included (or not).
I remembered the docs as well this time :-)

Dave Page
2002-06-15 20:03:51 +00:00
Bruce Momjian 6e8a1a6717 WriteBuffer return value:
>I'd vote for changing WriteBuffer to
>return void, and have it elog() on bad argument.

Manfred Koizar
2002-06-15 19:59:59 +00:00
Bruce Momjian 918e864f14 Remove some pre-WAL relics:
SharedBufferChanged
  BufferRelidLastDirtied
  BufferTagLastDirtied
  BufferDirtiedByMe

Manfred Koizar
2002-06-15 19:55:38 +00:00
Bruce Momjian 3c35face41 This patch wraps all accesses to t_xmin, t_cmin, t_xmax, and t_cmax in
HeapTupleHeaderData in setter and getter macros called
HeapTupleHeaderGetXmin, HeapTupleHeaderSetXmin etc.

It also introduces a "virtual" field xvac by defining
HeapTupleHeaderGetXvac and HeapTupleHeaderSetXvac.  Xvac is used by
VACUUM, in fact it is stored in t_cmin.

Manfred Koizar
2002-06-15 19:54:24 +00:00
Bruce Momjian 6b9e742458 The macaddr datatype understands most formats of MAC address, except 12
hex digits with no separators, eg 00AABBCCDDEE. This is easily remedied
with the following patch (against 7.2.1):

Mike Wyer
2002-06-15 19:39:33 +00:00
Thomas G. Lockhart 133df7ce70 Add LOCALTIME and LOCALTIMESTAMP functions per SQL99 standard.
Remove ODBC-compatible empty parentheses from calls to SQL99 functions
 for which these parentheses do not match the standard.
Update the ODBC driver to ensure compatibility with the ODBC standard
 for these functions (e.g. CURRENT_TIMESTAMP, CURRENT_USER, etc).
Include a new appendix in the User's Guide which lists the labeled features
 for SQL99 (the labeled features replaced the "basic", "intermediate",
 and "advanced" categories from SQL92). features.sgml does not yet split
 this list into "supported" and "unsupported" lists.
2002-06-15 03:00:09 +00:00
Thomas G. Lockhart bad5fe9797 Search the existing regular expression cache as a ring buffer.
Will optimize the case for repeated calls for the same expression,
 which seems to be the most common case. Formerly, always searched
 from the first entry.
May want to look at the least-recently-used algorithm to make sure it
 is identifying the right slots to reclaim. Seems silly to do math when
 it seems that we could simply use an incrementing counter...
2002-06-15 02:49:47 +00:00
Bruce Momjian 63a354c4bb Make encryption of stored passwords the default, as discussed months ago. 2002-06-15 01:29:50 +00:00
Bruce Momjian 579eab9880 Remove pfrees of cached pg_pwd file, per Tom Lane. 2002-06-15 00:52:23 +00:00