Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
8de20a3a
Commit
8de20a3a
authored
27 years ago
by
Thomas G. Lockhart
Browse files
Options
Downloads
Patches
Plain Diff
Use environment variable PGDATESTYLE on backend startup to initialize
date/time formats and conventions.
parent
a58825a4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backend/tcop/postgres.c
+33
-4
33 additions, 4 deletions
src/backend/tcop/postgres.c
with
33 additions
and
4 deletions
src/backend/tcop/postgres.c
+
33
−
4
View file @
8de20a3a
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.5
6
1997/12/1
1
1
7:36:42 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.5
7
1997/12/1
6
1
5:57:00 thomas
Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
...
...
@@ -854,6 +854,7 @@ PostgresMain(int argc, char *argv[])
Dlelem
*
curr
;
int
status
;
char
*
DBDate
=
NULL
;
extern
int
optind
;
extern
char
*
optarg
;
extern
short
DebugLvl
;
...
...
@@ -882,6 +883,10 @@ PostgresMain(int argc, char *argv[])
* parse command line arguments
* ----------------
*/
/*
* Set default values.
*/
flagC
=
flagQ
=
flagE
=
flagEu
=
ShowStats
=
0
;
ShowParserStats
=
ShowPlannerStats
=
ShowExecutorStats
=
0
;
#ifdef LOCK_MGR_DEBUG
...
...
@@ -893,9 +898,33 @@ PostgresMain(int argc, char *argv[])
* NULL means Unix-socket only
*/
hostName
=
getenv
(
"PGHOST"
);
DataDir
=
getenv
(
"PGDATA"
);
/*
* Try to get initial values for date styles and formats.
* Does not do a complete job, but should be good enough for backend.
* Cannot call parse_date() since palloc/pfree memory is not set up yet.
*/
DBDate
=
getenv
(
"PGDATESTYLE"
);
if
(
DBDate
!=
NULL
)
{
if
(
strcasecmp
(
DBDate
,
"ISO"
)
==
0
)
DateStyle
=
USE_ISO_DATES
;
else
if
(
strcasecmp
(
DBDate
,
"SQL"
)
==
0
)
DateStyle
=
USE_SQL_DATES
;
else
if
(
strcasecmp
(
DBDate
,
"POSTGRES"
)
==
0
)
DateStyle
=
USE_POSTGRES_DATES
;
else
if
(
strcasecmp
(
DBDate
,
"GERMAN"
)
==
0
)
{
DateStyle
=
USE_GERMAN_DATES
;
EuroDates
=
TRUE
;
}
DataDir
=
getenv
(
"PGDATA"
);
/* default */
multiplexedBackend
=
false
;
/* default */
if
(
strcasecmp
(
DBDate
,
"NONEURO"
)
==
0
)
EuroDates
=
FALSE
;
else
if
(
strcasecmp
(
DBDate
,
"EURO"
)
==
0
)
EuroDates
=
TRUE
;
}
multiplexedBackend
=
false
;
while
((
flag
=
getopt
(
argc
,
argv
,
"B:bCD:d:Eef:iK:Lm:MNo:P:pQS:st:x:F"
))
!=
EOF
)
...
...
@@ -1343,7 +1372,7 @@ PostgresMain(int argc, char *argv[])
if
(
IsUnderPostmaster
==
false
)
{
puts
(
"
\n
POSTGRES backend interactive interface"
);
puts
(
"$Revision: 1.5
6
$ $Date: 1997/12/1
1
1
7:36:42
$"
);
puts
(
"$Revision: 1.5
7
$ $Date: 1997/12/1
6
1
5:57:00
$"
);
}
/* ----------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment