Commit Graph

9957 Commits

Author SHA1 Message Date
Michael Meskes 2297f3982b Re-Committed old file. 2002-07-21 08:20:07 +00:00
Tom Lane b70b78656b Tweak CreateTrigger() so that the OID used in the name of an
RI_ConstraintTrigger is the same OID assigned to the pg_trigger row.
This reduces consumption of OIDs and may ease debugging.
2002-07-20 19:55:38 +00:00
Tom Lane c33a6343cd Code review for SHOW output changes; fix horology expected files for
new SHOW output format.
2002-07-20 15:12:56 +00:00
Michael Meskes a58930bbd5 Synced parser yet again.
Michael
2002-07-20 08:24:18 +00:00
Bruce Momjian d4803f5513 Fix regression tests for new SHOW output. 2002-07-20 06:32:53 +00:00
Bruce Momjian 63cfc6a8e8 Fix problems caused by code drift of API for without-oids. 2002-07-20 06:17:43 +00:00
Bruce Momjian b34cbe006f The attached patch fixes 2 trivial warnings generated by bison 1.35,
as a result of Peter's recent CREATE CAST changes.

Neil Conway
2002-07-20 05:58:34 +00:00
Bruce Momjian 1ac7db4468 I can't remember who said they were working on schema related psql
changes, but I kept finding myself wishing I could see what schema a
table or view exists in when I use \dt, \dv, etc. So, here is a patch
which does just that.

It sorts on "Schema" first, and "Name" second.

It also changes the test for system objects to key off the namespace
name starting with 'pg_' instead of the object name.

Sample output:

test=# create schema testschema;
CREATE SCHEMA
test=# create view testschema.ts_view as select 1;
CREATE VIEW
test=# \dv
                  List of relations
         Name        |   Schema   | Type |  Owner
--------------------+------------+------+----------
  __testpassbyval    | public     | view | postgres
  fooview            | public     | view | postgres
  master_pg_proc     | public     | view | postgres
  rmt_pg_proc        | public     | view | postgres
  vw_dblink_get_pkey | public     | view | postgres
  vw_dblink_replace  | public     | view | postgres
  ts_view            | testschema | view | postgres
(7 rows)

Joe Conway
2002-07-20 05:57:31 +00:00
Bruce Momjian 1ce03603cc > 2. This patch includes the same Table Function API fixes that I
>    submitted on July 9:
>
>    http://archives.postgresql.org/pgsql-patches/2002-07/msg00056.php
>
>    Please disregard that one *if* this one is applied. If this one is
>    rejected please go ahead with the July 9th patch.

The July 9th Table Function API patch mentioned above is now in CVS, so
here is an updated version of the guc patch which should apply cleanly
against CVS tip.

Joe Conway
2002-07-20 05:49:28 +00:00
Bruce Momjian b6d2faaf24 Hello, i noticed that win32 native stopped working/compiling after the SSL merge
.
So i took the opportunity to fix some stuff:

1. Made the thing compile (typos & needed definitions) with the new pqsecure_* s
tuff, and added fe-secure.c to the win32.mak makefile.
2. Fixed some MULTIBYTE compile errors (when building without MB support).
3. Made it do that you can build with debug info: "nmake -f win32.mak DEBUG=1".
4. Misc small compiler speedup changes.

The resulting .dll has been tested in production, and everything seems ok.
I CC:ed -hackers because i'm not sure about two things:

1. In libpq-int.h I typedef ssize_t as an int because Visual C (v6.0)
doesn't de fine ssize_t. Is that ok, or is there any standard about what
type should be use d for ssize_t?

2. To keep the .dll api consistent regarding MULTIBYTE I just return -1
in fe-connect.c:PQsetClientEncoding() instead of taking away the whole
function. I wonder if i should do any compares with the
conn->client_encoding and return 0 if not hing would have changed (if so
how do i check that?).

Regards

Magnus Naeslund
2002-07-20 05:43:31 +00:00
Bruce Momjian 1430271e99 Add new configure files for missing-oid patch. 2002-07-20 05:39:46 +00:00
Bruce Momjian dcbacde2e3 Patch problems caused by code drift since OID patch creation. 2002-07-20 05:37:45 +00:00
Bruce Momjian e36f9cd440 Manually apply part of oid patch that didn't apply cleanly. 2002-07-20 05:29:01 +00:00
Bruce Momjian b0f5086e41 oid is needed, it is added at the end of the struct (after the null
bitmap, if present).

Per Tom Lane's suggestion the information whether a tuple has an oid
or not is carried in the tuple descriptor.  For debugging reasons
tdhasoid is of type char, not bool.  There are predefined values for
WITHOID, WITHOUTOID and UNDEFOID.

This patch has been generated against a cvs snapshot from last week
and I don't expect it to apply cleanly to current sources.  While I
post it here for public review, I'm working on a new version against a
current snapshot.  (There's been heavy activity recently; hope to
catch up some day ...)

This is a long patch;  if it is too hard to swallow, I can provide it
in smaller pieces:

Part 1:  Accessor macros
Part 2:  tdhasoid in TupDesc
Part 3:  Regression test
Part 4:  Parameter withoid to heap_addheader
Part 5:  Eliminate t_oid from HeapTupleHeader

Part 2 is the most hairy part because of changes in the executor and
even in the parser;  the other parts are straightforward.

Up to part 4 the patched postmaster stays binary compatible to
databases created with an unpatched version.  Part 5 is small (100
lines) and finally breaks compatibility.

Manfred Koizar
2002-07-20 05:16:59 +00:00
Bruce Momjian 38dd3ae7d0 The attached patch fixes a build problem with GEQO when using the
PX recombination operator, changes some elog() messages from LOG
to DEBUG1, puts some debugging functions inside the appropriate
#ifdef (not enabled by default), and makes a few other minor
cleanups.

BTW, the elog() change is motivated by at least one user who
has sent a concerned email to -general asking exactly what the
"ERX recombination operator" is, and what it is doing to their
DBMS.

Neil Conway
2002-07-20 04:59:10 +00:00
Bruce Momjian aec814b548 Add new vacuum regression test files. 2002-07-20 04:58:14 +00:00
Bruce Momjian e77054e029 This patch fixes a regression caused by my recent changes to heap
tuple header.  The fix is based on the thought that HEAP_MOVED_IN is
not needed any more as soon as HEAP_XMIN_COMMITTED has been set.  So
in tqual.c and vacuum.c the HEAP_MOVED bits are cleared when
HEAP_XMIN_COMMITTED is set.

Vacuum robustness is enhanced by rearranging ifs, so that we have a
chance to elog(ERROR, ...) before an assertion fails.

A new regression test is included.

Manfred Koizar
2002-07-20 04:57:13 +00:00
Tom Lane 009d593c48 Small performance improvement --- use indexscan not heapscan to find
pg_statistic rows to delete while dropping a relation.
2002-07-19 22:21:17 +00:00
Bruce Momjian 33b3c95200 Complete TODO item:
* -Add BSD-licensed qsort() for Solaris
2002-07-19 17:35:11 +00:00
Bruce Momjian ec793794b2 Another "$@" cleanup with new syntax, ${1+"$@"}. 2002-07-19 15:31:43 +00:00
Bruce Momjian 1128c54a09 Fix "$@" to ${1:+"$@"} for older shells. 2002-07-19 13:50:06 +00:00
Tatsuo Ishii 86270024ff Oops. Too much ifdef out. 2002-07-19 11:09:25 +00:00
Tatsuo Ishii 248cbb5796 Temporary ifdef out migrating functions to avoid compiler warnings. 2002-07-19 00:22:24 +00:00
Bruce Momjian b75fcf9326 Complete TODO item:
* -HOLDER/HOLDERTAB rename to PROCLOCK/PROCLOCKTAG
2002-07-19 00:17:40 +00:00
Peter Eisentraut 97377048b4 pg_cast table, and standards-compliant CREATE/DROP CAST commands, plus
extension to create binary compatible casts.  Includes dependency tracking
as well.

pg_proc.proimplicit is now defunct, but will be removed in a separate
commit.

pg_dump provides a migration path from the previous scheme to declare
casts.  Dumping binary compatible casts is currently impossible, though.
2002-07-18 23:11:32 +00:00
Bruce Momjian 981d045e88 Complete TODO item:
* Merge LockMethodCtl and LockMethodTable into one shared structure (Bruce)
2002-07-18 23:06:20 +00:00
Peter Eisentraut 85d2a629c6 Create directory before installing files. 2002-07-18 22:58:08 +00:00
Bruce Momjian 776fc8cc5c New depend code doesn't need sequence drop. 2002-07-18 22:31:44 +00:00
Tom Lane 2aa6a5de87 Sic transit src/utils. 2002-07-18 22:15:10 +00:00
Bruce Momjian 7d78bac108 Back out BETWEEN node patch, was causing initdb failure. 2002-07-18 17:14:20 +00:00
Bruce Momjian a938f32a5a New depend code auto-drops sequence, fix copy2.out. 2002-07-18 17:11:49 +00:00
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
Tatsuo Ishii 55fa0e6d2a Fix typo (PG_UNICODE -> PG_UTF8) 2002-07-18 05:07:30 +00:00
Bruce Momjian a9f6c5b5c7 Unique and primary key constraints are both dumped using ALTER TABLE
statements.  Unique indexes with CREATE INDEX.

Basically, pg_constraint left outer'd to pg_index.

Rod Taylor
2002-07-18 04:50:51 +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 8f211f8a84 Fix for PgTransaction class to make these visible to C apps:
ExecStatusType BeginTransaction();
   ExecStatusType EndTransaction();

Piotr Klaban
2002-07-18 04:49:30 +00:00
Bruce Momjian 8c26bc5364 The attached patch fixes a tiny memory leak in psql, when using
the 'expanded' output mode (\x).

Neil Conway
2002-07-18 04:46:24 +00:00
Bruce Momjian 2c48b3db95 here are the copy2.sql and copy2.out files for the new regression
tests

Brent Verner
2002-07-18 04:45:51 +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 fc5372e099 You made a tiny little type in a comment in parsenodes.h (abotu instead
of about).

Christopher Kings-Lynne
2002-07-18 04:42:29 +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 7c5c1a2adb Add comment to file about port files. 2002-07-18 04:30:36 +00:00
Tatsuo Ishii 3d7a9ac769 Fix breakage for pltcl modules. pg_get_enconv_by_encoding() has been
changed since CREATE CONVERSION supported.
2002-07-18 04:16:07 +00:00
Bruce Momjian 404e9a12a5 Move libc replacement files from src/backend/port to src/port. 2002-07-18 04:13:59 +00:00
Bruce Momjian 7f43165dd2 Make src/backend/port/*.c file location dependent only on configure.in. 2002-07-18 03:59:49 +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
Barry Lind cdebcad6af fixed bug in support for timestamp without time zone reported by Yuva Chandolu (ychandolu@ebates.com) 2002-07-16 21:05:17 +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
Tom Lane 14f1588356 Add initdb code to set up initial contents of pg_depend, pinning all
objects created during initdb (except for the system views, which I
think do not need to be pinned).
2002-07-16 17:48:46 +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 b00e50fbb8 Remove indenting of Makefile comments, per Peter.\ 2002-07-15 23:32:28 +00:00
Bruce Momjian 4ea0275f18 Remove utils/getopt.c file, not needed, it only allowed "--flag"
warnings, and we now look for getopt_long in libgetopt.a.
2002-07-15 22:48:54 +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 3c580b8d97 Fix make_ctags for exhuberant tags. 2002-07-15 14:45:51 +00:00
Hiroshi Inoue 5fad748eb8 Fix a bug about the handling of '.' in parse.c. 2002-07-15 02:56:39 +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
Bruce Momjian 91dfa1af97 Fix \? and \pset pager handling. \? wasn't honoring pager before. 2002-07-15 01:56:25 +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
Dave Cramer 791a40f943 Changed getCrossReference to return information about each composite key seperately
It used to return them as a,b in one row, and now returns
a in one row, and b in one row
2002-07-12 13:07:48 +00:00
Hiroshi Inoue b82b2db7c1 An improvement of User Interface(Setup dialog) by Dave Page. 2002-07-12 02:02:26 +00:00
Hiroshi Inoue 59e5d516aa 1) Fix a memory leak in use declare/fetch mode.
2) Change default build mode to multibyte(Windows).
2002-07-12 01:41:25 +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 3a0136c7d2 Fix getopt flags. Man thing thing was messed up. 2002-07-11 02:00:14 +00:00
Bruce Momjian 9c6c0ceb97 Fix another --help typo in pg_restore. 2002-07-11 01:57:12 +00:00
Hiroshi Inoue 263db2e586 Make NAMEDATALEN changeable at compile time. 2002-07-11 01:52:46 +00:00
Barry Lind d676e29d41 fix bug in getTime() with fractional seconds reported by Laurette Cisneros (laurette@nextbus.com) 2002-07-10 00:51:36 +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 2dc53d863c Fix case syntax for freebsd template. 2002-07-08 01:54:30 +00:00
Bruce Momjian 20e83274bb Fix typo in xl_heaptid comment
Manfred Koizar
2002-07-08 01:52:23 +00:00
Bruce Momjian 4f4753832e Move CXX platform-specific stuff into template files. 2002-07-07 20:28:25 +00:00
Bruce Momjian 712f69ece8 Convert expr to case, for Peter E. 2002-07-07 14:24:13 +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 5af6e0a4ac Add comments about sharing. 2002-07-06 20:14:58 +00:00
Bruce Momjian 7015111a19 Move simple_prompt() into its own file to be shared with psql and pg_dump. 2002-07-06 20:12:30 +00:00
Barry Lind f170e61d9b fixed bug reported by Michael, Dietrich (mdt@emdete.de) where a large object handle was being used after the end of the transaction and thus resulting in an error. 2002-07-05 18:50:27 +00:00
Hiroshi Inoue 8831c35a19 Fix a bug reported by Zhou Han. 2002-07-05 01:31:41 +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
Bruce Momjian d59478c4f3 More clearly document in pg_dump when we are dealing with an object name
as it appears in the schema dump, and index tags.
2002-07-04 15:35:07 +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 3722dee6d9 Document function args are required for pg_restore -P.
Fix pg_dump to not quote the function name in the storage tag.
Fix pg_dump so GRANT/REVOKE(ACL) tag entries are not quoted, for
	consistency.
Fix pg_restore to properly handle quotes and some spaces in -P.
2002-07-04 03:04:55 +00:00
Bruce Momjian d656c249b3 Update FreeBSD template to properly compile c++ on alpha. 2002-07-03 19:48:26 +00:00
Bruce Momjian 3138aac971 Add missing pgaccess copyright file, same as ours. 2002-07-03 16:57:08 +00:00
Tom Lane 08a46ad4f6 Fix some more boundary-case errors in psql variable substitution:
wasn't really right for case where :var is at the end of the line,
was definitely not right if var expanded to empty in that case,
and failed to recalculate thislen before jumping back to rescan.
2002-07-03 16:47:46 +00:00
Bruce Momjian bc3d2e1e35 Allow make_ctags to work with exuberant tags. 2002-07-02 17:45:52 +00:00
Bruce Momjian a4485ea894 Indent libpq++ as mentioned in email. Format was terrible, and this
will make fixing things easier.
2002-07-02 16:32:19 +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 22347d69c9 Update to pgaccess 0.91. 2002-07-02 06:11:23 +00:00
Bruce Momjian f4590995c9 The attached patch fixes 2 memory leaks in pg_dump, as well as corrects
a spelling mistake and deletes an antiquated comment.

Neil Conway
2002-07-02 05:49:52 +00:00
Bruce Momjian 43b0f2e28a The attached patch fixes a minor memory leak in psql.
Neil Conway
2002-07-02 05:49:18 +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
Bruce Momjian 866103989d Back out regress/results changes. Real CVS problem worked-around. 2002-07-02 05:43:34 +00:00
Bruce Momjian a2e7c3d34e Fix removal of results directory on 'make clean'. Just remove *.out
files.  Was causing CVS problems.
2002-07-02 04:53:52 +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
Michael Meskes a3ec44a5d3 Commit old versions into main branch again.
Michael
2002-07-01 06:56:10 +00:00
Michael Meskes 9786223480 Committing parser changes. Note, however, that the development bison seems ot have a problem on my home machine. So these go in untested for the time being. But at least I have them in the archive.
Michael
2002-06-30 09:34:14 +00:00
Hiroshi Inoue c9f8704251 1) prevent setting of KSQO on 7.3+ servers(Thanks to Dave Page).
2) Allow LF->CR/LF conversion under UNICODE driver.
2002-06-28 02:44:15 +00:00
Barry Lind 23e5da8a48 fixed build.xml to echo correct jdbc version under ant1.6 2002-06-27 04:38:01 +00:00
Barry Lind ca4ca0b098 general cleanup of jdbc code 2002-06-27 03:37:30 +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
Barry Lind e37cce05b7 translation patch submitted by Zhenbang Wei forth@mail.net.tw 2002-06-26 03:21:27 +00:00
Barry Lind 895a45ae3d patch submitted by Jason Davies jason@netspade.com to provide proper java class name for a byte[] 2002-06-26 03:16:57 +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
Dave Cramer 393b085a72 fixed retrieval of foreign/primary keys in imported/exported keys 2002-06-25 16:30:49 +00:00
Hiroshi Inoue 20241a4c54 1) Add support for GB18030.
2) Fix a bug about the handling of large objects.
2002-06-25 01:54:19 +00:00
Tom Lane 6918df16a5 plpgsql's PERFORM statement now sets FOUND depending on whether any
rows were returned by the performed query.  Per recent pgsql-general
discussion.
2002-06-24 23:12:06 +00:00
Barry Lind 12a28d12bb patch to add support for callable statements to the jdbc driver. The patch was submitted by Paul Bethe pmbethe@yahoo.com 2002-06-24 06:16:27 +00:00
Barry Lind 33086553c0 patch to update zh_TW message file for jdbc submitted by Zhenband Wei (forth@mail.net.tw) 2002-06-24 05:14:26 +00:00
Barry Lind 99aa2f8ef9 patch submitted by Jason Davies jason@netspade.com to improve ResultSetMetaData.getColumnClassName() support 2002-06-24 05:09:29 +00:00
Barry Lind c50bf0190f fixed bug reported by Wolfgang Winter w.winter@logitags.com where historic timestamps which do not have timezone info were being interpreted in local timezone instead of GMT. Also added a check to support timestamp vs. timestamptz in this code 2002-06-24 04:53:05 +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
Bruce Momjian aad4cc7d0d Remove unused INET6 variable. 2002-06-23 20:30:48 +00:00
Bruce Momjian eb3901ec0d Remove INET6 from SSL. We don't support INET6 yet. 2002-06-23 14:56:16 +00:00
Bruce Momjian a8a1f15877 uint -> uint32, portability. 2002-06-22 04:08:07 +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 7191652005 Add another missing SRF file. 2002-06-20 20:39:04 +00:00
Bruce Momjian 27bce57766 Add missing SRF file. 2002-06-20 20:37:00 +00:00
Bruce Momjian 95712b15b1 Add missing regression files for SRF. 2002-06-20 20:35:56 +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 bffc4b6da1 Attached is a regression test patch for SRFs. I based it on the test
scripts that I have been using, minus the C function tests and without
calls to random() -- figured random() wouldn't work too well for a
regression test ;-)

Joe Conway
2002-06-20 17:09:42 +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
Tom Lane 5fa77c2570 CacheMemoryContext should be DLLIMPORT. 2002-06-19 13:46:09 +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 134a1c8178 Use KAME accessor macros for addr8. 2002-06-17 15:55:09 +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
Bruce Momjian 0bb61f4af8 Back out accidental COPY data changes. 2002-06-17 15:01:45 +00:00
Tom Lane 507ed0332a Repair AlterTableOwner --- was failing for relations with indexes. 2002-06-17 14:31:32 +00:00
Michael Meskes 2fabb99388 Fixed parser bug concerning octal numbers in single quotes. 2002-06-17 13:23:27 +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
Dave Cramer 0daee96ed1 implemented refresh row 2002-06-16 18:26:53 +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 32fecad80a Clean up gcc warnings. Avoid the bad habit of putting externs in .c
files rather than a header file where they belong.  Pay some modicum
of attention to picking global routine names that aren't likely to
conflict with surrounding applications.
2002-06-15 22:06:09 +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 79ff2e96de PATCH SSL_pending() checks in libpq/fe-misc.c:
I am no longer pursuing a total non-blocking implementation.  I haven't
found a good way to test it with the type of work that I do with
PostgreSQL.  I do use blocking SSL sockets with this mod and have had no
problem whatsoever.  The bug that I fixed in this patch is exceptionally
hard to reproduce reliably.

Jack Bates
2002-06-15 20:01:31 +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 dbbd13bdb5 Fix for TAB completion using GRANT DELETE in psql.
Oliver Elphick
2002-06-15 19:43:47 +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
Bruce Momjian cd7be4d947 Noted with versions 7.0.3, 7.1.3, and 7.2.1:
The psql interpreter becomes unstable if variable substitutions
are used.  The debugger GDB was unable to help however mpatrol
reports that the sprintf at mainloop.c:389 is steping one byte
farther than the allocation.

William K. Volkman
2002-06-15 19:37:48 +00:00
Bruce Momjian 240de617fb The method PgLargeObject::LOid() is missing an implementation in the .cc
file.


The program seems to compile ok, but when linking a program that uses
the call,
g++ chokes with an undefined reference error.


If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------
I include the code:

Oid PgLargeObject::LOid(){
  return pgObject;
}

in the .cc file.

Chris Traylor
2002-06-15 19:30:40 +00:00
Bruce Momjian d54ae2aff2 Add C++ indent tool. 2002-06-15 19:13:04 +00:00
Bruce Momjian 2e58024066 This patch fixes a few minor problems with libpq++: remove the deprecated
PQExec(" ") in the wrapper around PQnotifies(), fix the Makefile for
the examples so that they will actually compile properly (with the
exception of #5, which depends on internal headers), make a minor change
to libpq++.h so that "make examples" now works on my machine, update
some documentation, fix some grammatical problems, and remove some of
the more hideous comments.

Neil Conway
2002-06-15 18:49:29 +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
Dave Cramer fd8b153912 added empty result set testing 2002-06-14 14:01:36 +00:00
Dave Cramer 6e2fab0a41 added empty result set testing 2002-06-14 10:56:13 +00:00
Bruce Momjian 1ed4a922b8 Yet another SSL patch. :-) This one adds some informational messages
on the server, if DebugLvl >= 2.

The patch also includes a late addition to the last patch
(X509_check_private_key()).  I'm not sure why it the currect
revision wasn't tagged.


Bear Giles
2002-06-14 04:38:04 +00:00
Bruce Momjian eb7afc1407 SSL patch that adds support for optional client certificates.
If the user has certificates in $HOME/.postgresql/postgresql.crt
and $HOME/.postgresql/postgresql.key exist, they are provided
to the server.  The certificate used to sign this cert must be
known to the server, in $DataDir/root.crt.  If successful, the
cert's "common name" is logged.

Client certs are not used for authentication, but they could be
via the port->peer (X509 *), port->peer_dn (char *) or
port->peer_cn (char *) fields.  Or any other function could be
used, e.g., many sites like the issuer + serial number hash.

Bear Giles
2002-06-14 04:36:58 +00:00
Bruce Momjian b8b6691e52 Patch that checks ownership and permissions on server static
private key.  (You want it to be a regular file owned by the
database process, with 0400 or 0600 permissions.)

Bear Giles
2002-06-14 04:35:02 +00:00
Bruce Momjian 8f44024639 SSL patch to periodically renegotiate session key.
In order to reduce the risk of cryptanalysis during extended
sessions (or brief ones involving a substantial amount of data),
this patch renegotiates the session key after 64kib has been
transferred.

Bear Giles
2002-06-14 04:33:53 +00:00
Bruce Momjian 55d053233c SSL support for ephemeral DH keys.
As the comment headers in be-secure.c discusses, EPH preserves
confidentiality even if the static private key (which is usually
kept unencrypted) is compromised.

Because of the value of this, common default values are hard-coded
to protect the confidentiality of the data even if an attacker
successfully deletes or modifies the external file.

Bear Giles
2002-06-14 04:31:49 +00:00
Bruce Momjian 19570420f5 UPDATED PATCH:
Attached are a revised set of SSL patches.  Many of these patches
are motivated by security concerns, it's not just bug fixes.  The key
differences (from stock 7.2.1) are:

*) almost all code that directly uses the OpenSSL library is in two
   new files,

     src/interfaces/libpq/fe-ssl.c
     src/backend/postmaster/be-ssl.c

   in the long run, it would be nice to merge these two files.

*) the legacy code to read and write network data have been
   encapsulated into read_SSL() and write_SSL().  These functions
   should probably be renamed - they handle both SSL and non-SSL
   cases.

   the remaining code should eliminate the problems identified
   earlier, albeit not very cleanly.

*) both front- and back-ends will send a SSL shutdown via the
   new close_SSL() function.  This is necessary for sessions to
   work properly.

   (Sessions are not yet fully supported, but by cleanly closing
   the SSL connection instead of just sending a TCP FIN packet
   other SSL tools will be much happier.)

*) The client certificate and key are now expected in a subdirectory
   of the user's home directory.  Specifically,

	- the directory .postgresql must be owned by the user, and
	  allow no access by 'group' or 'other.'

	- the file .postgresql/postgresql.crt must be a regular file
	  owned by the user.

	- the file .postgresql/postgresql.key must be a regular file
	  owned by the user, and allow no access by 'group' or 'other'.

   At the current time encrypted private keys are not supported.
   There should also be a way to support multiple client certs/keys.

*) the front-end performs minimal validation of the back-end cert.
   Self-signed certs are permitted, but the common name *must*
   match the hostname used by the front-end.  (The cert itself
   should always use a fully qualified domain name (FDQN) in its
   common name field.)

   This means that

	  psql -h eris db

   will fail, but

	  psql -h eris.example.com db

   will succeed.  At the current time this must be an exact match;
   future patches may support any FQDN that resolves to the address
   returned by getpeername(2).

   Another common "problem" is expiring certs.  For now, it may be
   a good idea to use a very-long-lived self-signed cert.

   As a compile-time option, the front-end can specify a file
   containing valid root certificates, but it is not yet required.

*) the back-end performs minimal validation of the client cert.
   It allows self-signed certs.  It checks for expiration.  It
   supports a compile-time option specifying a file containing
   valid root certificates.

*) both front- and back-ends default to TLSv1, not SSLv3/SSLv2.

*) both front- and back-ends support DSA keys.  DSA keys are
   moderately more expensive on startup, but many people consider
   them preferable than RSA keys.  (E.g., SSH2 prefers DSA keys.)

*) if /dev/urandom exists, both client and server will read 16k
   of randomization data from it.

*) the server can read empheral DH parameters from the files

     $DataDir/dh512.pem
     $DataDir/dh1024.pem
     $DataDir/dh2048.pem
     $DataDir/dh4096.pem

   if none are provided, the server will default to hardcoded
   parameter files provided by the OpenSSL project.

Remaining tasks:

*) the select() clauses need to be revisited - the SSL abstraction
   layer may need to absorb more of the current code to avoid rare
   deadlock conditions.  This also touches on a true solution to
   the pg_eof() problem.

*) the SIGPIPE signal handler may need to be revisited.

*) support encrypted private keys.

*) sessions are not yet fully supported.  (SSL sessions can span
   multiple "connections," and allow the client and server to avoid
   costly renegotiations.)

*) makecert - a script that creates back-end certs.

*) pgkeygen - a tool that creates front-end certs.

*) the whole protocol issue, SASL, etc.

 *) certs are fully validated - valid root certs must be available.
    This is a hassle, but it means that you *can* trust the identity
    of the server.

 *) the client library can handle hardcoded root certificates, to
    avoid the need to copy these files.

 *) host name of server cert must resolve to IP address, or be a
    recognized alias.  This is more liberal than the previous
    iteration.

 *) the number of bytes transferred is tracked, and the session
    key is periodically renegotiated.

 *) basic cert generation scripts (mkcert.sh, pgkeygen.sh).  The
    configuration files have reasonable defaults for each type
    of use.

Bear Giles
2002-06-14 04:23:17 +00:00
Bruce Momjian eb43af3210 Back out SSL changes. Newer patch available. 2002-06-14 04:09:37 +00:00
Bruce Momjian a9bd17616e Attached are a revised set of SSL patches. Many of these patches
are motivated by security concerns, it's not just bug fixes.  The key
differences (from stock 7.2.1) are:

*) almost all code that directly uses the OpenSSL library is in two
   new files,

     src/interfaces/libpq/fe-ssl.c
     src/backend/postmaster/be-ssl.c

   in the long run, it would be nice to merge these two files.

*) the legacy code to read and write network data have been
   encapsulated into read_SSL() and write_SSL().  These functions
   should probably be renamed - they handle both SSL and non-SSL
   cases.

   the remaining code should eliminate the problems identified
   earlier, albeit not very cleanly.

*) both front- and back-ends will send a SSL shutdown via the
   new close_SSL() function.  This is necessary for sessions to
   work properly.

   (Sessions are not yet fully supported, but by cleanly closing
   the SSL connection instead of just sending a TCP FIN packet
   other SSL tools will be much happier.)

*) The client certificate and key are now expected in a subdirectory
   of the user's home directory.  Specifically,

	- the directory .postgresql must be owned by the user, and
	  allow no access by 'group' or 'other.'

	- the file .postgresql/postgresql.crt must be a regular file
	  owned by the user.

	- the file .postgresql/postgresql.key must be a regular file
	  owned by the user, and allow no access by 'group' or 'other'.

   At the current time encrypted private keys are not supported.
   There should also be a way to support multiple client certs/keys.

*) the front-end performs minimal validation of the back-end cert.
   Self-signed certs are permitted, but the common name *must*
   match the hostname used by the front-end.  (The cert itself
   should always use a fully qualified domain name (FDQN) in its
   common name field.)

   This means that

	  psql -h eris db

   will fail, but

	  psql -h eris.example.com db

   will succeed.  At the current time this must be an exact match;
   future patches may support any FQDN that resolves to the address
   returned by getpeername(2).

   Another common "problem" is expiring certs.  For now, it may be
   a good idea to use a very-long-lived self-signed cert.

   As a compile-time option, the front-end can specify a file
   containing valid root certificates, but it is not yet required.

*) the back-end performs minimal validation of the client cert.
   It allows self-signed certs.  It checks for expiration.  It
   supports a compile-time option specifying a file containing
   valid root certificates.

*) both front- and back-ends default to TLSv1, not SSLv3/SSLv2.

*) both front- and back-ends support DSA keys.  DSA keys are
   moderately more expensive on startup, but many people consider
   them preferable than RSA keys.  (E.g., SSH2 prefers DSA keys.)

*) if /dev/urandom exists, both client and server will read 16k
   of randomization data from it.

*) the server can read empheral DH parameters from the files

     $DataDir/dh512.pem
     $DataDir/dh1024.pem
     $DataDir/dh2048.pem
     $DataDir/dh4096.pem

   if none are provided, the server will default to hardcoded
   parameter files provided by the OpenSSL project.

Remaining tasks:

*) the select() clauses need to be revisited - the SSL abstraction
   layer may need to absorb more of the current code to avoid rare
   deadlock conditions.  This also touches on a true solution to
   the pg_eof() problem.

*) the SIGPIPE signal handler may need to be revisited.

*) support encrypted private keys.

*) sessions are not yet fully supported.  (SSL sessions can span
   multiple "connections," and allow the client and server to avoid
   costly renegotiations.)

*) makecert - a script that creates back-end certs.

*) pgkeygen - a tool that creates front-end certs.

*) the whole protocol issue, SASL, etc.

 *) certs are fully validated - valid root certs must be available.
    This is a hassle, but it means that you *can* trust the identity
    of the server.

 *) the client library can handle hardcoded root certificates, to
    avoid the need to copy these files.

 *) host name of server cert must resolve to IP address, or be a
    recognized alias.  This is more liberal than the previous
    iteration.

 *) the number of bytes transferred is tracked, and the session
    key is periodically renegotiated.

 *) basic cert generation scripts (mkcert.sh, pgkeygen.sh).  The
    configuration files have reasonable defaults for each type
    of use.

Bear Giles
2002-06-14 03:56:47 +00:00
Tatsuo Ishii 15378a53f8 Add support for GB18030 2002-06-14 03:30:56 +00:00
Tom Lane b1313e3474 Suppress 'owner of datatype appears to be invalid' warning message for
undefined (shell) types.
2002-06-13 20:02:31 +00:00
Bruce Momjian c66eb00adc Allow ANALYZE to run in a transaction. 2002-06-13 19:52:02 +00:00
Tom Lane f67a931aa4 Make WHERE conditions pulled up from subqueries be executed before outer
WHERE conditions, if there is no reason to do it differently.
2002-06-13 15:10:25 +00:00
Dave Cramer b1ac89f594 removed personal test parameters 2002-06-13 14:37:30 +00:00
Thomas G. Lockhart bbc9b759d6 Add PLACING to the list of reserved keywords. Added as a token in the last
update to support the new OVERLAY() function.
2002-06-13 14:16:43 +00:00
Dave Cramer 5598cbf641 Added test for newly implemented updateable result sets 2002-06-13 14:06:11 +00:00
Dave Cramer 603c46d8ce changes to accomodate updateable resultset mostly just call setSqlQuery on execute 2002-06-13 14:02:50 +00:00
Dave Cramer 7873bed77c Implemented updateable result sets based on raghu nidagal implementation 2002-06-13 13:52:16 +00:00