1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Add transcendental math functions (sine, cosine, etc)

Add a random number generator and seed setter (random(), SET SEED)
Fix up the interval*float8 math to carry partial months
 into the time field.
Add float8*interval so we have symmetry in the available math.
Fix the parser and define.c to accept SQL92 types as field arguments.
Fix the parser to accept SQL92 types for CREATE TYPE, etc. This is
 necessary to allow...
Bit/varbit support in contrib/bit cleaned up to compile and load
 cleanly. Still needs some work before final release.
Implement the "SOME" keyword as a synonym for "ANY" per SQL92.
Implement ascii(text), ichar(int4), repeat(text,int4) to help
 support the ODBC driver.
Enable the TRUNCATE() function mapping in the ODBC driver.
This commit is contained in:
Thomas G. Lockhart
2000-04-07 13:40:45 +00:00
parent 1b992b468b
commit a349733bbb
14 changed files with 639 additions and 196 deletions

View File

@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.32 2000/03/17 05:29:04 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.33 2000/04/07 13:39:24 thomas Exp $
*
*-------------------------------------------------------------------------
*/
@ -93,6 +93,9 @@ static bool parse_max_expr_depth(char *);
static bool show_XactIsoLevel(void);
static bool reset_XactIsoLevel(void);
static bool parse_XactIsoLevel(char *);
static bool parse_random_seed(char *);
static bool show_random_seed(void);
static bool reset_random_seed(void);
/*
* get_token
@ -1066,6 +1069,41 @@ reset_pg_options(void)
}
/*
* Random number seed
*/
static bool
parse_random_seed(char *value)
{
double seed = 0;
if (value == NULL)
reset_random_seed();
else
{
sscanf(value, "%lf", &seed);
setseed(&seed);
}
return (TRUE);
}
static bool
show_random_seed(void)
{
elog(NOTICE, "Seed for random number generator is not known");
return (TRUE);
}
static bool
reset_random_seed(void)
{
double seed = 0.5;
setseed(&seed);
return (TRUE);
}
/*-----------------------------------------------------------------------*/
static struct VariableParsers
@ -1155,6 +1193,9 @@ static struct VariableParsers
{
"pg_options", parse_pg_options, show_pg_options, reset_pg_options
},
{
"seed", parse_random_seed, show_random_seed, reset_random_seed
},
{
NULL, NULL, NULL, NULL
}