Default expectation safe interface. Equivalent to
with = withConfig defaultConfig
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
Moduletmp-postgres-1.35.0.0Haskell2010
This module provides functions for creating a temporary postgres instance.
By default it will create a temporary data directory and
a temporary directory for a UNIX domain socket for postgres to listen on in addition to
listening on 127.0.0.1 and ::1.
Here is an example using the expection safe with function:
with $ \db -> bracket
(PG.connectPostgreSQL (toConnectionString db))
PG.close $
\conn -> PG.execute_ conn "CREATE TABLE foo (id int)"
To extend or override the defaults use withConfig (or startConfig).
tmp-postgres ultimately calls initdb (optionally), postgres and
createdb (optionally).
All of the command line, environment variables and configuration files that are generated by default for the respective executables can be extended or overriden.
In general tmp-postgres is useful if you want a clean temporary
postgres and do not want to worry about clashing with an existing
postgres instance (or needing to ensure postgres is already running).
Here are some different use cases for tmp-postgres and their respective
configurations:
The default with and start functions can be used to make a sandboxed temporary database for testing.
By disabling initdb one could run a temporary
isolated postgres on a base backup to test a migration.
By using the stopPostgres and withRestart functions one can test backup strategies.
WARNING!
Ubuntu's PostgreSQL installation does not put initdb on the PATH. We need to add it manually.
The necessary binaries are in the /usr/lib/postgresql/VERSION/bin/ directory, and should be added to the PATH
echo "export PATH=$PATH:/usr/lib/postgresql/VERSION/bin/" >> /home/ubuntu/.bashrcpostgresDefault expectation safe interface. Equivalent to
with = withConfig defaultConfig
withConfig :: ConfigThe extra Config combined with the generated Config. See
startConfig for more info.
-> (DB -> IO a)action continuation.
-> IO (Either StartError a)Exception safe database create with options. See startConfig for more details. Calls stop even in the face of exceptions.
Exception safe version of restart.
The default configuration. This will create a database called "postgres"
via initdb (it's default behavior).
It will create a temporary directory for the data and a temporary directory
for a unix socket and listen on 127.0.0.1 and ::1 on a random port.
Additionally it will use the following "postgresql.conf"
which is optimized for performance.
shared_buffers = 12MB
fsync = off
synchronous_commit = off
full_page_writes = off
log_min_messages = PANIC
log_min_error_statement = PANIC
log_statement = none
client_min_messages = ERROR
commit_delay = 100000
wal_level = minimal
archive_mode = off
max_wal_senders = 0
defaultConfig also passes the --no-sync flag to initdb.
If you would like to customize this behavior you can start with the defaultConfig and overwrite fields or combine a defaultConfig with another Config using <> (mappend).
Alternatively you can eschew defaultConfig altogether, however
your postgres might start and run faster if you use
defaultConfig.
The defaultConfig redirects all output to /dev/null. See
verboseConfig for a version that logs more output.
To append additional lines to "postgresql.conf" file create a custom Config like the following.
custom = defaultConfig <> mempty
{ postgresConfigFile =
[ ("wal_level", "replica")
, ("archive_mode", "on")
, ("max_wal_senders", "2")
, ("fsync", "on")
, ("synchronous_commit", "on")
]
}
As an alternative to using defaultConfig one could create a config from connections parameters using optionsToDefaultConfig.
Default configuration for PostgreSQL versions 9.3 and greater but less than 10.
If you get an error that "--no-sync" is an invalid parameter then you should use this config.
This is similar to defaultConfig but it logs as much as possible..
autoExplainConfig A config which loads and configures auto_explain. Useful for
understanding slow queries plans.
Attempt to create a Config from a Options. Useful if you want to create a database
owned by a specific user you will also login with
with a specific name (i.e. not the default name, "postgres")
among other use cases. Changing the connectionOptions field of Config does not achieve these results and you are likely to see unexpected behaviour if you try to.
Handle for holding temporary resources, the postgres process handle
and postgres connection information. The DB also includes the
final plan used to start initdb, createdb and
postgres.
Convert a DB to a connection string. Alternatively one can access the Options using toConnectionOptions.
Access the data directory. This was either generated or specified explicitly when creating the Config
Get the directory that is used to create other temporary directories
Get the final postgresql.conf
Make the data directory permanent. Useful for debugging. If you are using with or withConfig this function will not modify the DB that is passed for cleanup. You will need to setup your own bracket like
bracket (fmap makeDataDirectoryPermanent start) (either mempty stop)
Display a DB.
Default start behavior. Equivalent to calling startConfig with the defaultConfig.
Create zero or more temporary resources and use them to make a Config.
The passed in config is inspected and a generated config is created. The final config is built by
generated <> extra
Based on the value of socketDirectory a "postgresql.conf" is created with:
listen_addresses = '127.0.0.1, ::1'
unix_socket_directories = 'SOCKET_DIRECTORY'
Additionally the generated Config also:
Sets a connectionTimeout of one minute.
Redirects output to /dev/null.
All of these values can be overrided by the extra config.
The returned DB requires cleanup. startConfig should be used with a bracket and stop, e.g.
withConfig :: Config -> (DB -> IO a) -> IO (Either StartError a)
withConfig plan f = bracket (startConfig plan) (either mempty stop) $
either (pure . Left) (fmap Right . f)
or just use withConfig. If you are calling startConfig you probably want withConfig anyway.
Stop the postgres process and cleanup any temporary resources that
might have been created.
Restart the postgres from DB using the prior Config. This
will also start an instance previously stoppped with stopPostgres.
Only stop the postgres process but leave any temporary resources.
Useful for testing backup strategies when used in conjunction with
restart or withRestart.
with and related functions are fast by themselves but by utilizing various forms of caching we can make them much faster.
The slowest part of starting a new postgres cluster is the initdb
call which initializes the database files. However for a given initdb version and configuration parameters the output
is the same.
To take advantage of this idempotent behavior we can cache the output of
initdb and copy the outputted database cluster files instead of recreating
them. This leads to a 4x improvement in startup time.
See withDbCache and related functions for more details.
Additionally one can take snapshots of a database cluster and start
new postgres instances using the snapshot as an initial database
cluster.
This is useful if one has tests that require a time consuming migration process. By taking a snapshot after the migration we can start new isolated clusters from the point in time after the migration but before any test data has tainted the database.
See withSnapshot for details.
Equivalent to withDbCacheConfig with the CacheConfig defaultCacheConfig makes.
Here is an example using caching:
withDbCache $ \cache -> do
withConfig (cacheConfig cache) $ \db -> ...
withConfig (cacheConfig cache) $ \db -> ...
withDbCacheConfig :: CacheConfigConfiguration
-> (Cache -> IO a)action for which caching is enabled
-> IO aEnable initdb data directory caching. This can lead to a 4x speedup.
Exception safe version of setupInitDbCache. Equivalent to
withDbCacheConfig = bracket (setupInitDbCache config) cleanupInitDbCache
initdb cache configuration.Configuration for the initdb data directory cache.
CacheConfigcacheTemporaryDirectory :: FilePathRoot temporary directory used if cacheDirectoryType is set to
Temporary. /tmp is a good default.
cacheDirectoryType :: DirectoryTypeUsed to specify is a Permanent or Temporary directory should be
used. defaultCacheConfig uses Permanent ~/.tmp-postgres
by default.
cacheUseCopyOnWrite :: BoolSome operatoring system versions support flags for cp that allow
"copy on write" which is about 2x faster. defaultCacheConfig
attempts to determine if the cp on the path supports copy on write
and sets this to True if it does.
defaultCacheConfig attempts to determine if the cp on the path
supports "copy on write" flags and if it does, sets cacheUseCopyOnWrite
to True.
It sets cacheDirectoryType to Permanent ~/.tmp-postgres and
cacheTemporaryDirectory to /tmp (but this is not used when
Permanent is set).
initdb cache handle.A handle to cache temporary resources and configuration.
Generic CacheDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.InternalNFData CacheDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internaltype Rep Cache = D1 ('MetaData "Cache"
"Database.Postgres.Temp.Internal"
"tmp-postgres-1.35.0.0-8d3UBzJp08JWt8Eyo3xTt"
'False) (C1 ('MetaCons "Cache"
'PrefixI 'True) (S1 ('MetaSel ('Just "cacheResourcesCow"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "cacheResourcesDirectory"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CompleteDirectoryType)))Defined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.InternalHelper to make a Config out of caching info.
Setup the initdb cache folder.
Cleanup the cache directory if it was Temporary.
Exception safe method for taking a file system level copy of the database cluster.
Snapshots are useful if you would like to start every test from a migrated database and the migration process is more time consuming then copying the additional data.
Here is an example with caching and snapshots:
withDbCache $ \cache -> withConfig (cacheConfig cache) $ \db ->
migrate db
withSnapshot Temporary db $ \snapshot -> do
withConfig (snapshotConfig db) $ \migratedDb -> ...
withConfig (snapshotConfig db) $ \migratedDb -> ...
withConfig (snapshotConfig db) $ \migratedDb -> ...
The Snapshots are ephemeral. If you would like the Snapshots to persistent consider using cacheAction instead.
A type to track a possibly temporary snapshot directory
Generic SnapshotDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.InternalNFData SnapshotDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internaltype Rep Snapshot = D1 ('MetaData "Snapshot"
"Database.Postgres.Temp.Internal"
"tmp-postgres-1.35.0.0-8d3UBzJp08JWt8Eyo3xTt"
'True) (C1 ('MetaCons "Snapshot"
'PrefixI 'True) (S1 ('MetaSel ('Just "unSnapshot"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CompleteDirectoryType)))Defined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.InternalConvert a snapshot into a Config that includes a copyConfig for copying the snapshot directory to a temporary directory.
takeSnapshot :: DBThe handle. The postgres is shutdown and the data directory is copied.
-> IO (Either StartError Snapshot)Shutdown the database and copy the directory to a folder.
Cleanup any temporary resources used for the snapshot.
cacheAction Check to see if a cached data directory exists.
If the file path does not exist the initial config is used to start a postgres
instance. After which the action is applied, the data directory is cached
and postgres is shutdown.
cacheAction mappends a config to copy the cached data directory
on startup onto the initial config and returns it. In other words:
initialConfig <> configFromCachePath
cacheAction can be used to create a snapshot of migrated database and not remigrate as long as the migration does not change. See withSnapshot for a ephemeral version of taking snapshots.
You can nest calls to cacheAction and safe to call it from several threads. However cacheAction uses locks internal to prevent multiple threads from stomping on each other.
If one makes a nested call and accidently uses the same cache directory in both calls the calls will deadlock. If this occurs on the same thread RTS will throw an exception. However do not rely on this and just be careful to not reuse the same cache path when nesting calls.
There is no good reuse the cache path when nesting so one is unlikely to run into this.
A list of failures that can occur when starting. This is not and exhaustive list but covers the errors that the system catches for the user.
StartPostgresFailed ExitCodepostgres failed before a connection succeeded. Most likely this
is due to invalid configuration
InitDbFailedinitdb failed. This can be from invalid configuration or using a
non-empty data directory
CreateDbFailedcreatedb failed. This can be from invalid configuration or
the database might already exist.
PlanFailed String [String]CompleteProcessConfigFailed String [String]The Database.Postgres.Temp.Config.ProcessConfig was missing info and a
CompleteProcessConfig could not be created.
ConnectionTimedOutTimed out waiting for postgres to accept a connection
DeleteDbError SqlErrorEmptyDataDirectoryThis will happen if a Database.Postgres.Temp.Config.Plan is missing a
Database.Postgres.Temp.Config.initDbConfig.
CopyCachedInitDbFailed String ExitCodeThis is called if copying a folder cache fails.
FailedToFindDataDirectory StringFailed to find a data directory when trying to get
a cached initdb folder.
SnapshotCopyFailed String ExitCodeWe tried to copy a data directory to a snapshot folder and it failed
Eq StartErrorDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.CoreShow StartErrorDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.CoreException StartErrorDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.CoreThe high level options for overriding default behavior.
Configlogger :: Last LoggerInternal Event logger.
initDbConfig :: Accum ProcessConfigMonoid for accumulating initdb configuration.
copyConfig :: Last (Maybe CopyDirectoryCommand)An optional data directory copy command.
createDbConfig :: Accum ProcessConfigMonoid for accumulating createdb configuration.
postgresConfig :: ProcessConfigThe postgres process configuration.
connectionOptions :: OptionsThe additional client connection options.
postgresConfigFile :: [(String, String)]The postgresql.conf configuration file.
connectionTimeout :: Last IntThe amount of microseconds to attempt to connect
to postgres before throwing ConnectionTimedOut
socketDirectory :: DirectoryTypeOverride the default temporary UNIX socket directory by setting this.
dataDirectory :: DirectoryTypeOverride the default temporary data directory by passing in
Permanent DIRECTORY.
port :: Last (Maybe Int)temporaryDirectory :: Last FilePathThe directory used to create other temporary directories. Defaults
to /tmp.
initDbCache :: Last (Maybe (Bool, FilePath))Generic ConfigDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigSemigroup ConfigDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigMonoid ConfigDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigPretty ConfigDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.Configtype Rep Config = D1 ('MetaData "Config"
"Database.Postgres.Temp.Internal.Config"
"tmp-postgres-1.35.0.0-8d3UBzJp08JWt8Eyo3xTt"
'False) (C1 ('MetaCons "Config"
'PrefixI 'True) (((S1 ('MetaSel ('Just "logger"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last Logger)) :*: (S1 ('MetaSel ('Just "initDbConfig"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Accum ProcessConfig)) :*: S1 ('MetaSel ('Just "copyConfig"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last (Maybe CopyDirectoryCommand))))) :*: (S1 ('MetaSel ('Just "createDbConfig"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Accum ProcessConfig)) :*: (S1 ('MetaSel ('Just "postgresConfig"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ProcessConfig) :*: S1 ('MetaSel ('Just "connectionOptions"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Options)))) :*: ((S1 ('MetaSel ('Just "postgresConfigFile"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(String, String)]) :*: (S1 ('MetaSel ('Just "connectionTimeout"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last Int)) :*: S1 ('MetaSel ('Just "socketDirectory"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DirectoryType))) :*: ((S1 ('MetaSel ('Just "dataDirectory"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DirectoryType) :*: S1 ('MetaSel ('Just "port"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last (Maybe Int)))) :*: (S1 ('MetaSel ('Just "temporaryDirectory"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last FilePath)) :*: S1 ('MetaSel ('Just "initDbCache"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last (Maybe (Bool, FilePath)))))))))Defined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigDisplay a Config.
Process configuration
ProcessConfigenvironmentVariables :: EnvironmentVariablesA monoid for combine environment variables or replacing them. for the maps the Dual monoid is used. So the last key wins.
commandLine :: CommandLineArgsA monoid for combine command line Args or replacing them.
stdIn :: Last HandleA monoid for configuring the standard input Handle.
stdOut :: Last HandleA monoid for configuring the standard output Handle.
stdErr :: Last HandleA monoid for configuring the standard error Handle.
createGroup :: AnyA monoid for combining boolean create process group flag. The first True value wins.
Eq ProcessConfigDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigShow ProcessConfigDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigGeneric ProcessConfigDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigSemigroup ProcessConfigDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigMonoid ProcessConfigDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigPretty ProcessConfigDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.Configtype Rep ProcessConfig = D1 ('MetaData "ProcessConfig"
"Database.Postgres.Temp.Internal.Config"
"tmp-postgres-1.35.0.0-8d3UBzJp08JWt8Eyo3xTt"
'False) (C1 ('MetaCons "ProcessConfig"
'PrefixI 'True) ((S1 ('MetaSel ('Just "environmentVariables"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 EnvironmentVariables) :*: (S1 ('MetaSel ('Just "commandLine"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CommandLineArgs) :*: S1 ('MetaSel ('Just "stdIn"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last Handle)))) :*: (S1 ('MetaSel ('Just "stdOut"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last Handle)) :*: (S1 ('MetaSel ('Just "stdErr"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last Handle)) :*: S1 ('MetaSel ('Just "createGroup"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Any)))))Defined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigThe environment variables can be declared to inherit from the running process or they can be specifically added.
Eq EnvironmentVariablesDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigShow EnvironmentVariablesDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigGeneric EnvironmentVariablesDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigSemigroup EnvironmentVariablesDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigMonoid EnvironmentVariablesDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigPretty EnvironmentVariablesDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.Configtype Rep EnvironmentVariables = D1 ('MetaData "EnvironmentVariables"
"Database.Postgres.Temp.Internal.Config"
"tmp-postgres-1.35.0.0-8d3UBzJp08JWt8Eyo3xTt"
'False) (C1 ('MetaCons "EnvironmentVariables"
'PrefixI 'True) (S1 ('MetaSel ('Just "inherit"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last Bool)) :*: S1 ('MetaSel ('Just "specific"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map String String))))Defined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigA type to help combine command line Args.
Eq CommandLineArgsDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigShow CommandLineArgsDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigGeneric CommandLineArgsDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigSemigroup CommandLineArgsDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigMonoid CommandLineArgsDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigPretty CommandLineArgsDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.Configtype Rep CommandLineArgs = D1 ('MetaData "CommandLineArgs"
"Database.Postgres.Temp.Internal.Config"
"tmp-postgres-1.35.0.0-8d3UBzJp08JWt8Eyo3xTt"
'False) (C1 ('MetaCons "CommandLineArgs"
'PrefixI 'True) (S1 ('MetaSel ('Just "keyBased"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map String (Maybe String))) :*: S1 ('MetaSel ('Just "indexBased"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Int String))))Defined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigEq DirectoryTypeDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigOrd DirectoryTypeDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigShow DirectoryTypeDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigSemigroup DirectoryTypeDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigTakes the last Permanent value.
Monoid DirectoryTypeDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigPretty DirectoryTypeDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigA type to track whether a file is temporary and needs to be cleaned up.
Eq CompleteDirectoryTypeDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigOrd CompleteDirectoryTypeDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigShow CompleteDirectoryTypeDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigGeneric CompleteDirectoryTypeDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigNFData CompleteDirectoryTypeDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigPretty CompleteDirectoryTypeDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.Configtype Rep CompleteDirectoryType = D1 ('MetaData "CompleteDirectoryType"
"Database.Postgres.Temp.Internal.Config"
"tmp-postgres-1.35.0.0-8d3UBzJp08JWt8Eyo3xTt"
'False) (C1 ('MetaCons "CPermanent"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)) :+: C1 ('MetaCons "CTemporary"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)))Defined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigFunctor AccumDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigApplicative AccumDefined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigEq a => Eq (Accum a)Defined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigOrd a => Ord (Accum a)Defined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigShow a => Show (Accum a)Defined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigSemigroup a => Semigroup (Accum a)Defined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigMonoid a => Monoid (Accum a)Defined in tmp-postgres-1.35.0.0 · Database.Postgres.Temp.Internal.ConfigA way to log internal Events
Internal events for debugging
StartPlan StringThe first event. This useful for debugging
what is actual passed to the initdb, createdb and
postgres.
StartPostgresThe second event. Postgres is about to get called
WaitForDBThe third event. Postgres started. We are now about to setup a reconnect loop (racing with a process checker)
TryToConnectThe fourth event and (possibly all subsequent events).
We are looping trying to successfully connect to the postgres
process.