Commit Graph

1308 Commits

Author SHA1 Message Date
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 e3649e9e52 Various improvements to reduce questions :)
Remove USE_LOCALE from Makefile.global.in
Add USE_LOCALE to build/configure/config.h

Add check for BUILDRUN in configure to make sure that build is run before
configure
1997-04-03 21:26:36 +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 920c58df71 From: "Martin J. Laubach" <mjl@CSlab.tuwien.ac.at>
Subject: [HACKERS] libpq variable set patch

  Just a small change, so the automatic variable setting on
connection startup actually works...
1997-04-02 18:26:25 +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 17b5bd33e4 From: Anton de Wet <adw@obsidian.co.za>
Subject: [HACKERS] Small patch to pgtclCmds.c

Hi I have made the following small change to the extensions I made to
pgtclCmds.c quite a while ago.

At the moment there is a -assignbyidx option to pg_result assigning the
returned tuples to an array by using the 1st field of the select statement
as the key to the array.
eg "select name,age from vitalstatistics" will result in an array with

myarray(peter) = 32
myarray(paul)  = 45

Often I need to have a pseudo-multi dimentional
array eg. "select name,age from vitalstatistics where occupation='plummer'

I would like to be able to generate an array
newarray(peter,overpaid) = 32

So to add a arbitrary string to the key value I have extended

  pg_result $res -assignbyidx $arrayname

to have an optional argument

  pg_result $res -assignbyidx $arrayname $appendstr

So that that string is appended to the key value.
1997-04-02 18:16:49 +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 b5ee45e16d Manuals for SEQUENCEs. 1997-04-02 04:20:00 +00:00
Vadim B. Mikheev 2b788e0bf5 \h create/drop sequence. 1997-04-02 04:18:26 +00:00
Vadim B. Mikheev b259e454e7 Dumping sequence relations as 'CREATE SEQUENCE ...'. 1997-04-02 04:17:27 +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
Vadim B. Mikheev 6ec8d375f5 New node T_CreateSeqStmt. 1997-04-02 03:34:46 +00:00
Vadim B. Mikheev 46d11f314f New relkind ('S') for sequence relations.
New funcs (nextval & currval) in pg_proc.h
1997-04-02 03:29:37 +00:00
Vadim B. Mikheev 4d8e84155e Prototypes for sequence.c 1997-04-02 03:23:38 +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 dd07f76658 turn GEQO code on by default 1997-03-27 01:00:41 +00:00
Marc G. Fournier e3e725a47d Remove customize in favor of 'build' 1997-03-26 07:10:03 +00:00
Marc G. Fournier 17c4321411 Add ability to change installation directory in build, prior to configure 1997-03-26 06:54:01 +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 87bc5db412 '\h create index' shows that multi-column indices are available now. 1997-03-26 03:01:29 +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 0ccaaac169 another one missed 1997-03-25 09:44:33 +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