!9)      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None"#%047;<MPSX_Fd$ 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 3.  tmp-postgresConnection options  tmp-postgrespostgres process handle  tmp-postgres  is used be 3 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-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  ./ tmp-postgres7Start a process and block until it finishes return the   and the stderr output.2 tmp-postgres Stop the postgres> process after attempting to terminate all the connections.3 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.5 tmp-postgresCall createdbE and tee the output to return if there is an an exception. Throws .6 tmp-postgres6 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 3 for more details.7 tmp-postgres Stop the postgres process. See 2 for more details., tmp-postgres Process name tmp-postgresProcess config. tmp-postgres Process name tmp-postgresProcess config/ tmp-postgres Process name tmp-postgresProcess config8  #"!$('&%)*+,-./012345678$('&% #"!)*+,-./ 0 1234567None"#%047;<MPSX_XB tmp-postgresLocal Lens' aliasC tmp-postgresLocal Lens aliasD tmp-postgresD[ holds a description of the temporary folders (if there are any) and includes the final  that can be used with 6 . See # for an example of how to create a D.F tmp-postgresFinal . See 6 for information on sG tmp-postgresThe aL. Used to track if a temporary directory was made as the socket location.H tmp-postgresDThe data directory. Used to track if a temporary directory was used.I tmp-postgresOThe directory where other temporary directories are created. Usually "/tmp".J tmp-postgres7The high level options for overriding default behavior.L tmp-postgresEExtend or replace any of the configuration used to create a final M tmp-postgresOverride the default a by setting this.N tmp-postgres=Override the default temporary data directory by passing in e  DIRECTORYO tmp-postgres)A monoid for using an existing port (via    PORT_NUMBER$) or requesting a free port (via a )P tmp-postgresPThe directory used to create other temporary directories. Defaults to "/tmp".Q tmp-postgresDescribe how to run initdb, createdb and postgresY tmp-postgres.Max time to spend attempting to connection to postgres. Time is in microseconds.Z tmp-postgrespostgres7 process config and corresponding client connection .\ tmp-postgresMonoid for the postgres ProcessConfig.] tmp-postgresMonoid for the postgres client connection options.^ tmp-postgres^ is used to specify how postgres= should listen for connections The two main options are a _w which takes a hostname or IP address. if not is given the default it "127.0.0.1". Alternatively one can specify ` for a UNIX domain socket. If a directory is specified the socket will live in that folder. Otherwise a temporary folder will get created for the socket._ tmp-postgres1The monoid for combining IP address configuration` tmp-postgres2The monoid for combining UNIX socket configurationa tmp-postgres4A type for configuring the listening address of the postgres process. postgres can listen on several types of sockets simulatanously but we don't support that behavior. One can either listen on a IP based socket or a UNIX domain socket.b tmp-postgresIP socket type. The G is either an IP address or a host that will resolve to an IP address.c tmp-postgresUNIX domain socketd tmp-postgresUsed to specify a f1 folder that is automatically cleaned up or a e1 folder which is not automatically cleaned up.e tmp-postgres.A permanent file that should not be generated.f tmp-postgres)A temporary file that needs to generated.g tmp-postgresGA type to track whether a file is temporary and needs to be cleaned up.j tmp-postgresProcess configurationl tmp-postgresRA monoid for combine environment variables or replacing them. for the maps the & monoid is used. So the last key wins.m tmp-postgres8A monoid for combine command line Args or replacing themn tmp-postgres,A monoid for configuring the standard input  o tmp-postgres-A monoid for configuring the standard output  p tmp-postgres,A monoid for configuring the standard error  q tmp-postgres)A type to help combine command line Args.s 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.t tmp-postgres=Args that appear at the end of the key based Args. The % monoid is used so the last key wins.u tmp-postgresvThe environment variables can be declared to inherit from the running process or they can be specifically added.z tmp-postgres4Combine the current environment (if indicated by w ) with x| tmp-postgresThis convert the q to '~ tmp-postgresThe ~ sets the handles to ,  and D and inherits the environment variables from the calling process. tmp-postgresc sets the handles to "/dev/null" and inherits the environment variables from the calling process tmp-postgresTurn a j into a j%. Fails if any values are missing. tmp-postgresGet the file path of a g, regardless if it is a h or i type. tmp-postgresEither create ai directory or do nothing to a h one. tmp-postgresEither remove a i directory or do nothing to a h one. tmp-postgres9Create the extra config lines for listening based on the a tmp-postgresFMany processes require a "host" flag. We can generate one from the a. tmp-postgresFGet the IP address, host name or UNIX domain socket directory as a  tmp-postgresTurn a ^ to a a . If the _ is % default to "127.0.0.1". If the is a `D optionally create a temporary directory if configured to do so. tmp-postgres?Cleanup the UNIX socket temporary directory if one was created. tmp-postgresTurn a Z into a  %. Fails if any values are missing. tmp-postgresTurn a Q into a ". Fails if any values are missing. tmp-postgres Create a Q9 that sets the command line options of all processes (initdb, postgres and createdb ) using a tmp-postgres*Create all the temporary resources from a J. This also combines the Q from  with the  extraConfig passed in. tmp-postgres(Free the temporary resources created by  tmp-postgres Make the H h" 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 w tmp-postgres Lens for x tmp-postgres Lens for m tmp-postgres Lens for l tmp-postgres Lens for p tmp-postgres Lens for n tmp-postgres Lens for o tmp-postgres Lens for ] tmp-postgres Lens for \ tmp-postgres Lens for W tmp-postgres Lens for U tmp-postgres Lens for X tmp-postgres Lens for T tmp-postgres Lens for S tmp-postgres Lens for V tmp-postgres Lens for Y tmp-postgres Lens for H tmp-postgres Lens for F tmp-postgres Lens for G tmp-postgres Lens for N tmp-postgres Lens for L tmp-postgres Lens for O tmp-postgres Lens for M tmp-postgres Lens for M tmp-postgres Lens for t tmp-postgres Lens for s tmp-postgresf as  tmp-postgresTakes the last e value. tmp-postgresTreats `  as  tmp-postgresLast _ wins. ` d as  ed together. tmp-postgres!Temporary directory configuration tmp-postgresDirectory pattern tmp-postgresTemporary directory tmp-postgresThe type of socket tmp-postgresMake initdb options tmp-postgresMake createdb options tmp-postgresport tmp-postgres7Whether to listen on a IP address or UNIX domain socket tmp-postgresThe postgres data directory tmp-postgres extraConfig to  after the default configtBCDEFHGIJKPNMLOQRYXWVUTSZ[]\^`_acbdfegihjknmlpoqrtsuvxwyz{|}~tyuvxwzqrts{|jknmlpo}~gihdfeacb^`_Z[]\QRYXWVUTSJKPNMLODEFHGICBNone"#%047;<MPSX_" 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 J 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 J 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 J like the following. ' custom = defaultConfig <> mempty { L = mempty { W = [ "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 &  . W <>~ [ "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 JC that provides additional "postgresql.conf" lines. Equivalent to  extra =  <> mempty { L = mempty { W = extra } } or with lenses  extra =  &  . W <>~ extra  tmp-postgres The same as 4 but all the handles are set to "/dev/null". See  as well. tmp-postgres?Create zero or more temporary resources and use them to make a J.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 M$ a "postgresql.conf" is created with " listen_addresses = 'IP_ADDRESS'  if it is _. If is ` then the lines G listen_addresses = '' unix_socket_directories = 'SOCKET_DIRECTORY'  are added.Additionally the  generated J also does the following:Sets a Y of one minute.Logs internal $s.@Sets the processes to use the standard input and output handles. Sets the X to file path generated from N,All of these values can be overrided by the extra config. The returned  requires cleanup.  should be used with a  and , e.g.   :: J -> ( -> 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 Q 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 J 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 J. 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-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 j. The combined process is created by ed the  generated with the extra j, 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. tmp-postgresextra configuration that is ed last to the generated J. generated <> extra tmp-postgresextra. J combined with the generated J. See  for more info tmp-postgresaction continuation tmp-postgresaction continuation. tmp-postgres The original L handle. The connection options database is used as the template for the  generated j tmp-postgres The modified E handle that has the new database name in it's connection options. tmp-postgresextra createdb j tmp-postgres The original L handle. The connection options database is used as the template for the  generated j tmp-postgres The modified E handle that has the new database name in it's connection options.None"#%047;<MPSX_$|F$%&'(JKOLMNPQRSTUVWXYZ[\]^_`defjkoplmnqrstuvwxFJKOLMNPQRSTUVWXYZ[\]jkoplmnuvwxqrstdef^_`$%&'(None"#%047;<MPSX_'ji !"#$%&'(JKOLMNPQRSTUVWXYZ[\]^_`defjkoplmnqrstuvwx~# !"#~       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIIJKLMNNOPQRSTUVWXYZ[[\]^_`abcdefghijklmnoopqrrstuvwxyz{|}~       ,tmp-postgres-1.12.0.0-Fe5YA0S3k3EEQKsXhJ0lin$Database.Postgres.Temp.Internal.Core&Database.Postgres.Temp.Internal.ConfigDatabase.Postgres.Temp.InternalDatabase.Postgres.TempstartDatabase.Postgres.Temp.ConfigPlan ProcessConfig CompletePlancompletePlanLoggercompletePlanInitDbcompletePlanCreateDbcompletePlanPostgrescompletePlanConfigcompletePlanDataDirectorycompletePlanConnectionTimeoutPostgresProcesspostgresProcessClientOptionspostgresProcessHandleCompletePostgresPlan!completePostgresPlanProcessConfig!completePostgresPlanClientOptionsCompleteProcessConfigcompleteProcessConfigEnvVarscompleteProcessConfigCmdLinecompleteProcessConfigStdIncompleteProcessConfigStdOutcompleteProcessConfigStdErrLogger StartErrorStartPostgresFailed InitDbFailedCreateDbFailedCompletePlanFailedCompleteProcessConfigFailedConnectionTimedOut DeleteDbErrorstartErrorStdOutstartErrorStdErrstartErrorExitCodeEvent StartPlan StartPostgres WaitForDB TryToConnect waitForDB teeHandle prettyKeyPair startProcess stopProcessexecuteProcessexecuteProcessAndTee prettyOptionsterminateConnectionsstopPostgresProcessstartPostgresProcessthrowIfNotSuccessexecuteCreateDb startPlanstopPlan$fExceptionStartError$fPrettyCompleteProcessConfig$fPrettyCompletePostgresPlan$fPrettyPostgresProcess$fPrettyCompletePlan $fShowEvent $fEqEvent $fOrdEvent$fShowStartError$fEqStartErrorLens'Lens Resources resourcesPlanresourcesSocketresourcesDataDirresourcesTemporaryDirConfigplan socketClass dataDirectoryporttemporaryDirectorylogger initDbConfigcreateDbConfig postgresPlanpostgresConfigFiledataDirectoryStringconnectionTimeout PostgresPlanpostgresConfigconnectionOptions SocketClassIpSocket UnixSocketCompleteSocketClass CIpSocket CUnixSocket DirectoryType Permanent TemporaryCompleteDirectoryType CPermanent CTemporaryenvironmentVariables commandLinestdInstdOutstdErrCommandLineArgskeyBased indexBasedEnvironmentVariablesinheritspecific prettyMapcompleteEnvironmentVariablestakeWhileInSequencecompleteCommandLineArgs prettyHandlestandardProcessConfigdevNullsilentProcessConfigaddErrorContext getOptioncompleteProcessConfig toFilePath makePermanentsetupDirectoryTypermDirIgnoreErrorscleanupDirectoryTypesocketClassToConfigsocketClassToHostFlagsocketClassToHostsetupSocketClasscleanupSocketConfigcompletePostgresPlan completePlan hasInitDb hasCreateDbtoPlan setupConfig cleanupConfigmakeResourcesDataDirPermanentoptionsToConfig optionsToPlanclientOptionsToPlan userToPlan dbnameToPlanhostToSocketClassinheritL specificL commandLineLenvironmentVariablesLstdErrLstdInLstdOutLconnectionOptionsLpostgresConfigLpostgresConfigFileLcreateDbConfigLdataDirectoryStringL initDbConfigLloggerL postgresPlanLconnectionTimeoutLresourcesDataDirLresourcesPlanLresourcesSocketLdataDirectoryLplanLportL socketClassLtemporaryDirectoryL indexBasedL keyBasedL$fPrettyEnvironmentVariables$fMonoidEnvironmentVariables$fSemigroupEnvironmentVariables$fPrettyCommandLineArgs$fSemigroupCommandLineArgs$fPrettyProcessConfig$fPrettyCompleteDirectoryType$fMonoidDirectoryType$fSemigroupDirectoryType$fPrettyDirectoryType$fPrettyCompleteSocketClass$fMonoidSocketClass$fSemigroupSocketClass$fPrettySocketClass$fPrettyPostgresPlan $fPrettyPlan$fPrettyConfig$fPrettyResources$fGenericEnvironmentVariables$fShowEnvironmentVariables$fEqEnvironmentVariables$fGenericCommandLineArgs$fShowCommandLineArgs$fEqCommandLineArgs$fMonoidCommandLineArgs$fGenericProcessConfig$fEqProcessConfig$fShowProcessConfig$fSemigroupProcessConfig$fMonoidProcessConfig$fShowCompleteDirectoryType$fEqCompleteDirectoryType$fOrdCompleteDirectoryType$fShowDirectoryType$fEqDirectoryType$fOrdDirectoryType$fShowCompleteSocketClass$fEqCompleteSocketClass$fOrdCompleteSocketClass$fGenericCompleteSocketClass$fShowSocketClass$fEqSocketClass$fOrdSocketClass$fGenericSocketClass$fGenericPostgresPlan$fSemigroupPostgresPlan$fMonoidPostgresPlan $fGenericPlan$fSemigroupPlan $fMonoidPlan$fGenericConfig$fSemigroupConfig$fMonoidConfigDB dbResourcesdbPostgresProcesstoConnectionStringtoConnectionOptionstoDataDirectorymakeDataDirPermanenttoTemporaryDirectorydefaultPostgresConfig defaultConfigdefaultPostgresConf silentConfig startConfigstop stopPostgresrestart reloadConfig withConfigwith withRestartoptionsToDefaultConfigprettyPrintConfig prettyPrintDBdropDbIfExists withNewDbwithNewDbConfig $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.OptionsOptionsGHC.BaseStringData.Semigroup.InternalDualmappendGHC.IO.Handle.FDstdinstdoutstderrmempty<>Control.Exception.Basebracket