!>0&      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None"#%047;<MPSX_G% tmp-postgresN is the low level configuration necessary for creating a database starting postgres@ and creating a database. There is no validation done on the E. 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 4.  tmp-postgresConnection options  tmp-postgrespostgres process handle  tmp-postgres  is used be 4 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  initDbConfig.%  tmp-postgresInternal events for debugging& tmp-postgresKThe first event. This useful for debugging what is actual passed to the initdb, createdb and postgres.' tmp-postgres1The second event. Postgres is about to get called( tmp-postgresnThe third event. Postgres started. We are now about to setup a reconnect loop (racing with a process checker)) tmp-postgresmThe fourth event and (possibly all subsequent events). We are looping trying to successfully connect to the postgres process.* tmp-postgrespostgres< is not ready until we are able to successfully connect. *^ attempts to connect over and over again and returns after the first successful connection.- tmp-postgres-Start a process interactively and return the . tmp-postgresStop a . An alias for / tmp-postgres7Start a process and block until it finishes return the .0 tmp-postgres7Start a process and block until it finishes return the  and the stderr output.3 tmp-postgres Stop the postgres> process after attempting to terminate all the connections.4 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.6 tmp-postgresCall createdbE and tee the output to return if there is an an exception. Throws .7 tmp-postgres7 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 4 for more details.8 tmp-postgres Stop the postgres process. See 3 for more details.- tmp-postgres Process name tmp-postgresProcess config/ tmp-postgres Process name tmp-postgresProcess config0 tmp-postgres Process name tmp-postgresProcess config9 ! $#"%)('&*+,-./0123456789%)('&! $#"*+,-./0 1 2345678None"#%047;<MPSX_MC tmp-postgresLocal Lens' alias.D tmp-postgresLocal Lens alias.E  tmp-postgresE[ holds a description of the temporary folders (if there are any) and includes the final  that can be used with 7 . See # for an example of how to create a E.G tmp-postgresFinal . See 7 for information on s.H tmp-postgresDThe used to potentially cleanup the temporary unix socket directory.I tmp-postgresDThe data directory. Used to track if a temporary directory was used.J tmp-postgresNThe directory where other temporary directories are created. Usually @/tmp.K tmp-postgres7The high level options for overriding default behavior.M tmp-postgresEExtend or replace any of the configuration used to create a final .N tmp-postgresEOverride the default temporary UNIX socket directory by setting this.O tmp-postgres=Override the default temporary data directory by passing in `  DIRECTORY.P tmp-postgres)A monoid for using an existing port (via   PORT_NUMBER$) or requesting a free port (via a ).Q tmp-postgresIThe directory used to create other temporary directories. Defaults to /tmp.R  tmp-postgresDescribe how to run initdb, createdb and postgresZ tmp-postgres.Max time to spend attempting to connection to postgres. Time is in microseconds.[  tmp-postgrespostgres7 process config and corresponding client connection .] tmp-postgresMonoid for the postgres ProcessConfig.^ tmp-postgresMonoid for the postgres client connection options._  tmp-postgresUsed to specify a a1 folder that is automatically cleaned up or a `1 folder which is not automatically cleaned up.` tmp-postgres.A permanent file that should not be generated.a tmp-postgres)A temporary file that needs to generated.b  tmp-postgresGA type to track whether a file is temporary and needs to be cleaned up.e  tmp-postgresProcess configurationg tmp-postgresRA monoid for combine environment variables or replacing them. for the maps the & monoid is used. So the last key wins.h tmp-postgres9A monoid for combine command line Args or replacing them.i tmp-postgres,A monoid for configuring the standard input .j tmp-postgres-A monoid for configuring the standard output .k tmp-postgres,A monoid for configuring the standard error .l  tmp-postgres)A type to help combine command line Args.n 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.o tmp-postgres=Args that appear at the end of the key based Args. The % monoid is used so the last key wins.p  tmp-postgresvThe environment variables can be declared to inherit from the running process or they can be specifically added.u  tmp-postgres4Combine the current environment (if indicated by r ) with s.w  tmp-postgresThis convert the l to '[String]'.y  tmp-postgresThe y sets the handles to ,  and D and inherits the environment variables from the calling process.z  tmp-postgresA global reference to devnull .{  tmp-postgres{ sets the handles to devnullD and inherits the environment variables from the calling process.~  tmp-postgresTurn a e into a e%. Fails if any values are missing.  tmp-postgresGet the file path of a b, regardless if it is a c or d type.  tmp-postgresEither create ad directory or do nothing to a c one. tmp-postgresEither remove a d directory or do nothing to a c one. tmp-postgresTurn a [ into a  %. Fails if any values are missing. tmp-postgresTurn a R into a ". Fails if any values are missing. tmp-postgres Create a R9 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 K. This also combines the R from  with the extra K passed in. tmp-postgres(Free the temporary resources created by .  tmp-postgres Display a K.  tmp-postgres Make the I c" 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-postgres Lens for r  tmp-postgres Lens for s.  tmp-postgres Lens for h.  tmp-postgres Lens for g.  tmp-postgres Lens for k  tmp-postgres Lens for i.  tmp-postgres Lens for j.  tmp-postgres Lens for ^.  tmp-postgres Lens for ].  tmp-postgres Lens for X.  tmp-postgres Lens for V.  tmp-postgres Lens for Y.  tmp-postgres Lens for U.  tmp-postgres Lens for T.  tmp-postgres Lens for W.  tmp-postgres Lens for Z.  tmp-postgres Lens for I.  tmp-postgres Lens for G. tmp-postgres Lens for H.  tmp-postgres Lens for O.  tmp-postgres Lens for M.  tmp-postgres Lens for P.  tmp-postgres Lens for N.  tmp-postgres Lens for N.  tmp-postgres Lens for o.  tmp-postgres Lens for n. tmp-postgresa as  tmp-postgresTakes the last ` value. tmp-postgres!Temporary directory configuration tmp-postgresDirectory pattern tmp-postgresMake initdb options tmp-postgresMake createdb options tmp-postgresport tmp-postgresSocket directory tmp-postgresThe postgres data directory tmp-postgresextra K to  after the  generated K.lCDEFGIHJKLQONMPRSZYXWVUT[\^]_a`bdcefihgkjlmonpqsrtuvwxyz{|}~ltpqsrulmonvwefihgkjxyz{|}~bdc_a`[\^]RSZYXWVUTKLQONMPEFGIHJDCNone"#%047;<MPSX_)R  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. See  or  for converting a ! to postgresql connection string. 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 K  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-postgresDefault postgres options  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 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_duration_statement = 0 log_connections = on log_disconnections = on 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 K using  ().Alternatively you can eschew  altogether, however your postgres' might start and run faster if you use .The ' also disables the logging of internal %s.ETo append additional lines to "postgresql.conf" file create a custom K like the following. ' custom = defaultConfig <> mempty { M = mempty { X = [ "wal_level = replica" , "archive_mode = on" , "max_wal_senders = 2" , "fsync = on" , "synchronous_commit = on" ] } } <Or using the provided lenses and your favorite lens library:  custom = defaultConfig &  . X <>~ [ "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-postgres the  with a KD that provides additional "postgresql.conf" lines. Equivalent to:  extra =  <> mempty { M = mempty { X = extra } } or with lenses:  extra =  &  . X <>~ extra  tmp-postgres)A config that logs as little as possible. tmp-postgresThe similar to  but all the handles are set to devnull . and uses a postgresql.conf which disables logging:  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 See { as well. tmp-postgres?Create zero or more temporary resources and use them to make a K.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 N% a "postgresql.conf" is created with: U listen_addresses = '127.0.0.1, ::1' unix_socket_directories = 'SOCKET_DIRECTORY' Additionally the  generated K also does the following:Sets a Z of one minute.Logs internal %s.@Sets the processes to use the standard input and output handles. Sets the Y to file path generated from O.,All of these values can be overrided by the extra config. The returned  requires cleanup.  should be used with a  and , e.g.   :: K -> ( -> 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-postgres Restart the postgres from  using the prior R.  tmp-postgres>Reload the configuration file without shutting down. Calls pg_reload_conf(). 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 K 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-postgresEDrop the db if it exists. Terminates all connections to the db first.  tmp-postgresTUse the current database as a template and make a copy. Give the copy a random name.Equivalent to:   =  mempty See  for more details.  tmp-postgresException safe version of H. Creates a temporary database using the current database as a template.See  for more details.  tmp-postgresTUse the current database as a template and make a copy. Give the copy a random name.Equivalent to:   =  mempty See  for more details.  tmp-postgresTUse the current database as a template and make a copy. Give the copy a random name.ECopying a database from a template can be faster than creating a new postgresa and migrating a database from scratch. In artifical benchmarks it appears to be about 2x faster.cTo use the current database as a template all connections to the database must be terminated first.$To override the arguments passed to createdb one can pass in extra e. The combined process is created by ed the  generated with the extra e, e.g.  combined = generated  extra 2The current implementation has a few known issues.@If a connection is made between the termination command and the createdb call the createdb call will fail.Additionally the generated name is 32 character random name of characters "a" to "z". It is possible, although unlikeily that a duplicate database name could be generated and this would also cause a failure.& requires cleanup so it best to use a  along with . This is equivalient to .The only reason to use  over  is if you are unable to use  for some reason.  tmp-postgres*Cleanup the temporary database created by  or . tmp-postgresextra configuration that is ed last to the generated K.  generated  extra. tmp-postgresextra. K combined with the generated K. See  for more info. tmp-postgresaction continuation. tmp-postgresaction continuation. tmp-postgres The original e handle. The database name specified in the connection options is used as the template for the  generated e tmp-postgres The modified E handle that has the new database name in it's connection options. tmp-postgresextra createdb e. tmp-postgres The original e handle. The database name specified in the connection options is used as the template for the  generated e. tmp-postgres The modified E handle that has the new database name in it's connection options. tmp-postgres The original e handle. The database name specified in the connection options is used as the template for the  generated e. tmp-postgresextra createdb e. tmp-postgres The original e handle. The database name specified in the connection options is used as the template for the  generated e.None"#%047;<MPSX_+C%&'()KLPMNOQRSTUVWXYZ[\]^_`aefjkghilmnopqrsCKLPMNOQRSTUVWXYZ[\]^efjkghipqrslmno_`a%&'()None"#%047;<MPSX_-j !"#$%&'()KLPMNOQRSTUVWXYZ[\]^_`aefjkghilmnopqrsy{' !"#$y{      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKKLMNOPPQRSTUVWXYZ[\]]^_`abcdefghijkklmnnopqrstuvwxyz{|}~      ,tmp-postgres-1.15.0.0-96VdfpJgASJDHQgHneMjBR$Database.Postgres.Temp.Internal.Core&Database.Postgres.Temp.Internal.ConfigDatabase.Postgres.Temp.InternalDatabase.Postgres.TempstartDatabase.Postgres.Temp.ConfigPlan ProcessConfig startConfig CompletePlancompletePlanLoggercompletePlanInitDbcompletePlanCreateDbcompletePlanPostgrescompletePlanConfigcompletePlanDataDirectorycompletePlanConnectionTimeoutPostgresProcesspostgresProcessClientOptionspostgresProcessHandleCompletePostgresPlan!completePostgresPlanProcessConfig!completePostgresPlanClientOptionsCompleteProcessConfigcompleteProcessConfigEnvVarscompleteProcessConfigCmdLinecompleteProcessConfigStdIncompleteProcessConfigStdOutcompleteProcessConfigStdErrLogger StartErrorStartPostgresFailed InitDbFailedCreateDbFailedCompletePlanFailedCompleteProcessConfigFailedConnectionTimedOut DeleteDbErrorEmptyDataDirectorystartErrorStdOutstartErrorStdErrstartErrorExitCodeEvent StartPlan StartPostgres WaitForDB TryToConnect waitForDB teeHandle prettyKeyPair startProcess stopProcessexecuteProcessexecuteProcessAndTee prettyOptionsterminateConnectionsstopPostgresProcessstartPostgresProcessthrowIfNotSuccessexecuteCreateDb startPlanstopPlan$fExceptionStartError$fPrettyCompleteProcessConfig$fPrettyCompletePostgresPlan$fPrettyPostgresProcess$fPrettyCompletePlan $fShowEvent $fEqEvent $fOrdEvent$fShowStartError$fEqStartErrorLens'Lens Resources resourcesPlanresourcesSocketDirectoryresourcesDataDirresourcesTemporaryDirConfigplansocketDirectory dataDirectoryporttemporaryDirectorylogger initDbConfigcreateDbConfig postgresPlanpostgresConfigFiledataDirectoryStringconnectionTimeout PostgresPlanpostgresConfigconnectionOptions DirectoryType Permanent TemporaryCompleteDirectoryType CPermanent CTemporaryenvironmentVariables commandLinestdInstdOutstdErrCommandLineArgskeyBased indexBasedEnvironmentVariablesinheritspecific prettyMapcompleteEnvironmentVariablestakeWhileInSequencecompleteCommandLineArgs prettyHandlestandardProcessConfigdevNullsilentProcessConfigaddErrorContext getOptioncompleteProcessConfig toFilePath makePermanentsetupDirectoryTypermDirIgnoreErrorscleanupDirectoryTypecompletePostgresPlan completePlan hasInitDb hasCreateDbsocketDirectoryToConfigtoPlan setupConfig cleanupConfigprettyPrintConfigmakeResourcesDataDirPermanentoptionsToConfig optionsToPlanclientOptionsToPlan userToPlan dbnameToPlanpasswordToPlanhostToSocketClassinheritL specificL commandLineLenvironmentVariablesLstdErrLstdInLstdOutLconnectionOptionsLpostgresConfigLpostgresConfigFileLcreateDbConfigLdataDirectoryStringL initDbConfigLloggerL postgresPlanLconnectionTimeoutLresourcesDataDirLresourcesPlanLresourcesSocketDirectoryLdataDirectoryLplanLportLsocketDirectoryLtemporaryDirectoryL indexBasedL keyBasedL$fPrettyEnvironmentVariables$fMonoidEnvironmentVariables$fSemigroupEnvironmentVariables$fPrettyCommandLineArgs$fSemigroupCommandLineArgs$fPrettyProcessConfig$fPrettyCompleteDirectoryType$fMonoidDirectoryType$fSemigroupDirectoryType$fPrettyDirectoryType$fPrettyPostgresPlan $fPrettyPlan$fPrettyConfig$fPrettyResources$fGenericEnvironmentVariables$fShowEnvironmentVariables$fEqEnvironmentVariables$fGenericCommandLineArgs$fShowCommandLineArgs$fEqCommandLineArgs$fMonoidCommandLineArgs$fGenericProcessConfig$fEqProcessConfig$fShowProcessConfig$fSemigroupProcessConfig$fMonoidProcessConfig$fShowCompleteDirectoryType$fEqCompleteDirectoryType$fOrdCompleteDirectoryType$fShowDirectoryType$fEqDirectoryType$fOrdDirectoryType$fGenericPostgresPlan$fSemigroupPostgresPlan$fMonoidPostgresPlan $fGenericPlan$fSemigroupPlan $fMonoidPlan$fGenericConfig$fSemigroupConfig$fMonoidConfigDB dbResourcesdbPostgresProcesstoConnectionStringtoConnectionOptionstoDataDirectorymakeDataDirPermanenttoTemporaryDirectorydefaultPostgresConfig defaultConfigdefaultPostgresConfsilentPostgresConfig silentConfigstop stopPostgresrestart reloadConfig withConfigwith withRestartoptionsToDefaultConfig prettyPrintDBdropDbIfExists withNewDbwithNewDbConfig startNewDbstartNewDbConfig stopNewDb $fPrettyDBprocess-1.6.3.0System.Process.Common CreateProcessbaseGHC.IO.Handle.TypesHandle ProcessHandleSystem.ProcesswaitForProcessGHC.IO.ExceptionExitCode GHC.MaybeJustNothing/postgres-options-0.2.0.0-FEfVRHnVs2pG3RBcj4OWRP"Database.PostgreSQL.Simple.OptionsOptionsData.Semigroup.InternalDualGHC.BasemappendGHC.IO.Handle.FDstdinstdoutstderrmempty<>Control.Exception.Basebracket