Commit Graph

982 Commits

Author SHA1 Message Date
Vadim B. Mikheev 0346ab7175 Lexicographically compare 'char' and 'text'. 1997-06-11 05:18:02 +00:00
Vadim B. Mikheev dee872de5c geqo_rel_paths(): compute_joinrel_size() shouldn't be called
for non-JoinPath path! So now we have:
    if ( IsA_JoinPath (cheapest) )
        rel->size = compute_joinrel_size(cheapest);
1997-06-11 02:44:12 +00:00
Marc G. Fournier 90d0cf0000 From: Robert Bruccoleri <bruc@bms.com>
Subject: [PORTS] Patches for Irix 6.4

I have worked out how to compile PostgreSQL on Irix 6.4 using the -n32 compiler
mode and version 7.1 of the C compiler. (The n32 compiler use 32 bits
addressing,
but allows access to all the instructions in the MIPS4 instruction set.)
There were several problems:

1) The ld command is not referenced as a macro in all the Makefiles. On
this platform, you have to include -n32 on all the ld commands. Makefiles
were changed as needed.

3) Lots of warnings are generated from the compiler. Since the regression
tests worked OK, I didn't attempt to fix them. If anyone wants the compilation
log, please let me know, and I'll email it to you.

The version of postgresql was 970602. Here is Makefile.custom:

CUSTOM_COPT = -O2 -n32
MK_NO_LORDER = 1
LD = ld -n32
CC += -n32
1997-06-11 01:13:10 +00:00
Marc G. Fournier 4ea3844680 From: "Brian E. Gallew" <geek+@cmu.edu>
Subject: Re: [PORTS] Re: [PATCHES] DG/UX 5.4R11 patches

Comments in boot.sed break DG/UX port
1997-06-11 01:05:48 +00:00
Bruce Momjian fb5be867ef LO patches for loimport/loexport from Raymond Toy 1997-06-10 13:01:32 +00:00
Vadim B. Mikheev f4161503e6 if ( rel->size <= 0 )
rel->size = compute_rel_size(rel);
1997-06-10 07:55:47 +00:00
Vadim B. Mikheev cbb4213af4 if ( new_rel->size <= 0 )
new_rel->size = compute_rel_size(new_rel);
1997-06-10 07:53:55 +00:00
Vadim B. Mikheev 71b3e93c50 Duplicates handling... 1997-06-10 07:28:50 +00:00
Bruce Momjian 858f35510e Cleanup on xinv# table names. 1997-06-07 17:34:35 +00:00
Bruce Momjian 51b03770d7 avoid xinv* table name conflict with large objects. 1997-06-07 05:19:06 +00:00
Marc G. Fournier e318022e1a From: "D'Arcy J.M. Cain" <darcy@druid.net>
Subject: [PATCHES] backend/storage/ipc/shmem.c

  - strname is only used if assert checking is on
1997-06-06 22:04:04 +00:00
Marc G. Fournier 0f94738c33 From: "D'Arcy J.M. Cain" <darcy@druid.net>
Subject: [PATCHES] backend/lib/fstack.c

  - The FixedStackIsValid so obviously needs to be a macro
  - FixedStackContains only called if assert checking on
1997-06-06 22:02:37 +00:00
Bruce Momjian a089cdd9d3 lowercase large object table name fix. 1997-06-06 03:41:16 +00:00
Vadim B. Mikheev e3d2f1f35d gimme_tree(): got rid of compute_rel_size() -
compute_joinrel_size already called by geqo_rel_paths.
1997-06-06 03:18:02 +00:00
Vadim B. Mikheev c8a38d5d97 Added check is new item successfuly inserted to a page or not. 1997-06-06 03:11:46 +00:00
Marc G. Fournier 15da18508f From: Phil Nelson <phil@cs.wwu.edu>
Subject: [PATCHES] Added support for NetBSD/pc532.
1997-06-06 01:37:23 +00:00
Marc G. Fournier c0178f27a2 From: "D'Arcy J.M. Cain" <darcy@druid.net>
Subject: [HACKERS] src.original/./backend/lib/fstack.c

Another change I suggested.  I bracket an unused function and add a
return to quiet the compiler.  In addition I added an internal
consistency check.
1997-06-06 00:38:17 +00:00
Marc G. Fournier f50b103ce1 From: "D'Arcy J.M. Cain" <darcy@druid.net>
Subject: [HACKERS] backend/optimizer/geqo/geqo_erx.c

I sent these changes in with a bunch of others.  Some were folded in but
others, like these, were not.  I am not sure why so I am resending this
to the developers list by itself for discussion.

The readon why I suggest these changes is that the compiler can't tell
that minimum_count is initialized before it is used.  The tests that I
add in here will cause an immediate error if it doesn't.  As the comments
below suggest, if it is 100% guaranteed that the variable will always
be initialized then how this is so should be commented here.  I don't
know how much strain the actual test puts on the performance but if it
isn't too much then maybe leave it in for absolute safety anyway.

There are also a few returns just to stop warnings.
1997-06-06 00:37:23 +00:00
Bruce Momjian a668b7ac2d Fix for large objects and case sensitivity, from Raymond Toy. 1997-06-05 22:59:45 +00:00
Vadim B. Mikheev 11073bee5c allpaths.c:find_join_paths(): compute_rel_size() shouldn't be called
for join-relations. Sizes already computed by
prune_rel_paths():compute_joinrel_size().

joinrels.c:
<                   if ( _use_right_sided_plans_ )
---
>                   if ( _use_right_sided_plans_ &&
>                               length (outer_rel->relids) > 1 )

 - r_plans are useful when outer_rel is join-relation... It
decreases the size of search space...
1997-06-05 09:33:52 +00:00
Vadim B. Mikheev 9c6cdb4d7b heap_destroy() now calls RelationForgetRelation() to really flush
the relation from the relcache.
1997-06-04 08:59:22 +00:00
Vadim B. Mikheev ded4650642 New func RelationForgetRelation();
*         RelationFlushRelation + if the relation is local then get rid of
 *         the relation descriptor from the newly created relation list.
1997-06-04 08:56:51 +00:00
Thomas G. Lockhart 06ea3c9a24 Add upgradepath(), isoldpath(), upgradepoly() and revertpoly() to allow
migration from pre-v6.1 geometric data types.
Only allow new input syntax for paths and polygons.
1997-06-03 14:01:22 +00:00
Thomas G. Lockhart fe74581fa0 Use finite() macro if available to check returns from pow() and exp(). 1997-06-03 13:58:06 +00:00
Thomas G. Lockhart 93ac35f06c Fix a few DATEDEBUG print statements. 1997-06-03 13:56:32 +00:00
Vadim B. Mikheev fa940fda67 cc1: warnings being treated as errors
dt.c: In function `timespan2tm':
dt.c:1722: warning: unused variable `funit'
dt.c:1722: warning: unused variable `iunit'

-> got rid of them.
1997-06-03 06:32:56 +00:00
Vadim B. Mikheev b46e5b5281 SET geqo TO 'on' restores _use_geqo_rels_ to GEQO_RELS, not
to last specified with 'on' #.
What is better ?
1997-06-03 06:29:31 +00:00
Vadim B. Mikheev f1cf69c080 cc1: warnings being treated as errors
remove.c: In function `RemoveAggregate':
remove.c:413: warning: unused variable `typename'

-> got rid of it.
1997-06-03 06:23:24 +00:00
Vadim B. Mikheev 2f8c2e997b Fix deleted tuples re-incarnation possible when vacuum transaction
start time equal to tuple->t_tmax.

Privent shrinking if there are tuples modifyed by running transactions
(it concerns system relations only, currently).
1997-06-03 01:29:26 +00:00
Vadim B. Mikheev 5b5c83f9e7 Oracle like currval behaviour. 1997-06-02 11:22:52 +00:00
Vadim B. Mikheev 05404562fb Use GEQO if _use_geqo_ is TRUE and # of relations is >= _use_geqo_rels_
(both are settable via SET geqo TO ...).
1997-06-02 11:14:40 +00:00
Vadim B. Mikheev cda886fd06 SET var TO 'a=b'
^^ is supported by get_token now.
(SET geqo TO 'on=XXX' works now).
1997-06-02 11:00:57 +00:00
Bruce Momjian afb089d4a4 Put back old lines. 1997-06-01 04:16:16 +00:00
Bruce Momjian 93b03649d4 Cleanup for AIX from Darren. 1997-06-01 03:39:28 +00:00
Bruce Momjian 8bc7439ccf Enable GEQO for more than six tables, from Martin. 1997-06-01 02:56:00 +00:00
Bruce Momjian c3a960ad8a Fix for SELECT * INTO TABLE for char(), varchar() fields. 1997-05-31 16:52:19 +00:00
Vadim B. Mikheev ad01dd270d If there is no table in RangeTable for colname then
elog (WARN, "attribute %s not found", colname);
1997-05-31 07:10:25 +00:00
Vadim B. Mikheev 139858e699 If we have to split leaf page in the chain of duplicates
then we try to look at our right sibling first, but not farther,
as it was in yesterday fix.
1997-05-31 06:35:56 +00:00
Vadim B. Mikheev 3f5834fb8c Fix duplicates handling. 1997-05-30 18:35:40 +00:00
Thomas G. Lockhart 43b6f1e678 Clean up support for USE_POSIX_TIME, ! HAVE_INT_TIMEZONE machines.
Remove references to modf() which is buggy on some platforms (Sparc/Linux).
1997-05-30 15:02:51 +00:00
Marc G. Fournier cf88367751 From: David Friend <dfriend@atlsci.atlsci.com>
Subject: [PATCHES] pqcomprim.c patch

This is the patch by Robert Bruccoleri to fix the endian problem.
(Actually, it's the reverse of his patch.  He must have gotten the
order wrong.)
1997-05-26 00:26:56 +00:00
Marc G. Fournier ca746f512d -m <arg> -M weren't setup properly in getopts()...
These are undocumented in the man pages though...should they be removed?

Reported by: "A. Duursma" <it@portsite.nl>
1997-05-25 15:37:15 +00:00
Thomas G. Lockhart ac534bee01 Clean up redundant tests for valid pointers in geometric types.
Fix up decoder field masks for timespan and reltime.
1997-05-23 05:24:53 +00:00
Vadim B. Mikheev d865228807 AllocateFile():
fdleft = pg_nofile() - allocatedFiles - nfile;
looks more realistic, but too noisy -
   fdleft = pg_nofile() - allocatedFiles;
restored.
1997-05-23 02:56:48 +00:00
Vadim B. Mikheev c9be1bccc1 RelationPurgeLocalRelation():
/*
             * RelationFlushRelation () below will flush relation information
             * from the cache. We must call smgrclose to flush relation
             * information from SMGR & FMGR, too. We assume that for temp
             * relations smgrunlink is already called by heap_destroyr
             * and we skip smgrclose for them.          - vadim 05/22/97
             */
            smgrclose(reln->rd_rel->relsmgr, reln);

 - it avoids memory leaks in SMGR & VFD.

RelationFlushRelation():
   there is no more call FileInvalidate(RelationGetSystemPort(relation));
   - invalid (FileInvalidate() expects File, not SMGR' fd)
   - unuseful anyway.
1997-05-22 17:24:20 +00:00
Vadim B. Mikheev 19269069dc 1. Fix md memory leak:
mdunlink() and mdclose() (too !!!) now free MdfdVec for relation
   and add it to free list, so it may be re-used for another relation
   later.
2. Fix VFD-manager memory leak (found by Massimo ... and me):
   mdunlink() has to call FileUnlink() to free allocation for fileName
   and add the Vfd slot to the free list.
1997-05-22 17:08:35 +00:00
Vadim B. Mikheev ff8ce5230d 1. Cleanup (no more FreeFd - unuseful; others).
2. FreeFile() has to do nothing with nfile (# of files opened
   by VFD manager).
1997-05-22 16:51:19 +00:00
Vadim B. Mikheev 737ab85cc0 1. Pass GISTENTRYs to giststate->penaltyFn by pointers, not by vals.
2. Re-initialize keys in gistrescan (if gist used in inner scan).
1997-05-22 16:01:33 +00:00
Marc G. Fournier 4800abc7c1 From: Darren King <aixssd!darrenk@abs.net>
To: pgsql-patches@postgreSQL.org
Subject: [PATCHES] DROP AGGREGATE gram.y typo...


Somehow I dropped a comma in the gram.y part (line 129) of my
patch for drop aggregate.  Here's a correct patch for gram.y.

PS. I hope I got the right comma, manually applied :) (scrappy)
1997-05-22 00:24:07 +00:00
Marc G. Fournier 5e7c0a0b9a From: Darren King <aixssd!darrenk@abs.net>
Subject: [PATCHES] DROP AGGREGATE patch/fix.


Here's a patch that fixes the DROP AGGREGATE command to delete
the desired aggregate for a specific type.
1997-05-22 00:17:24 +00:00
Marc G. Fournier 24ed6d604d From: Darren King <aixssd!darrenk@abs.net>
Subject: [PATCHES] AIX make patch resubmitted.

Misc patches for AIX from Darren:

1)  New src/makefiles/Makefile.aix  This patch should only be
    applied if the following patch (4) is applied to backend/Makefile!
    Still looking into having configure determine the last line to do
    the shared link.  The 325 code will work for 41, so I put that in
    as the default.  Included a commented out 41 line for completeness.

*and*

4)  Patch the backend Makefile.  I've reviewed this patch with respect to the
    other ports that use MAKE_EXPORTS (svr4 and univel) as closely as I could
    and I don't see where it will break them.  If it does, please let me know
    and I'll rework it somehow.
1997-05-22 00:11:29 +00:00
Marc G. Fournier 3e871388b5 From: Darren King <aixssd!darrenk@abs.net>
Subject: [PATCHES] Re: [PORTS] AIX 6.1 fixes...

Here are the patches for the two things that wouldn't make it thru the AIX
compiler.  The geo_ops.c change is harmless I believe.  The nbtcompare.c patch
fixes me, but I don't know about any other ports.  Maybe wait on that one
until Vadim decides what to do about the unsigned vs signed chars varlena
issue.
1997-05-22 00:07:30 +00:00
Vadim B. Mikheev 92ab5dc2b5 Little memmory leak in RelationFlushRelation() in freeing
relation->rd_att (relation' TupleDesc).
1997-05-20 11:41:38 +00:00
Vadim B. Mikheev 5f893a1e32 Shouldn't we use palloc instead of malloc ?
Because of
 *      resetpsort  - resets (frees) malloc'd memory for an aborted Xaction
 *
 *      Not implemented yet.
1997-05-20 11:35:50 +00:00
Vadim B. Mikheev e7f7cf4a1c 1. LocalBufferSync(): set nextFreeLocalBuf to 0 - we're freeing
all local buffers @ xact commit, so accordingly nextFreeLocalBuf
   is first local buffer now.
   It helps to avoid unnecessary local buffer allocations in LocalBufferAlloc()
   latter ("memmory leaks" in 'order by').
2. ResetLocalBufferPool() lost allocated local buffers:

   memset(LocalBufferDescriptors, 0, sizeof(BufferDesc) * NLocBuffer);

   (local buffers leak @ xact aborts).
1997-05-20 11:30:32 +00:00
Vadim B. Mikheev 4a8c3dddc3 Consider right-sided plans if _use_right_sided_plans_ is true. 1997-05-20 10:37:26 +00:00
Vadim B. Mikheev c4ab256383 New VAR r_plans added to enable turn ON/OFF
using right-sided plans.
1997-05-20 10:31:42 +00:00
Vadim B. Mikheev 0f67fb46f6 Initialize internal keys if rtree used in inner scan. 1997-05-20 10:29:30 +00:00
Bruce Momjian a1157deb57 Added fcvt() prot for bsdi.
Made PQsetdb() and PQfnumber() case-insensitive.
Removed attempt to set table ownership via pg_dumpall.
1997-05-20 03:39:02 +00:00
Marc G. Fournier 6ea80b470b From: Olaf Mittelstaedt <MSTAEDT@va-sigi.va.fh-ulm.de>
Minor patches to geo_ops.c to clean up compile under AIX 4.1.3
1997-05-19 03:49:39 +00:00
Edmund Mergl 0c67d28a08 added const declaration E.Mergl 1997-05-17 16:23:06 +00:00
Thomas G. Lockhart 5bc1024225 Remove troublesome type coersions from the char8 return statements.
Noted in trying to port to AIX.
1997-05-17 06:20:34 +00:00
Thomas G. Lockhart 51e0fe5c88 Improve informational messages for "show" command responses. 1997-05-16 07:24:13 +00:00
Thomas G. Lockhart e35b759fed Fix datetime and abstime conversions to and from date.
Bring optional new-storage date and time up to date and test.
This new storage format should fix the "Sparc gcc -O2 bug".
(Enable new code with USE_NEW_DATE and USE_NEW_TIME in dt.h)
1997-05-16 07:19:50 +00:00
Thomas G. Lockhart 9fd868d16a Rename new float and int conversion routines to avoid conflicts with
system calls on AIX (and probably other machines too).
1997-05-14 04:35:10 +00:00
Thomas G. Lockhart 1e790e207f Fix return value for tm2datetime to properly indicate failure. 1997-05-13 04:26:07 +00:00
Vadim B. Mikheev 3e248edf43 Added _readAggreg() to work with T_Aggreg type. 1997-05-12 07:17:23 +00:00
Thomas G. Lockhart 64d9b50893 Fix timezone manipulation code to avoid crashes on some machines.
Add type conversion functions for floating point numbers.
Check for zero in unary minus floating point code (IEEE allows an
 explicit negative zero which looks ugly in a query result!).
Ensure circle type has non-negative radius.
1997-05-11 15:11:47 +00:00
Bruce Momjian 91f4df2f2c Fix typechecking problem pointed out by Thomas. 1997-05-08 02:45:53 +00:00
Marc G. Fournier 505a4709e2 From: Erich Stamberger <eberger@gewi.kfunigraz.ac.at>
Subject: [PATCHES] oracle_compat functions core dumping on NULL-fields
1997-05-07 02:46:45 +00:00
Thomas G. Lockhart d464e31593 Remove valid pointer checks for returns from palloc() since palloc() will not
return if storage is not allocated. Ref: Vadim 97/05/01
1997-05-06 07:27:51 +00:00
Thomas G. Lockhart fad56c5211 Change LOread() and LOwrite() to loread() and lowrite() to allow use
by case-insensitive SQL parser.
1997-05-06 07:16:21 +00:00
Vadim B. Mikheev 13f41aa90b mdcreate():
fd = FileNameOpenFile(path, O_RDWR|O_CREAT|O_EXCL, 0600);

    /*
     *  If the file already exists and is empty, we pretend that the
     *  create succeeded.  During bootstrap processing, we skip that check,
     *  because pg_time, pg_variable, and pg_log get created before their
     *  .bki file entries are processed.
     *
>    *  As the result of this pretence it was possible to have in
>    *  pg_class > 1 records with the same relname. Actually, it
>    *  should be fixed in upper levels, too, but... -  vadim 05/06/97
>    */
1997-05-06 02:03:20 +00:00
Vadim B. Mikheev b45128f1c3 Kill re-incarnated bug arround
Assert ( --Vnpages > 0 );
	and
Assert ( --Fnpages > 0 );
1997-05-05 10:01:02 +00:00
Vadim B. Mikheev c3b51e0d67 Bug: backend crashes in btbeginscan()->btrescan()->_bt_orderkeys()
when btree used in innerscan with run-time key which value
passed by pointer.

Fix: keys ordering stuff moved to _bt_first().

Pointed by Thomas Lockhart.
1997-05-05 03:41:19 +00:00
Vadim B. Mikheev fe91ceb62b Fix old bug in _hash_first() for scan without keys:
if 1st bucket chain is empty then need to continue scan in the rest buckets.
1997-04-30 06:31:16 +00:00
Vadim B. Mikheev 3055eeff93 More informative NOTICEs in tuple checks. 1997-04-30 03:05:43 +00:00
Vadim B. Mikheev de97e7fae8 SET geqo TO ON|OFF 1997-04-29 04:38:58 +00:00
Vadim B. Mikheev a4792bd3d6 #ifdef GEQO
bool _use_geqo_ = true;
#else
bool _use_geqo_ = false;
#endif

_use_geqo_ is settable via SET var TO ...
1997-04-29 04:37:22 +00:00
Vadim B. Mikheev a1fbd470a9 Fix GroupBy: enable functions over aggregates and GroupBy-ed fields
in target list.
1997-04-29 04:32:50 +00:00
Marc G. Fournier d938b755dc From: "D'Arcy J.M. Cain" <darcy@druid.net>
Subject: [HACKERS] Inputting money

I notice that I have to put single quotes around money amounts if there
is a decimal point in the value.  I appears to be happening because there
is something changing things like "123.45" to "123.450000" and the code
has a problem with that.  There may be a better way to fix this but here
is a simple change to cash.c that lets it accept trailing zeroes.
1997-04-28 16:15:13 +00:00
Thomas G. Lockhart d831e9ce19 Change mixed-case routines to lower-case if referenced in pg_proc.h 1997-04-27 19:21:06 +00:00
Thomas G. Lockhart 812d5c9b68 Change mixed-case routines to lower-case if referenced in pg_proc.h
Add comparison operators to boolean and smaller/larger operators to datetime
and timespan. Fix int4 overflow math problem in timespan comparison operators.
1997-04-27 19:20:16 +00:00
Thomas G. Lockhart ee2f8e0472 Modify references to function manager to use lower-case calls. 1997-04-27 19:16:44 +00:00
Marc G. Fournier df77071773 Massive regression test patches from Thomas *woo hoo!* 1997-04-27 02:58:38 +00:00
Marc G. Fournier 094ec2d3f3 More timezone patches by Thomas:
Here are patches which should help fix timezone problems in the
datetime and abstime code. Also, I repatched varlena.c to add in
some comments and a little error checking on top of Vadim's earlier
repairs. There are slight mods to the circle data type to have the
distance operator between circles measure the distance between
closest points rather than between centers.
1997-04-25 18:40:50 +00:00
Marc G. Fournier b8e376ceb9 From: "Pedro J. Lobo" <pjlobo@euitt.upm.es>
Subject: [PATCHES] Patches for compiling 6.1 on Digital Unix 3.2c

Attached to this message are the patches I needed to compile 6.1 cleanly
under Digital Unix 3.2c with DEC cc.

I hope these are the last ones. At least, the number of files needing a
patch has decreased noticeably since I sent my previous patches. Nice work
:-)

One of the patches is a bug fix, but I'm including it here anyway.

With these patches applied, the beast seems to work properly. However,
I've done only some preliminary tests. More on this later (but hopefully
before the April 30 deadline... :-)
1997-04-24 20:30:41 +00:00
Marc G. Fournier 79ee06c186 Fixes:
postgres backend processes end up as so called zombies. It seems that
only Linux a.out (libc.4.6.27) systems are affected.


By:

Wolfgang Roth <roth@statistik.uni-mannheim.de>
1997-04-24 20:27:46 +00:00
Vadim B. Mikheev 67712200f1 * Hack for non-functional btree npages estimation:
* npages = index_pages * selectivity_of_1st_attr_clause(s)
1997-04-24 16:07:14 +00:00
Vadim B. Mikheev 72d271177c Have to copyObject((void*)clauseinfo) for a relation'
joininfo (in add_join_clause_info_to_rels()) : clause may be
commutted later.
1997-04-24 16:04:23 +00:00
Vadim B. Mikheev e349eb6e2c Bug (yet unfixed but not fatal) found: Re-moving index clauses from the
nestloop's join clauses doesn't work in some cases:
         *    1. fix_indxqual_references may change varattno-s in
         *       inner_indxqual;
         *    2. clauses may be commuted
1997-04-24 15:59:58 +00:00
Vadim B. Mikheev a1ac1989cf Save Var' order in index_outerjoin_references(). 1997-04-24 15:54:52 +00:00
Vadim B. Mikheev 4ec8a148ed Add innercost to result in cost_hashjoin. 1997-04-24 15:49:30 +00:00
Vadim B. Mikheev 72b523d055 _bt_endpoint fixed: set currentItemData to Invalid if no result. 1997-04-24 15:46:44 +00:00
Vadim B. Mikheev cd7206b2ab Enable to set _cpu_page_wight_ & _cpu_index_page_wight_ via
SET cost_heap(cost_index) TO ...
1997-04-24 15:41:37 +00:00
Marc G. Fournier 29a31fb7bc -Wno-error should only be enabled for gcc compilers, it seems 1997-04-24 13:25:07 +00:00
Marc G. Fournier e9f37a7410 Somewhat backwards #ifdef's for HAVE_GETRUSAGE 1997-04-24 03:39:09 +00:00
Marc G. Fournier 08a5901ba1 Various patches not commited, plus a linux/sparc patch from
Satoshi Ishikawa <power@sekine.densi.gifu-u.ac.jp>
1997-04-24 02:35:39 +00:00
Marc G. Fournier 7a7a9b1a04 Change HAVE_RUSAGE to HAVE_GETRUSAGE, which is the more appropriate 1997-04-23 18:02:43 +00:00
Vadim B. Mikheev 3c461c8397 Analyze data only if specified and specified attrs only. 1997-04-23 06:28:48 +00:00
Vadim B. Mikheev 2fac94ec1a 1. SHOW/RESET var fixed.
2. vacuum() call changed (ANALYZE).
1997-04-23 06:09:36 +00:00
Vadim B. Mikheev 24d48db32d 1. SHOW/RESET var fixed.
2. New VACUUM syntax (ANALYZE ...).
1997-04-23 06:04:46 +00:00
Marc G. Fournier 4b5319129c To: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: Re: [PATCHES] SET DateStyle patches

On Tue, 22 Apr 1997, Thomas Lockhart wrote:

> Some more patches! These (try to) finish implementing SET variable TO value
> for "DateStyle" (changed the name from simply "date" to be more descriptive).
> This is based on code from Martin and Bruce (?), which was easy to modify.
> The syntax is
>
> SET DateStyle TO 'iso'
> SET DateStyle TO 'postgres'
> SET DateStyle TO 'sql'
> SET DateStyle TO 'european'
> SET DateStyle TO 'noneuropean'
> SET DateStyle TO 'us'         (same as "noneuropean")
> SET DateStyle TO 'default'    (current same as "postgres,us")
>
> ("european" is just compared for the first 4 characters, and "noneuropean"
> is compared for the first 7 to allow less typing).
>
> Multiple arguments are allowed, so SET datestyle TO 'sql,euro' is valid.
>
> My mods also try to implement "SHOW variable" and "RESET variable", but
> that part just core dumps at the moment. I would guess that my errors
> are obvious to someone who knows what they are doing with the parser stuff,
> so if someone (Bruce and/or Martin??) could have it do the right thing
> we will have a more complete set of what we need.
>
> Also, I would like to have a floating point precision global variable to
> implement "SET precision TO 10" and perhaps "SET precision TO 10,2" for
> float8 and float4, but I don't know how to do that for integer types rather
> than strings. If someone is fixing the SHOW and RESET code, perhaps they can
> add some hooks for me to do the floats while they are at it.
>
> I've left some remnants of variable structures in the source code which
> I did not use in the interests of getting something working for v6.1.
> We'll have time to clean things up for the next release...
1997-04-23 03:18:27 +00:00
Marc G. Fournier 5514c1fa23 Add fcvt() as a check to configure so that we can get rid of the BSD44_derived
type check in numutils.c:ftoa()

Pointed out by: "Martin J. Laubach" <mjl@emsi.priv.at>
1997-04-22 17:47:42 +00:00
Marc G. Fournier 7c82b2e9c3 From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: [PATCHES] date/time timezone patches (mail bounced?)

Here are some hacks to get timezone behavior for the various time
data types to be compatible with v6.0. Although we have some hooks
already installed to get timezone info from the client to the
server, it still isn't clear if that can correctly transfer enough
timezone info to make the behavior the same as if timezone info
were derived from the server as is now the case. We certainly
won't resolve it in a day, so I think we are stuck with server-only
timezones for v6.1.
1997-04-22 17:36:57 +00:00
Marc G. Fournier 9e2a87b62d Major patch from Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
OK, here are a passel of patches for the geometric data types.
These add a "circle" data type, new operators and functions
for the existing data types, and change the default formats
for some of the existing types to make them consistant with
each other. Current formatting conventions (e.g. compatible
with v6.0 to allow dump/reload) are supported, but the new
conventions should be an improvement and we can eventually
drop the old conventions entirely.

For example, there are two kinds of paths (connected line segments),
open and closed, and the old format was

'(1,2,1,2,3,4)' for a closed path with two points (1,2) and (3,4)
'(0,2,1,2,3,4)' for an open path with two points (1,2) and (3,4)

Pretty arcane, huh? The new format for paths is

'((1,2),(3,4))' for a closed path with two points (1,2) and (3,4)
'[(1,2),(3,4)]' for an open path with two points (1,2) and (3,4)

For polygons, the old convention is

'(0,4,2,0,4,3)' for a triangle with points at (0,0),(4,4), and (2,3)

and the new convention is

'((0,0),(4,4),(2,3))' for a triangle with points at (0,0),(4,4), and (2,3)

Other data types which are also represented as lists of points
(e.g. boxes, line segments, and polygons) have similar representations
(they surround each point with parens).

For v6.1, any format which can be interpreted as the old style format
is decoded as such; we can remove that backwards compatibility but ugly
convention for v7.0. This will allow dump/reloads from v6.0.

These include some updates to the regression test files to change the test
for creating a data type from "circle" to "widget" to keep the test from
trashing the new builtin circle type.
1997-04-22 17:35:09 +00:00
Vadim B. Mikheev 051b4210e3 Fix for Hash and arrays 1997-04-22 03:32:38 +00:00
Vadim B. Mikheev 9f42a56a02 Fix for text_lt/text_le to avoid warnings if not def USE_LOCALE. 1997-04-21 04:31:53 +00:00
Vadim B. Mikheev 42e72503a1 #include <string.h> 1997-04-21 04:28:59 +00:00
Vadim B. Mikheev f3054b24c2 Fix for -Wno-error 1997-04-21 04:26:47 +00:00
Marc G. Fournier 85a95b9b0d Here is the Mismatched input/output patch for tintervals as reported over
the last week on Hackers...(A coulpe of clippings of the final
verdict are included below + the diff).

From: Wayde Nie <niew@phoenix.cis.mcmaster.ca>
1997-04-20 21:49:17 +00:00
Vadim B. Mikheev 8466811335 Fix for -Wno-error 1997-04-18 08:57:39 +00:00
Vadim B. Mikheev d6b8f637f9 CommitInfoNeedsSave[buffer - 1] = 0
added to WriteBuffer(), FlushBuffer(), WriteNoReleaseBuffer().
1997-04-18 08:30:08 +00:00
Vadim B. Mikheev 538f58c04c #ifdef BTREE_BUILD_STATS enables to get executor stats for btree
building.
1997-04-18 03:37:57 +00:00
Vadim B. Mikheev 949ab57c7a Declaration
static const char *num_word(Cash value);
moved here from cash.h
1997-04-18 02:55:54 +00:00
Vadim B. Mikheev d3dfc664d0 PrintBufferUsage() changed to report about shared, local and direct
blocks transfferes.
1997-04-18 02:53:37 +00:00
Vadim B. Mikheev 55f5354380 Fix bttextcmp() to use unsigned char*.
#ifdef USE_LOCALE added.
1997-04-18 02:48:05 +00:00
Marc G. Fournier cbaa98835c From: Raymond Toy <toy@rtp.ericsson.se>
Subject: [PATCHES] 970417:  some large object patches


Two patches here, made against 970417.  Both have to do with large
objects:

        1.  lobjfuncs was not initialized in PQconnectdb.  This causes
            failure later if large objects are used.  (Someone already
            caught this error in PQsetdb.)

        2.  Postgres functions lo_import and lo_export sometimes
            produce garbage for the file names because the filename
            strings aren't always terminated by \0.  (VARDATA isn't
            necessarily null terminated.)
1997-04-17 20:39:31 +00:00
Marc G. Fournier 8834795ebf From: Raymond Toy <toy@rtp.ericsson.se>
Subject: [PATCHES] 970417:  two more patches for large objects

Here are two more patches:

        1.  pg_getint doesn't properly set the status flag when
            calling pqGetShort or pqGetLong.  This is required when
            accessing large objects via libpq.  This, combined with
            problem 1 above causes postgres to crash when postgres
            tries to print out the message that the status was not
            good.

        2.  ExceptionalCondition crashes when called with detail =
            NULL.  This patch prevents dereferencing the NULL.
1997-04-17 20:38:26 +00:00
Marc G. Fournier a1f229b19e From: "Martin J. Laubach" <mjl@CSlab.tuwien.ac.at>
Subject: [HACKERS] Patch: set date to euro/us postgres/iso/sql

  Here a patch that implements a SET date for use by the datetime
stuff. The syntax is

        SET date TO 'val[,val,...]'

  where val is us (us dates), euro (european dates), postgres,
iso or sql.

  Thomas is working on the integration in his datetime module.
I just needed to get the patch out before it went stale :)
1997-04-17 13:50:57 +00:00
Vadim B. Mikheev a0d63ac98c The patch fixes a rare bug that may occur when one tries to vacuum a single
table. The table name is de-allocated by the CommitTransactionCommand()
in vc_init() before it is copied in VacRel.data and sometimes this causes
a SIGSEGV. My patch simply moves the strcpy before vc_init.

Submitted by Massimo Dal Zotto <dz@cs.unitn.it>.
1997-04-17 01:45:36 +00:00
Vadim B. Mikheev 4d985ea96b StreamConnection(): setsockopt (..., TCP_NODELAY, ...) added. 1997-04-16 06:25:13 +00:00
Vadim B. Mikheev 329fb11262 1. BTREE_VERSION_1: using bti_itup->t_tid as unique identifier for a given
index tuple (logical position within A LEVEL). bti_oid & bti_dummy
taken off from BTItemData.
2. Fix for multi-column indices (nbtsearch.c):
   _bt_binsrch() - for searches on internal pages having keysize <
	number of attrs we point at the last item < the scankey, not at the
	first item = the scankey;
   _bt_moveright() - if keysize < number of attrs we compare scankey with
	_last_ item on current page to decide should we move right or
	not.
1997-04-16 01:48:29 +00:00
Marc G. Fournier 5dcc9bef6e Patch for Solaris 2.5 from: adrian@waltham.harvard.net 1997-04-15 18:18:45 +00:00
Marc G. Fournier 6fd4e2b414 Various minor HP related patches from:
Morten Kjeldgaard <mok@monster.kemi.aau.dk>
1997-04-15 17:55:37 +00:00
Marc G. Fournier 9778b946e5 A small fix, where default: condition in case had not 'break;'...not required,
but, IMHO, cleaner
1997-04-15 17:46:52 +00:00
Marc G. Fournier 88d740462f From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: [HACKERS] Money integration patches

Here are patches to integrate the money data type. I have included
some math and aggregate functions and have made the locale support optional
by #ifdef USE_LOCALE bracketing of functions.

Modules affected are:
builtins.h.patch
cash.c.patch
cash.h.patch
main.c.patch
pg_aggregate.h.patch
pg_operator.h.patch
pg_proc.h.patch
pg_type.h.patch

I changed the data type to be pass-by-reference rather than by-value
to pave the way for a larger internal representation (64-bit ints?).
Also, I changed the tabbing of cash.c and cash.h to match most of
the other Postgres source code files (4 space indent, 8 spaces == 1 tab).

The locale stuff should be tested under another convention (Russian?)
but I don't know what the correct results should be so perhaps someone
else can give them a try. Will update docs and regression tests in
the next few days.
1997-04-15 17:41:44 +00:00
Marc G. Fournier d8a300d867 2. The file /usr/local/pgsql/src/backend/lipq/pgcomprim.c has two
invalid macro definitions, the compiler complains about:

"pqcomprim.c", line 48.9: 1506-275 (S) Unexpected text ';' ignored.
"pqcomprim.c", line 61.9: 1506-275 (S) Unexpected text ';' ignored.

The ';' terminating the macro definition ntoh_s(n) on line 27 and
ntoh_l(n) on line 28 should be removed.


Pointed out by: Olaf Mittelstaedt <MSTAEDT@va-sigi.va.fh-ulm.de>
1997-04-15 17:25:47 +00:00
Marc G. Fournier 953ac7b55a Fix up the -Wno-error problem for non-gcc compilers
Pointed out by many many ppl
1997-04-15 17:24:26 +00:00
Marc G. Fournier a69c5fc81a Add ccsym to tools to determine OS/compiler specific symbols
Change BSD44_derived to __FreeBSD__ in numutils.c (need to know what
NetBSD is referred to as...someone?)
1997-04-13 17:09:45 +00:00
Marc G. Fournier df2374f024 Make sure postgres.h is included before we start checking #ifdef's for other
header files.

Pointed out by: Edmund Mergl <E.Mergl@bawue.de>
1997-04-12 09:37:31 +00:00
Marc G. Fournier bc97905a15 Finish removing the TEST_MAIN stuff, which was mean for standalone
testing
1997-04-10 20:51:13 +00:00
Marc G. Fournier fac81b448c Fix #include "cash.h" to be #include <utils/cash.h>
Remove the TEST_MAIN stuff at the top...
1997-04-10 20:42:35 +00:00
Vadim B. Mikheev 81489528d0 Copy indexkeys in _copyIndexPath. 1997-04-10 07:59:09 +00:00
Marc G. Fournier e6dfee305c Much improved configure that integrates the build script right into it
Submitted by: adrian@waltham.harvard.net
1997-04-09 08:55:32 +00:00
Marc G. Fournier 4999f002e6 Add in D'Arcy's cash code
pg_proc.h still needs modifying, but this gets it in there so that we can
get around any compiler bugs.  Will try and get the pg_proc.h entries done
up later tonight...
1997-04-09 08:36:21 +00:00
Marc G. Fournier 1c688d1bbe From: "Martin S. Utesch" <utesch@aut.tu-freiberg.de>
Subject: Re: [HACKERS] GEQO and views (rules)


Oke, this was caused by a classic bug :-/
I thougth, root->base_relation_list_ could be
represented as relid string 1-2-3-4- etc.

Instead, in case of views, the count of relids doesn't start with "1" but
maybe 4-5-6- etc . :-(

GEQO patch follows ... views are now all right.
1997-04-09 08:31:29 +00:00
Marc G. Fournier aaeef4dae8 GNUmakefile.in - remove backend/utils/Gen_fmgrtab.sh on distclean
varlena.c - part of Thomas' most recent patch
1997-04-09 08:29:35 +00:00
Vadim B. Mikheev 2fd9273d97 getattnvals(): if attnvals in pg_attribute is 0 then use
ATTNVALS_SCALE/reltuples (instead of reltuples).
1997-04-09 02:20:32 +00:00
Vadim B. Mikheev 610d0d00ed 1. Enable to have different _CPU_PAGE_WEIGHT_ for heap and index.
2. PageWeights are variables now.
3. Fixed using ceil((double)selec*indextuples) as estimation
for expected heap pages: ceil((double)selec*relpages) now.
1997-04-09 02:13:41 +00:00
Vadim B. Mikheev fa2629b7ea Fix (hack) IndexSelectivity():
use sum(npages)/((nkeys == 1) ? 1 : nkeys + 1) as expected index page
estimation for multi-key quals - instead of sum(npages).
In old code npages for x > 10 and x < 20 is twice as for x > 10 - cool ?
1997-04-09 01:52:04 +00:00
Vadim B. Mikheev c56b20eee9 Fix btabstimecmp (). 1997-04-07 06:45:41 +00:00
Vadim B. Mikheev 0762deacec Print 'Group' as name of Group plan. 1997-04-05 06:42:32 +00:00
Vadim B. Mikheev d12e27a5f3 Changes for GROUP BY func_results:
AddGroupAttrToTlist() is not called from anywhere now.
1997-04-05 06:39:58 +00:00
Vadim B. Mikheev c50d8474d3 Changes for GROUP BY func_results. 1997-04-05 06:37:37 +00:00
Vadim B. Mikheev cc11cfdd46 Now we can GROUP BY func_results. 1997-04-05 06:29:03 +00:00
Vadim B. Mikheev 803a2b13f2 Fix for 'SET var_name TO var_value': var_name already defined. 1997-04-05 06:25:59 +00:00
Vadim B. Mikheev 50faf40903 Check for attributeList is NULL in ConstructTupleDescriptor ().
Submitted by Raymond Toy.
1997-04-05 03:36:21 +00:00
Marc G. Fournier 3ded1cc530 From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: [HACKERS] Fix for European dates

This apparently fixes the European date reading problem reported
by several (European) bleeding edge adopters. I tried a few test
cases and it doesn't break the non-EuroDate cases in my test suite.
1997-04-05 02:51:41 +00:00
Marc G. Fournier eda9d69d6c Move YACC and YFLAGS into the template files
Clean up the .sample files...comment out all sample entries except for
the localhost one
1997-04-04 11:23:15 +00:00
Marc G. Fournier c7b40e6058 This commit represents a clean compile with the new templates under
FreeBSD

The Makefile(s) have all been cleaned up such that there is a single
LDFLAGS vs LD_ADD or LDADD or LDFLAGS or LDFLAGS_BE.  The Makefile(s)
should be alot more straightforward then they were before...and
consistent
1997-04-04 10:43:16 +00:00
Marc G. Fournier d2892913eb Again, needs float.h 1997-04-04 08:55:29 +00:00
Marc G. Fournier 18518c0147 needs float.h for DBL_MIN under FreeBSD 1997-04-04 08:53:08 +00:00
Marc G. Fournier a03dc60508 Remove code associated with !ACLGROUP_PATCH, and appropriate #ifdef's 1997-04-03 21:31:57 +00:00
Marc G. Fournier 4bc578eb83 From: "D'Arcy J.M. Cain" <darcy@druid.net>
Subject: [HACKERS] timestamp.c changes

I sent in changes previously and they were rejected because they didn't
follow ANSI spec.  Here is the input part of the changes again.  Even
though it allows more flexibility for inputting different formats, it
is also backwards compatible with the standard version.  I have also
not changed the output format so it will still output the ANSI forms.
Is this acceptable to everyone?
1997-04-03 19:58:11 +00:00
Marc G. Fournier 9d5c0af586 From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: [HACKERS] Aggregate function patches

Here are the aggregate function patches I originally sent in last December.
They fix sum() and avg() behavior for ints and floats when NULL values are
involved.

I was waiting to resubmit these until I had a chance to write a v6.0->v6.1
database upgrade script to ensure that existing v6.0 databases which have
not been reloaded for v6.1 do no break with the new aggregate behavior.
These scripts are included below. It's OK with me if someone wants to do
something different with the upgrade strategy, but something like this
was discussed a few weeks ago.

Also, there were a couple of small items which cropped up in doing a clean
install of 970403 (actually 970402 + 970403 changes since the full 970403
tar file appears to be damaged or at least suspect). They are the first
two patches below and can be omitted if desired (although I think they
aren't dangerous :).
1997-04-03 19:56:47 +00:00
Marc G. Fournier 164cd7ab34 removed as already installed as part of system headers on NetBSD/FreeBSD 1997-04-02 18:49:24 +00:00
Marc G. Fournier 2ab34dfe1a From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: [HACKERS] More date time functions

Here are some additional patches mostly related to the date and time
data types. It includes some type conversion routines to move between
the different date types and some other date manipulation routines such
as date_part(units,datetime).

I noticed Edmund Mergl et al's neat trick for getting function overloading
for builtin functions, so started to use that for the date and time stuff.
Later, if someone figures out how to get function overloading directly
for internal C code, then we can move to that technique.

These patches include documentation updates (don't faint!) for the built-in
man page. Doesn't yet include mention of timestamp, since I don't know
much about it and since it may change a bit to become a _real_ ANSI timestamp
which would include parser support for the declaration syntax (what do you
think, Dan?).

The patches were developed on the 970330 release, but have been rebuilt
off of the 970402 release. The first patch below is to get libpq to compile,
on my Linux box, but is not related to the rest of the patches and you can
choose not to apply that one at this time. Thanks in advance, scrappy!
1997-04-02 18:36:24 +00:00
Marc G. Fournier a51df14a69 From: "Martin J. Laubach" <mjl@CSlab.tuwien.ac.at>
Subject: [HACKERS] Patch: SET var TO 'val'

  Here is a patch that adds a "SET variable TO 'somevalue'" capability
to the parser, and then calls the SetPGVariable() function (which does
just issue a elog(NOTICE) to see whether it works).

  That's the framework for adding timezone/date format/language/...
stuff.
1997-04-02 18:24:52 +00:00
Marc G. Fournier 5b1311acfb From: Oleg Bartunov <oleg@sai.msu.su>
Subject: [HACKERS] locale patches !

Hi there,

here are little patches to get Postgres 6.1 works with locale stuff.
This is a patch against 970402.tar.gz, there are no problem to apply them
by hand to 6.0 release. Collate stuff tested about 1-2 months in real
working database but I'm sure there must be no problem. US hackers
could vote against locale implementation ( locale for sure will affect to
speed of postgres ), so I introduce variable USE_LOCALE which
controls locale stuff. Non-US users now could use ~* operator
for searching and <order by> for strings with nation alphabet.
Please, don't forget, as I did first time, to set environment variable
LC_CTYPE and LC_COLLATE because backend get locale information from them.
I start postmaster from a little script, assuming that shell is Bash shell
it looks like:

#!/bin/sh

export LC_CTYPE=koi8-r
export LC_COLLATE=koi8-r
postmaster -B 1024 -S -D/usr/local/pgsql/data/ -o '-Fe'
1997-04-02 18:13:47 +00:00
Vadim B. Mikheev a10a951a46 New keyword: SEQUENCE. 1997-04-02 04:49:13 +00:00
Vadim B. Mikheev a15158bb55 Call DefineSequence () for T_CreateSeqStmt node. 1997-04-02 04:06:32 +00:00
Vadim B. Mikheev 41aeed4334 Can't INSERT/UPDATE/DELETE sequence relation. 1997-04-02 04:04:11 +00:00
Vadim B. Mikheev 9729f6ca0d CREATE/DROP SEQUENCE ...
Check nextval/currval permission in analyze.c.
1997-04-02 04:01:03 +00:00
Vadim B. Mikheev e276d8a1a6 Can't COPY TO sequence relation.
Can't inherits from ...
1997-04-02 03:57:06 +00:00
Vadim B. Mikheev e8647c45d6 Sequence numbers generators code. 1997-04-02 03:51:23 +00:00
Vadim B. Mikheev 1a3c7371e8 vc_getrels(p, VacRelP) returns NIL for special relations (indices,
sequences,...) and vc_delhilowstats(NULL->vrl_relid) ...
1997-04-02 03:48:01 +00:00
Vadim B. Mikheev 2030cbdf6c Hack for heap_creat to enable relkind to be 'S' for sequences. 1997-04-02 03:41:16 +00:00
Vadim B. Mikheev 076f7286be CloseSequences () at xact commit/abort. 1997-04-02 03:38:02 +00:00
Marc G. Fournier 80b618520e Use $(CC), not gcc, to compile
Pointed out by: igor@cs.cs.miami.edu
1997-04-02 00:34:23 +00:00
Marc G. Fournier 986bfc5053 Misc port related issues 1997-04-01 09:27:11 +00:00
Marc G. Fournier 4bd4ecf498 Slight Linux related bug pointed out by Gabriel Akos <gabriel@rocker.sch.bme.hu> 1997-03-28 09:43:53 +00:00
Marc G. Fournier 632a707fd1 From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: [HACKERS] Small date patches (resubmitted)

Here a some small patches for the date/time code. They set the default
output format for the datetime type to the traditional Postgres
style, and fix a date debugging declaration. I submitted these
a couple of days ago, but they might have gotten lost...


NOTE: the second patch to dt.c is what I believe D'Arcy submitted as well,
      that I claimed was taken out...sorry D'Arcy, my fault :(
1997-03-28 07:18:06 +00:00
Marc G. Fournier 28454c216b From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: Re: [HACKERS] abstime "now" broken

Yes, I broke 'now' :( with an attempt at a bug fix involving
servers running in the UTC/GMT timezone. These patches fix
the problem, and have been tested in GMT (+00 hours),
PST (-08), and NZT (+12) timezones which exercized the code for
various cases including across day boundaries.  btw, this code
fixes the same type of problem for 'today', 'yesterday', 'tomorrow',
for DATETIME, ABSTIME, DATE and TIME types.

The bugfix itself is quite small, but I have accumulated other
changes in the datetime data type and include them here also.
One set of changes involves printing ISO-formatted dates and
is in response to the helpful information from Kurt Lidl regarding
ANSI SQL dates. I'll send another e-mail sometime soon discussing
more issues he has raised...
1997-03-28 07:13:21 +00:00
Marc G. Fournier 159f8c63ad From: Dan McGuirk <mcguirk@indirect.com>
Reply-To: hackers@hub.org, Dan McGuirk <mcguirk@indirect.com>
To: hackers@hub.org
Subject: [HACKERS] tmin writeback optimization

I was doing some profiling of the backend, and noticed that during a certain
benchmark I was running somewhere between 30% and 75% of the backend's CPU
time was being spent in calls to TransactionIdDidCommit() from
HeapTupleSatisfiesNow() or HeapTupleSatisfiesItself() to determine that
changed rows' transactions had in fact been committed even though the rows'
tmin values had not yet been set.

When a query looks at a given row, it needs to figure out whether the
transaction that changed the row has been committed and hence it should pay
attention to the row, or whether on the other hand the transaction is still
in progress or has been aborted and hence the row should be ignored.  If
a tmin value is set, it is known definitively that the row's transaction
has been committed.  However, if tmin is not set, the transaction
referred to in xmin must be looked up in pg_log, and this is what the
backend was spending a lot of time doing during my benchmark.

So, implementing a method suggested by Vadim, I created the following
patch that, the first time a query finds a committed row whose tmin value
is not set, sets it, and marks the buffer where the row is stored as
dirty.  (It works for tmax, too.)  This doesn't result in the boost in
real time performance I was hoping for, however it does decrease backend
CPU usage by up to two-thirds in certain situations, so it could be
rather beneficial in high-concurrency settings.
1997-03-28 07:06:53 +00:00
Marc G. Fournier d98f72e22f From: "D'Arcy J.M. Cain" <darcy@druid.net>
#ifdef is looking for the wrong value.
1997-03-28 06:55:58 +00:00
Marc G. Fournier 038e56c4df From: "D'Arcy J.M. Cain" <darcy@druid.net>
Some systems require limits.h to define DBL_MIN.
1997-03-28 06:54:51 +00:00
Marc G. Fournier 70a0237bed On some systems limits.h is needed to define DBL_MIN.
From: "D'Arcy J.M. Cain" <darcy@druid.net>
1997-03-28 06:53:50 +00:00
Vadim B. Mikheev b9fda39de3 Added call to heap_endscan in IndexIsUniqueNoCache - to release
our READ lock on pg_index and let others to create indices too !
1997-03-27 04:13:44 +00:00
Marc G. Fournier 7cbe19384f Add string.h for strerror() prototype 1997-03-26 03:27:04 +00:00
Marc G. Fournier 5b63c6b63a include float.h *after* postgres.h :( 1997-03-26 03:14:37 +00:00
Vadim B. Mikheev 3be7ecb2e4 Disallow to create multi-column indices using non-btree. 1997-03-26 03:05:28 +00:00
Marc G. Fournier d6b2f41c07 need float.h under FreeBSD for DBL_MIN 1997-03-26 03:02:15 +00:00
Vadim B. Mikheev 7d336625c0 Added syntax for multi-column indices. 1997-03-26 02:52:49 +00:00
Vadim B. Mikheev 14ed5b3ecd Someone forgot about 'case sizeof(int32)' for
tupleDesc->attrs[i]->attlen in fastgetiattr.
1997-03-26 02:24:38 +00:00
Marc G. Fournier 64c82a5016 Add checs for float.h
Remove 'unused variable' from dt.c
1997-03-25 20:02:42 +00:00
Marc G. Fournier 719a413fd2 Add float.h for DBL_{MIN,MAX} under FreeBSD 1997-03-25 20:00:52 +00:00
Marc G. Fournier 884d70edf0 MIssed adding a file to the repository 1997-03-25 09:44:00 +00:00
Marc G. Fournier 070381482f From: "D'Arcy J.M. Cain" <darcy@druid.net>
Subject: [HACKERS] backend/utils/adt/timestamp.c

Back to this timezone stuff.  The struct tm has a field (tm_gmtoff) which
is the offset from UTC (GMT is archaic BTW) in seconds.  Is this the
value you are looking for when you use timezone?  Note that this applies
to NetBSD but it does not appear to be in either ANSI C or POSIX.  This
looks like one of those things that is just going to have to be hand
coded for each platform.

Why not just store the values in UTC and use localtime instead of
gmtime when retrieving the value?

Also, you assume the time is returned as a 4 byte integer.  In fact,
there is not even any requirement that time be an integral value.  You
should use time_t here.

The input function seems unduly restrictive.  Somewhere in the sources
there is an input function that allows words for months.  Can't we do
the same here?

There is a standard function, difftime, for subtracting two times.  It
deals with cases where time_t is not integral.  There is, however, a
small performance hit since it returns a double and I don't believe
there is any system currently which uses anything but an integral for
time_t.  Still, this is technically the correct and portable thing to do.

The returns from the various comparisons should probably be a bool.
1997-03-25 09:25:33 +00:00
Marc G. Fournier ea2fa32eff Rather than make this a Linux test, we should just test for the existence
of endian.h.  I figure that if it exists it's pretty sure that it has
the byte order information and we may catch some other ports without
any further testing.

From: "D'Arcy J.M. Cain" <darcy@druid.net>
1997-03-25 08:25:47 +00:00
Marc G. Fournier fcd65952fd Use $(LD_ADD) from Makefile.global instead of $(LDADD), which doesn't exist...
Pointed out indirectly by D'Arcy
1997-03-25 08:14:25 +00:00
Marc G. Fournier dfe0475362 From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: [HACKERS] More patches for date/time

I have accumulated several patches to add functionality to the datetime
and timespan data types as well as to fix reported porting bugs on non-BSD
machines. These patches are:

dt.c.patch              - add datetime_part(), fix bugs
dt.h.patch              - add quarter and timezone support, add prototypes
globals.c.patch         - add time and timezone variables
miscadmin.h.patch       - add time and timezone variables
nabstime.c.patch        - add datetime conversion routine
nabstime.h.patch        - add prototypes
pg_operator.h.patch     - add datetime operators, clean up formatting
pg_proc.h.patch         - add datetime functions, reassign conflicting date OIDs
pg_type.h.patch         - add datetime and timespan data types

The dt.c and pg_proc.h patches are fairly large; the latter mostly because I tried
to get some columns for existing entries to line up.
1997-03-25 08:11:24 +00:00
Marc G. Fournier d2a386d6e3 MOre univel port patches/files from:
"Michael P. Snyder" <msnyder@hawkeye.huntersmoon.com>
1997-03-25 07:54:53 +00:00
Vadim B. Mikheev 1a63f48b28 Free memory allocated by command in the BlankPortal' HeapMemory context
(#ifdef-ed).
1997-03-25 04:10:21 +00:00
Marc G. Fournier ef56e51cd3 - Renamed the variable names to something shorter, and I hope
nicer. Also, I grabbed my copy of the Informix manual, and
    added a couple of variables that make sense (formats for
    money, time, a language setting, a timezone).

  - New functions SetPGVariable() and GetPGVariable() in tcop/*.
    These don't actually do anything for the moment, but should
    be enough to implement the SET var_name TO var_val in the
    parser?

    SetPGVariable() expects just two strings, the var_name and
    the var_value from above, and is expected to do the right thing.
    Returns TRUE if  everything okay.


From: "Martin J. Laubach" <mjl@wwx.vip.at>
1997-03-25 02:37:21 +00:00
Marc G. Fournier 424e43326b I don't know whether this breaks what the previous person tried to
fix, but figure I"ll know soon enough, eh?

Patch submitted by Dan McGuirk
1997-03-25 00:54:15 +00:00
Vadim B. Mikheev 14f6b387b1 + NULLs handling
Actually required by multi-column indices support.
	We still don't use btree for 'A is (not) null', but
	now btree keep items with NULL attrs using single rule
	for placing/finding items on pages:
	NULLs greater NOT_NULLs and NULL = NULL.
+ Bulkload code (nbtsort.c) support for multi-column indices
	building and NULLs.
+ Fix for btendscan()->pfree(scanopaque) from Chris Dunlop.
1997-03-24 08:48:16 +00:00
Vadim B. Mikheev bdae359acc Setting index' attributes attcacheoff to -1 in index_create(). 1997-03-24 07:39:47 +00:00
Marc G. Fournier 3589f71ebb From: "D'Arcy J.M. Cain" <darcy@druid.net>
Subject: [HACKERS] backend/utils/adt/nabstime.c

There is a problem with some of the calls to strftime.  The second arg is
missing.  In all cases the buffer is CTZName which, according to the
file init/globals.c, is char CTZName[8] so I have added this value.
I know there should be a #define set up for this but I wasn't sure
which header to put it in.
1997-03-21 18:53:28 +00:00
Marc G. Fournier 69c2c66196 change strtok(0.. to strtok(NULL..
From: Keith Parks <emkxp01@mtcc.demon.co.uk>
1997-03-20 18:31:49 +00:00
Marc G. Fournier bf872f0aff From: "D'Arcy J.M. Cain" <darcy@druid.net>
Subject: [HACKERS] libpq/pqcomm stuff and Solaris byte order

I decided to go ahead with the required changes since no one else seems
to.  I don't guarantee that it is perfect but with these changes the
package actually compiles.  While I was at it I added to the Sparc
Solaris header to define the byte order.  Note that NetBSD sets this
in the system headers so it wasn't required there.

In particular, someone may want to check whether I removed the correct
84 lines from backend/libpq/pqcomprim.c.
1997-03-20 18:23:33 +00:00
Marc G. Fournier 7d5770eaf2 Check for and set HAVE_CRYPT_H if <crypt.h> exists
include crypt.h in password.c if crypt.h does exist
1997-03-20 18:04:32 +00:00
Vadim B. Mikheev aa1a887185 Fix call to index_create in DefineIndex. 1997-03-19 07:52:03 +00:00
Vadim B. Mikheev d656e023a1 Fix index_create for multi-column indices 1997-03-19 07:44:45 +00:00
Marc G. Fournier 7acd9a3609 remove a double declaration/prototype 1997-03-19 03:56:50 +00:00
Marc G. Fournier 861cfd686d Remove port.c since it is redundant (well, empty, at least)
Change Makefile to refl removal of portc

Change dynloader.c so that its only used if PRE_BSDI_2_1 is defined
1997-03-19 03:01:32 +00:00
Marc G. Fournier 6ffd26d8eb Add a check for strerr, and add in D'Arcy's strerror() code in case not
found
1997-03-19 02:37:42 +00:00
Marc G. Fournier da9dcf826b there, that's fixed 1997-03-19 02:13:27 +00:00
Marc G. Fournier 8411931a59 Fixing a screw up 1997-03-19 02:12:15 +00:00
Marc G. Fournier 678cd5c6b6 From: Jun Kuwamura <juk@rccm.co.jp>
Subject: [HACKERS] auth.c for kerberos.

  I made pgsql with eBones(international version of Kerberos4).  The
following modification was needed.  And I added read permition for
group to srvtab instead of running postmaster as root.
1997-03-18 21:46:31 +00:00
Marc G. Fournier 3bc07104ae Replace strsep() by strtok()
By: Dan McGuirk <mcguirk@indirect.com>
1997-03-18 21:43:06 +00:00
Marc G. Fournier d611b07dd7 This is an attempt to get rid of some cruft...
According to man page under FreeBSD for sys_errlist[], strerror() should be
used instead...not sure if this will break other systems, so only changing
two files for now, and we'll see what "errors" it turns up
1997-03-18 21:40:41 +00:00
Marc G. Fournier dcd2332a4d Patch from Sven Verdoolaege <skimo@breughel.ufsia.ac.be> for large_objects 1997-03-18 21:30:41 +00:00
Marc G. Fournier 812a6c2b54 - Move most of the I/O in both libpq and the backend to a set
of common routines in pqcomprim.c (pq communication primitives).
    Not all adapted to it yet, but it's a start.

  - Rewritten some of those routines, to write/read bigger chunks of
    data, precomputing stuff in buffers instead of sending out byte
    by byte.

  - As a consequence, I need to know the endianness of the machine.
    Currently I rely on getting it from machine/endian.h, but this
    may not be available everywhere? (Who the hell thought it was
    a good idea to pass integers to the backend the other way around
    than the normal network byte order? *argl*)

  - Libpq looks in the environment for magic variables, and upon
    establishing a connection to the backend, sends it queries
    of the form "SET var_name TO 'var_value'". This needs a change
    in the backend parser (Mr. Parser, are you there? :)

  - Currently it looks for two Env-Vars, namely PG_DATEFORMAT
    and PG_FLOATFORMAT. What else makes sense? PG_TIMEFORMAT?
    PG_TIMEZONE?

From: "Martin J. Laubach" <mjl@wwx.vip.at>
1997-03-18 20:15:39 +00:00
Marc G. Fournier d146305065 Patches for Vadim's multikey indexing... 1997-03-18 18:41:37 +00:00
Marc G. Fournier b5e16b1869 Resync the source tree, commit some things that were missing (pqcomprim.c) and
bring in Thomas's updates for the date/time code...
1997-03-18 16:36:50 +00:00
Marc G. Fournier 4b4ac7c159 oracle_compat.c fixed for function overloading...
By: From: Edmund Mergl <mergl@nadia.s.bawue.de>
1997-03-16 20:40:52 +00:00
Marc G. Fournier 7cd394dc43 From: Thomas Lockhart <Thomas.G.Lockhart@jpl.nasa.gov>
Subject: [HACKERS] Patches for 970316 compilation

I made a small pre-emptive change in the new datetime code to eliminate
calls to infnan(). Hopefully this will make Solaris (and probably other
non-GNUlib) systems happier. Didn't find fe-connect.h in the 970316
distribution, so made one up. Also, one of the test routines needs an
update for the geo-decls.h -> geo_decls.h name change.
Patches appear below...
1997-03-16 19:05:00 +00:00
Marc G. Fournier a9049a4a28 Header file fixes for MINDOUBLE 1997-03-16 05:32:03 +00:00
Marc G. Fournier cddd68eb27 Add a conditional for <values.h> vs <limits.h> 1997-03-16 05:12:08 +00:00
Marc G. Fournier 7e8ee18346 Remove extra functions temporarily while a proper fix is found... 1997-03-16 01:17:49 +00:00
Marc G. Fournier e8466b034a Update oracle_compat.c 1997-03-15 06:00:19 +00:00
Marc G. Fournier 064466ad55 From: Massimo Dal Zotto <dz@cs.unitn.it>
Subject: [HACKERS] lock debug trace

This is an update to my previous patches for lock debugging, already applied
to the current sources. It adds some improvements in the output messages and
some more output in WaitOnLock(). I have used with success to trace a nasty
deadlock condition on pg_listener.
1997-03-15 01:23:58 +00:00
Marc G. Fournier 53d8be3bbf Date/Time updates from Thomas... 1997-03-14 23:21:12 +00:00
Marc G. Fournier 71fd8d4a4b > There are some minor fixes to the GEQO.
> Please apply them to the direcory "backend/optimizer/geqo".
> Two new files with different crossover techniques are included.
> Standard procedure is optimization by means of "geqo_erx.c"
> (Edge Recombination Crossover).

From: "Martin S. Utesch" <utesch@aut.tu-freiberg.de>
1997-03-14 16:03:02 +00:00
Marc G. Fournier f749fe4934 Last of Dan's hidden tar balls :) 1997-03-14 06:01:40 +00:00
Marc G. Fournier 94094c0569 Missed another tar file... :( 1997-03-14 05:58:13 +00:00
Marc G. Fournier 0889b17444 Missing bits from Dan's patches...sorry :( 1997-03-14 05:56:27 +00:00
Marc G. Fournier 071484c5d8 From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] timestamp type

OK, last one.  This patch adds an ANSI SQL 'timestamp' type.
1997-03-12 21:28:14 +00:00
Marc G. Fournier 3a7c93e7f3 From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] password authentication

This patch adds support for plaintext password authentication.  To use
it, you add a line like

host         all         0.0.0.0       0.0.0.0           password  pg_pwd.conf


to your pg_hba.conf, where 'pg_pwd.conf' is the name of a file containing
the usernames and password hashes in the format of the first two fields
of a Unix /etc/passwd file.  (Of course, you can use a specific database
name or IP instead.)

Then, to connect with a password through libpq, you use the PQconnectdb()
function, specifying the "password=" tag in the connect string and also
adding the tag "authtype=password".

I also added a command-line switch '-u' to psql that tells it to prompt
for a username and password and use password authentication.
1997-03-12 21:23:16 +00:00
Marc G. Fournier 5dde558ce6 From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] linux/alpha patches

These patches lay the groundwork for a Linux/Alpha port.  The port doesn't
actually work unless you tweak the linker to put all the pointers in the
first 32 bits of the address space, but it's at least a start.  It
implements the test-and-set instruction in Alpha assembly, and also fixes
a lot of pointer-to-integer conversions, which is probably good anyway.
1997-03-12 21:13:19 +00:00
Marc G. Fournier b66569e41f From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] linux/alpha patches

These patches lay the groundwork for a Linux/Alpha port.  The port doesn't
actually work unless you tweak the linker to put all the pointers in the
first 32 bits of the address space, but it's at least a start.  It
implements the test-and-set instruction in Alpha assembly, and also fixes
a lot of pointer-to-integer conversions, which is probably good anyway.
1997-03-12 21:00:17 +00:00
Marc G. Fournier 127826978a From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] equal column and table name patch

This fixes a bug where selects fail when there is a column with the same
name as the table it's a part of.
1997-03-12 20:51:33 +00:00
Marc G. Fournier e4949f9fe5 From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] better access control error messages

This patch replaces the 'no such class or insufficient privilege' with
distinct error messages that tell you whether the table really doesn't
exist or whether access was denied.
1997-03-12 20:48:48 +00:00
Marc G. Fournier c00c511b7b From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] backend Makefile patch

This patch cleans up backend/Makefile a little bit, and prevents it from
relinking the backend binary when no changes have been made.
1997-03-12 20:44:57 +00:00
Marc G. Fournier 51844146e5 From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] abort failed transaction patch

This patch allows you to end a transaction that has failed on an error
using the 'ABORT' statement without generating another error message.
(By default you get an error unless you use 'END' to terminate the
transaction, which has already been aborted anyway.)
1997-03-12 20:41:14 +00:00
Bruce Momjian ea36b0d3cd Add missing paren. 1997-03-10 15:08:57 +00:00
Marc G. Fournier 977654d55b Massimo's Deadlock patches w/o the #ifdefs 1997-03-10 00:18:09 +00:00
Bruce Momjian 766bdd2bb5 Vacuum cleanups from Massimo. 1997-03-09 23:29:15 +00:00
Bruce Momjian b913dd1f9e Add prototypes for oracle-compat functions. Rename geo-*.c adt to geo_*.c 1997-03-09 20:41:02 +00:00
Bruce Momjian d8023a00bd Fix vacuum crash Vadim found. 1997-03-09 07:12:36 +00:00
Bruce Momjian 22cabc5514 Reverse patch for Vadims problem. 1997-03-07 00:59:05 +00:00
Bruce Momjian da90363c12 Fix vacuum bug Vadim found with text fields. 1997-03-06 18:38:35 +00:00
Vadim B. Mikheev 74bd93d597 Not understandable fix of strange bug in vacuum statistic functions. 1997-03-06 11:41:09 +00:00
Marc G. Fournier 83978e1ea7 This is a set of single row character functions, defined for the datatype
text, which are supposed to behave exactly as their Oracle counterparts.

From: Edmund Mergl <E.Mergl@bawue.de>
1997-03-04 05:32:26 +00:00
Marc G. Fournier ed8b7bdff9 Patch from Martin due to changes in joinrels.c 1997-03-03 23:26:45 +00:00
Bruce Momjian 26eb44f202 Prevent SIGPIPE from crashing server, by Dan McGuirk. 1997-03-02 02:17:32 +00:00
Bruce Momjian 3ce0236c69 Apply date patch from tiemann@cygnus.com,Michael Tiemann. 1997-03-02 02:05:33 +00:00
Bruce Momjian 162c2a6e4c Remove _PAGE_SIZE_ as recommended by Darren King. 1997-03-02 01:34:50 +00:00
Bruce Momjian 34fd62c512 Remove case-sensitive identifiers. Thanks for Dan McGuirk for a reversal patch. 1997-03-02 01:03:44 +00:00