!E5~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     None"#%*0479;<MPSX_L( tmp-postgres] is the low level configuration necessary for initializing a database cluster starting postgres@ and creating a database. There is no validation done on the H. It is recommend that one use the higher level functions such as . which will generate plans that are valid. ^s are used internally but are exposed if the higher level plan generation is not sufficent. tmp-postgresThe output of calling >. tmp-postgresConnection options tmp-postgrespostgres process handle tmp-postgres is used be > to start the postgres# and then attempt to connect to it. tmp-postgresThe process config for postgres tmp-postgres(Connection options. Used to verify that postgres is ready. tmp-postgresc contains the configuration necessary for starting a process. It is essentially a stripped down . tmp-postgresEnvironment variables tmp-postgresCommand line arguements tmp-postgresThe  for standard input tmp-postgresThe  for standard output tmp-postgresThe  for standard error  tmp-postgresA way to log internal .s tmp-postgresA 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.  tmp-postgrespostgresZ failed before a connection succeeded. Most likely this is due to invalid configuration! tmp-postgresinitdbV failed. This can be from invalid configuration or using a non-empty data directory" tmp-postgrescreatedbW failed. This can be from invalid configuration or the database might already exist.# tmp-postgresThe ! was missing info and a complete  could not be created.$ tmp-postgresThe  was missing info and a  could not be created.% tmp-postgresTimed out waiting for postgres to accept a connection' tmp-postgresThis will happen if a  is missing a  .( tmp-postgres/This is called if copying a folder cache fails.) tmp-postgres?Failed to find a data directory when trying to get a cached initdb folder.* tmp-postgresDWe tried to copy a data directory to a snapshot folder and it failed.  tmp-postgresInternal events for debugging/ tmp-postgresKThe first event. This useful for debugging what is actual passed to the initdb, createdb and postgres.0 tmp-postgres1The second event. Postgres is about to get called1 tmp-postgresnThe third event. Postgres started. We are now about to setup a reconnect loop (racing with a process checker)2 tmp-postgresmThe fourth event and (possibly all subsequent events). We are looping trying to successfully connect to the postgres process.4 tmp-postgrespostgres< is not ready until we are able to successfully connect. 4^ attempts to connect over and over again and returns after the first successful connection.8 tmp-postgres-Start a process interactively and return the 9 tmp-postgresStop a . An alias for : tmp-postgres7Start a process and block until it finishes return the .; tmp-postgres7Start a process and block until it finishes return the  and the stderr output.= tmp-postgres Stop the postgres> process after attempting to terminate all the connections.> tmp-postgres Start the postgresq process and block until a successful connection occurs. A separate thread we continously check to see if the postgres process has crashed.A tmp-postgresCall createdbE and tee the output to return if there is an an exception. Throws ".B tmp-postgresB optionally calls initdb, optionally calls createdb and unconditionally calls postgresQ. Additionally it writes a "postgresql.conf" and does not return until the postgres process is ready. See > for more details.C tmp-postgres Stop the postgres process. See = for more details.8 tmp-postgres Process name tmp-postgresProcess config: tmp-postgres Process name tmp-postgresProcess config; tmp-postgres Process name tmp-postgresProcess configD   *)('&%$#"! -,+.210/3456789:;<=>?@ABCD.210/*)('&%$#"! -,+3456789:;<=>?  @A BCNone"#%*0479;<MPSX_5R  tmp-postgresR[ holds a description of the temporary folders (if there are any) and includes the final  that can be used with B . See # for an example of how to create a R.T tmp-postgresFinal . See B for information on s.U tmp-postgresDThe used to potentially cleanup the temporary unix socket directory.V tmp-postgresDThe data directory. Used to track if a temporary directory was used.W tmp-postgresNThe directory where other temporary directories are created. Usually @/tmp.Y tmp-postgres1Copy command used to create a data directory. If initdb? used to create the data directory directly this is not needed.If \ is Nothing then the i$ (which might be generated) is used.^ tmp-postgres7The high level options for overriding default behavior.` tmp-postgres Internal . logger.a tmp-postgresMonoid for accumulating initdb configuration.b tmp-postgres(An optional data directory copy command.c tmp-postgresMonoid for accumulating createdb configuration.d tmp-postgresThe postgres process configuration.e tmp-postgres)The additional client connection options.f tmp-postgresThe postgresql.conf configuration file.g tmp-postgres7The amount of microseconds to attempt to connect to postgres before throwing %h tmp-postgresEOverride the default temporary UNIX socket directory by setting this.i tmp-postgres=Override the default temporary data directory by passing in n  DIRECTORY.j tmp-postgres)A monoid for using an existing port (via    PORT_NUMBER$) or requesting a free port (via a !).k tmp-postgresIThe directory used to create other temporary directories. Defaults to /tmp.m  tmp-postgresUsed to specify a o1 folder that is automatically cleaned up or a n1 folder which is not automatically cleaned up.n tmp-postgres.A permanent file that should not be generated.o tmp-postgres)A temporary file that needs to generated.p  tmp-postgresGA type to track whether a file is temporary and needs to be cleaned up.s  tmp-postgresProcess configurationu tmp-postgresRA monoid for combine environment variables or replacing them. for the maps the "& monoid is used. So the last key wins.v tmp-postgres9A monoid for combine command line Args or replacing them.w tmp-postgres,A monoid for configuring the standard input .x tmp-postgres-A monoid for configuring the standard output .y tmp-postgres,A monoid for configuring the standard error .z  tmp-postgres)A type to help combine command line Args.| tmp-postgresArgs of the form -h foo,  --host=foo and --switch. The key is #|ed with value so the key should include the space or equals (as shown in the first two examples respectively). The "% monoid is used so the last key wins.} tmp-postgres=Args that appear at the end of the key based Args. The "% monoid is used so the last key wins.~  tmp-postgresvThe environment variables can be declared to inherit from the running process or they can be specifically added. tmp-postgres is a monoid.It's $' behavior is analogous to 1 and 0 with % . Think of  as 1 and  as 0.The behavior of  is like  s.  tmp-postgres4Combine the current environment (if indicated by  ) with .  tmp-postgresThis convert the z to '[String]'.  tmp-postgresThe  sets the handles to &, ' and (D and inherits the environment variables from the calling process.  tmp-postgresA global reference to  /dev/null .  tmp-postgres sets the handles to  /dev/nullD and inherits the environment variables from the calling process.  tmp-postgresTurn a s into a s%. Fails if any values are missing.  tmp-postgresGet the file path of a p, regardless if it is a q or r type. tmp-postgresEither create arC directory or do create the directory if it does not exist to a q one. tmp-postgresEither remove a r directory or do nothing to a q one. tmp-postgresTurn a ^ into a %. Fails if any values are missing. tmp-postgresTurn a ^ into a ". Fails if any values are missing. tmp-postgres Create a ^9 that sets the command line options of all processes (initdb, postgres and createdb ). This the  generated# plan that is combined with the extra plan from  . tmp-postgres*Create all the temporary resources from a ^. This also combines the ^ from  with the extra ^ passed in. tmp-postgres(Free the temporary resources created by .  tmp-postgres Display a ^.  tmp-postgres Make the V q" so it will not get cleaned up. tmp-postgres"Attempt to create a config from a ). This is useful if want to create a database owned by a specific user you will also log in as among other use cases. It is possible some )S are not supported so don't hesitate to open an issue on github if you find one. tmp-postgreso as * tmp-postgresTakes the last n value. tmp-postgres!Temporary directory configuration tmp-postgresDirectory pattern tmp-postgresMake initdb options. tmp-postgresMake createdb options. tmp-postgres The port. tmp-postgresSocket directory. tmp-postgresThe postgres data directory. tmp-postgresextra ^ to # after the  generated ^.aRSTVUXWYZ]\[^_lkihbfgcdea`jmonprqstwvuyxz{}|~a~z{}|stwvuyxprqmon^_lkihbfgcdea`jYZ]\[RSTVUXWNone"#%*0479;<MPSX_/, tmp-postgres7A type to track a possibly temporary snapshot directory tmp-postgres8A handle to cache temporary resources and configuration. tmp-postgresConfiguration for the initdb data directory cache. tmp-postgres!Root temporary directory used if  is set to o. /tmp is a good default. tmp-postgresUsed to specify is a n or o directory should be used.   uses n ~/.tmp-postgres by default. tmp-postgres3Some operatoring system versions support flags for cp9 that allow "copy on write" which is about 2x faster.  ! attempts to determine if the cp8 on the path supports copy on write and sets this to + if it does.  tmp-postgres,Handle for holding temporary resources, the postgres process handle and postgres connection information. The / also includes the final plan used to start initdb, createdb and postgres. tmp-postgres"Temporary resources and the final . tmp-postgrespostgres+ process handle and the connection options.  tmp-postgres Convert a = to a connection string. Alternatively one can access the ) using .  tmp-postgres Convert a  to a connection ) type.  tmp-postgresbAccess the data directory. This was either generated or specified explicitly when creating the ^ tmp-postgresJMake the data directory permanent. Useful for debugging. If you are using  or # this function will not modify the I that is passed for cleanup. You will need to setup your own bracket like bracket (fmap  ) (either mempty )   tmp-postgresDGet the directory that is used to create other temporary directories tmp-postgresGet the final postgresql.conf tmp-postgresThe fastest config we can make. 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  tmp-postgresPThe 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  also passes the  --no-sync flag to initdb.DIf you would like to customize this behavior you can start with the # and overwrite fields or combine a  with another ^ using $ (#).Alternatively you can eschew  altogether, however your postgres' might start and run faster if you use .The  redirects all output to  /dev/null. See % for a version that logs more output.ETo append additional lines to "postgresql.conf" file create a custom ^ like the following. %custom = defaultConfig <> mempty { f = [ ("wal_level, "replica") , ("archive_mode", on") , ("max_wal_senders", "2") , ("fsync", "on") , ("synchronous_commit", "on") ] } This is common enough there is  which is a helper to do this.As an alternative to using > one could create a config from connections parameters using . tmp-postgresODefault 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. tmp-postgres# the  with a ^D that provides additional "postgresql.conf" lines. Equivalent to:  extra =  <> mempty { f = extra }  tmp-postgresDefault postgres options tmp-postgresThis is similar to " but it logs as much as possible.. tmp-postgres?Create zero or more temporary resources and use them to make a ^.aThe passed in config is inspected and a generated config is created. The final config is built by  generated $ extra Based on the value of h% a "postgresql.conf" is created with: Qlisten_addresses = '127.0.0.1, ::1' unix_socket_directories = 'SOCKET_DIRECTORY' Additionally the  generated ^ also:Sets a g of one minute.Redirects output to  /dev/null.,All of these values can be overrided by the extra config. The returned  requires cleanup.  should be used with a , and , e.g.  :: ^ -> ( -> IO a) -> IO (Either  a)  plan f = , ( plan) (either mempty ,) $ either (pure . Left) (fmap Right . f)  or just use . If you are calling  you probably want  anyway. tmp-postgres.Default start behavior. Equivalent to calling  with the .  tmp-postgres Stop the postgresM process and cleanup any temporary resources that might have been created.  tmp-postgresOnly stop the postgresu process but leave any temporary resources. Useful for testing backup strategies when used in conjunction with  or . tmp-postgresOnly stop the postgres> process but leave any temporary resources. In contrast to  this function makes sure postgres; has time to properly write files to the data directory.  tmp-postgres Restart the postgres from  using the prior ^?. This will also start an instance previously stoppped with . tmp-postgres1Exception safe database create with options. See  for more details. Calls  even in the face of exceptions. tmp-postgres1Default expectation safe interface. Equivalent to  =     tmp-postgresException safe version of . tmp-postgresAttempt to create a ^ from a )x. Useful if you want to create a database owned by a specific user you will also login with among other use cases.  tmp-postgres Display a . tmp-postgresA bool that is + if the cp/ on the path supports "copy on write" flags.  tmp-postgres  attempts to determine if the cpA on the path supports "copy on write" flags and if it does, sets  to +.It sets  to n ~/.tmp-postgres and  to /tmp (but this is not used when n is set).  tmp-postgres Setup the initdb cache folder.  tmp-postgres&Cleanup the cache directory if it was o.  tmp-postgresEnable initdb7 data directory caching. This can lead to a 4x speedup.Exception safe version of  . Equivalent to   = bracket (  config)    tmp-postgresEquivalent to   with the    makes.!Here is an example using caching: uwithDbCache $ \cache -> do withCache (cacheConfig cache) $ \db -> ... withCache (cacheConfig cache) $ \db -> ...  tmp-postgresHelper to make a ^ out of caching info. tmp-postgres9Shutdown the database and copy the directory to a folder. tmp-postgres6Cleanup any temporary resources used for the snapshot. tmp-postgresRException 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 's are ephemeral. If you would like the s to persistent consider using  instead. tmp-postgresConvert a snapshot into a ^ that includes a b= for copying the snapshot directory to a temporary directory. tmp-postgres/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. #As a config to copy the cached data directory on startup onto the initial' config and returns it. In other words: %initialConfig <> configFromCachePath w can be used to create a snapshot of migrated database and not remigrate as long as the migration does not change. See - for a ephemeral version of taking snapshots. tmp-postgresextra configuration that is #ed last to the generated ^.  generated $ extra. tmp-postgresThe extra ^ combined with the  generated ^. See  for more info. tmp-postgresaction continuation. tmp-postgresaction continuation.  tmp-postgres Configuration tmp-postgres#action for which caching is enabled tmp-postgresThe handle. The postgres. is shutdown and the data directory is copied. tmp-postgres%Location of the data directory cache. tmp-postgresaction to cache. tmp-postgresinitial ^.5     5     None"#%*0479;<MPSX_2Re !"#$%&'()*+,-./012^_j`aedcgfbhiklmnopqrstxyuvwz{|}~    e     !"#$%&'()*+,-^_j`aedcgfbhiklstxyuvw~z{|}mnopqr./012-    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWWXYZ[\]]^_`aab cdefghijklmnopqrstuvwxyyz{||}~       !"#"$%&'(')'*+,-"./01234,tmp-postgres-1.30.0.1-IDOJEBBQePw1dzMyoRf7hQ$Database.Postgres.Temp.Internal.Core&Database.Postgres.Temp.Internal.ConfigDatabase.Postgres.Temp.InternalDatabase.Postgres.TempstartDatabase.Postgres.Temp.ConfigPlan ProcessConfig initDbConfig startConfigcompletePlanLoggercompletePlanInitDbcompletePlanCopycompletePlanCreateDbcompletePlanPostgrescompletePlanConfigcompletePlanDataDirectorycompletePlanConnectionTimeoutCompleteCopyDirectoryCommandcopyDirectoryCommandSrccopyDirectoryCommandDstcopyDirectoryCommandCowPostgresProcesspostgresProcessClientOptionspostgresProcessHandleCompletePostgresPlan!completePostgresPlanProcessConfig!completePostgresPlanClientOptionsCompleteProcessConfigcompleteProcessConfigEnvVarscompleteProcessConfigCmdLinecompleteProcessConfigStdIncompleteProcessConfigStdOutcompleteProcessConfigStdErrLogger StartErrorStartPostgresFailed InitDbFailedCreateDbFailed PlanFailedCompleteProcessConfigFailedConnectionTimedOut DeleteDbErrorEmptyDataDirectoryCopyCachedInitDbFailedFailedToFindDataDirectorySnapshotCopyFailedstartErrorStdOutstartErrorStdErrstartErrorExitCodeEvent StartPlan StartPostgres WaitForDB TryToConnectthrowIfNotSuccess waitForDB teeHandle prettyHandle prettyKeyPair startProcess stopProcessexecuteProcessexecuteProcessAndTee prettyOptionsstopPostgresProcessstartPostgresProcess executeInitDbexecuteCopyDirectoryCommandexecuteCreateDb startPlanstopPlan $fShowEvent$fExceptionStartError$fPrettyCompleteProcessConfig$fPrettyCompletePostgresPlan$fPrettyPostgresProcess$$fPrettyCompleteCopyDirectoryCommand $fPrettyPlan $fEqEvent $fOrdEvent$fShowStartError$fEqStartError"$fShowCompleteCopyDirectoryCommand $fEqCompleteCopyDirectoryCommand!$fOrdCompleteCopyDirectoryCommand Resources resourcesPlanresourcesSocketDirectoryresourcesDataDirresourcesTemporaryDirresourcesInitDbCacheCopyDirectoryCommandsourceDirectorydestinationDirectoryuseCopyOnWriteConfiglogger copyConfigcreateDbConfigpostgresConfigconnectionOptionspostgresConfigFileconnectionTimeoutsocketDirectory dataDirectoryporttemporaryDirectory initDbCache DirectoryType Permanent TemporaryCompleteDirectoryType CPermanent CTemporaryenvironmentVariables commandLinestdInstdOutstdErrCommandLineArgskeyBased indexBasedEnvironmentVariablesinheritspecificAccumDontCareZlichMergegetAccum prettyMapcompleteEnvironmentVariablestakeWhileInSequencecompleteCommandLineArgsstandardProcessConfigdevNullsilentProcessConfigaddErrorContext getOptioncompleteProcessConfig toFilePath makePermanentfixPathsetupDirectoryTypermDirIgnoreErrorscleanupDirectoryTypecompletePostgresPlan flattenConfig completePlan hasInitDb hasCreateDbsocketDirectoryToConfigcompleteCopyDirectorygetInitDbVersionmakeCommandLinemakeInitDbCommandLinemakeArgumentHash makeCachePath envsToKeepsplitDataDirectoryaddDataDirectory cachePlantoPlan setupConfig cleanupConfigprettyPrintConfigmakeResourcesDataDirPermanentoptionsToConfig optionsToPlanclientOptionsToPlan userToPlan dbnameToPlanpasswordToPlanhostToSocketClass $fMonoidAccum$fSemigroupAccum$fApplicativeAccum$fPrettyEnvironmentVariables$fMonoidEnvironmentVariables$fSemigroupEnvironmentVariables$fPrettyCommandLineArgs$fSemigroupCommandLineArgs$fPrettyProcessConfig$fPrettyCompleteDirectoryType$fMonoidDirectoryType$fSemigroupDirectoryType$fPrettyDirectoryType$fPrettyCopyDirectoryCommand$fPrettyConfig$fPrettyResources $fShowAccum $fEqAccum $fOrdAccum$fFunctorAccum$fGenericEnvironmentVariables$fShowEnvironmentVariables$fEqEnvironmentVariables$fGenericCommandLineArgs$fShowCommandLineArgs$fEqCommandLineArgs$fMonoidCommandLineArgs$fGenericProcessConfig$fEqProcessConfig$fShowProcessConfig$fSemigroupProcessConfig$fMonoidProcessConfig$fShowCompleteDirectoryType$fEqCompleteDirectoryType$fOrdCompleteDirectoryType$fGenericCompleteDirectoryType$fNFDataCompleteDirectoryType$fShowDirectoryType$fEqDirectoryType$fOrdDirectoryType$fShowCopyDirectoryCommand$fEqCopyDirectoryCommand$fOrdCopyDirectoryCommand$fGenericConfig$fSemigroupConfig$fMonoidConfigSnapshot unSnapshotCachecacheResourcesCowcacheResourcesDirectory CacheConfigcacheTemporaryDirectorycacheDirectoryTypecacheUseCopyOnWriteDB dbResourcesdbPostgresProcesstoConnectionStringtoConnectionOptionstoDataDirectorymakeDataDirectoryPermanenttoTemporaryDirectorytoPostgresqlConfigFilefastPostgresConfig defaultConfigdefaultConfig_9_3_10defaultPostgresConfverbosePostgresConfig verboseConfigstop stopPostgresstopPostgresGracefullyrestart withConfigwith withRestartoptionsToDefaultConfig prettyPrintDBcowCheckcpFlagsdefaultCacheConfigsetupInitDbCachecleanupInitDbCachewithDbCacheConfig withDbCache cacheConfig takeSnapshotcleanupSnapshot withSnapshotfromFilePathConfigsnapshotConfig cacheAction $fPrettyDB$fGenericCache $fNFDataCache$fGenericSnapshot$fNFDataSnapshotprocess-1.6.3.0System.Process.Common CreateProcessbaseGHC.IO.Handle.TypesHandle ProcessHandleSystem.ProcesswaitForProcessGHC.IO.ExceptionExitCode GHC.MaybeJustNothingData.Semigroup.InternalDualGHC.Basemappend<>GHC.Num*GHC.IO.Handle.FDstdinstdoutstderr/postgres-options-0.2.0.0-1WmGztADt6tJrczlhQ8CW0"Database.PostgreSQL.Simple.OptionsOptionsmemptyghc-prim GHC.TypesTrueControl.Exception.Basebracket