How can I install pgAgent for PostgreSQL 9.5 on Windows? - postgresql

Everything I see about pgAgent says that it can be installed using the StackBuilder wizard that runs after installing PostgreSQL. But the StackBuilder wizards I have do not include pgAgent. How can I get pgAgent?
A screenshot of my StackBuilder dialog box showing the lack of pgAgent can be found here: https://imgur.com/PTopsAA

I think it can't be possible, 9.5 is dead (EOL). but the binaries still can be downloaded from EDB ( https://www.enterprisedb.com/downloads/postgres-postgresql-downloads )
NOTE: pgAgent is available in Debian/Ubuntu (DEB) and Redhat/Fedora
(RPM) packages for Linux users, as well as source code
In the official doc says how: https://www.pgadmin.org/docs/pgadmin4/latest/pgagent_install.html#service-installation-on-windows
Service installation on Windows
pgAgent can install itself as a service on Windows systems. The command line options available are similar to those on Unix systems, but include an additional parameter to tell the service what to do:
Usage:
pgAgent REMOVE <serviceName>
pgAgent INSTALL <serviceName> [options] <connect-string>
pgAgent DEBUG [options] <connect-string>
options:
-u <user or DOMAIN\user>
-p <password>
-d <displayname>
-t <poll time interval in seconds (default 10)>
-r <retry period after connection abort in seconds (>=10, default 30)>
-l <logging verbosity (ERROR=0, WARNING=1, DEBUG=2, default 0)>
The service may be quite simply installed from the command line as follows (adjust the path as required):
"C:\Program Files\pgAgent\bin\pgAgent" INSTALL pgAgent -u postgres -p secret hostaddr=127.0.0.1 dbname=postgres user=postgres
You can then start the service at the command line using net start pgAgent, or from the Services control panel applet. Any logging output or errors will be reported in the Application event log. The DEBUG mode may be used to run pgAgent from a command prompt. When run this way, log messages will output to the command window.

Related

Citus 10.2 not starting an instance of PostgreSQL

I'm using RHEL 8.4 and I followed the installation instruction at Set up a single-node Citus cluster on your own Linux machine from RPM packages..
Step 1 and 2 (Install PostgreSQL 14 and the Citus extension and Initialize the Cluster) went through without any issues.
But When I tried (Step 3: Start the database server)
pg_ctl -D citus -o "-p 9700" -l citus_logfile start
I got the following error in terminal
waiting for server to start.... stopped waiting
pg_ctl: could not start server
Examine the log output.
The log output
FATAL: could not access file "citus": No such file or directory
LOG: database system is shut down
I do have a directory 'citus' in postgres user's home directory with all required files in it along with postgresql.conf
Kindly help.
It appears you ran into one of 2 issues:
Possible issue #1:
You did not successfully install citus package and the citus.so file is missing.
Can you see the file /usr/pgsql-14/lib/citus.so that should be installed via the package citus102_14?
If that is not the case, you should figure out why the package is not installed.
Possible issue #2
You do not run pg_ctl command in the home directory of postgres user.
I was getting the same error. I am using the Postgres compiled from the source file. Thus, instead of
sudo apt-get -y install postgresql-14-citus-10.2
I compiled the source of the Citus from Github and specified the path to location of my Postgres while configuring as:
git clone https://github.com/citusdata/citus.git
cd citus
./configure --prefix=/usr/local/pgsql/
make
sudo make install
I do not get an error during pg_ctl start and I can load extension as CREATE EXTENSION citus;.

Unable to install pgagent with application stack builder

I'm trying to install pgagent in a windows environment. Postgresql version 9.6 is installed and application stack builder was installed with it. I have followed the steps, detailed here.
The first step in this guide is to create the extension in the maintenance db, and I am not able to do that.
"ERROR: could not open extension control file "C:/Program Files/PostgreSQL/9.6/share/extension/pgagent.control": No such file or directory
SQL state: 58P01"
Tryied to skip this step and go straight to the installation with application stack builder, but the pgAgent tool does not show up.
I also tried to install it as a service using the command line instead of stack builder.
pgAent.exe INSTALL pgAgent -u postgres -p secret hostaddr=127.0.0.1 dbname=postgres user=postgres
This worked to some degree. The only error I get is this.
"Windows could not start pgAgent service on the local computer. Error 1069: The service did not start due to a logon failure."
But I have tried all possible combinations of usernames, passwords, secrets, ports and so on....
Any help would be much appreciated.
I had the same problem. I was able to get pgagent working by downloading and executing the stand-alone installation file pgagent-3.4.0-4-windows.exe from here: http://sbp.enterprisedb.com/getfile.jsp?fileid=11842
I wound up installing the Stack Builder Plus from EDB. Unfortunately, you have to create an account, but it has a lot more options for which pgAgent version you want. Note: You can use Stack Builder for only pulling a pgAgent installation executable and run that on your target servers.
this worked for me :
first I accessed the postgres bin file using cmd: C:\Program Files\PostgreSQL\11\bin
then i tapped this :
pgAgent INSTALL pgAgent -u windowsUser-p windowspassword hostaddr=127.0.0.1 dbaname=postgres user=postgres password=***
Have you choosen a localy installed database before this step ?
You will need to have installed PostgresSql, CLI Commands and Stackbuilder to have the option of installing pgAgent via those eDB installers.

After installing postgres 9.4 on fedora 20, couldn't launch psql

I have installed postgres 9.4 on fedora 20.
i have followed the steps through the link below
https://wiki.postgresql.org/wiki/YUM_Installation
I have started the server using the command
service postgresql-9.4 initdb
Then I set the auto start using the command
chkconfig postgresql-9.4 on
I am able to connect with Data base server via pg admin
but I am not able to connect with postgres DB server or SQL command line via terminal
If I enter psql for postgres/or any user, it says command not found.
can any one please help me on this.
You need to go to the installation bin directory and use './ExecutableFile' to run when logged in with postgres user.
So, use ./psql when you are in bin directory.
Or you can use "export PATH=path/to/bin/" to avoid using './'

Unable to start postgresql service in Redhat linux 7

I have installed postgresql 9.4 on Redhat 7 server.It was installed through postgresql-9.4.3-1-linux-x64.run. It displayed a clear message"postgres is installed your machine". Now when I login as
su - postgres
It doesn't ask for password and goes to bash prompt. If I type psql displays "command not found". When I tried starting service through root user
service postgresql initdb
I get:
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
I tried start postgres restart which didn't work. I tried searching and found nothing. I know its with starting service.
service postgresql initdb
initdb is an independent command to create a new database cluster.
initdb -- create a new PostgreSQL database cluster
initdb [option...] [--pgdata | -D] directory
You must use it independent, but not as argument for service command. Read documentation how to use this command: initdb
Use service postgresql start to start postgresql service and service postgresql stop to stop it.
psql: "command not found"
Try to switch into postgres user using su postgres command (without dash). It effects on $PATH environment variable.If this wouldn't help use full path to specify the command, for example /usr/bin/psql

could not start pgAgent due to log on failure

I wanted to install pgAgent service on windows. Though it installs alright using the following command:
C:\Program Files (x86)\pgAdmin III\1.14>pgagent.exe INSTALL pgAgent -l2 -u postgres hostaddr=localhost port=5432 dbname=postgres user=postgres
the service does not start giving an error: Windows could not start pgAgent service on the local computer. Error 1069: The service did not start due to a logon failure.
The password is being provided using pgpass.conf file. The same password is being used by pgAdmin to logon to databases.
I have even tried by providing same password (as pgpass.conf) using -p option on the command line itself. It did not work either but error is different. On command line it says service could not be started. Service reported no error . However when I see logs in Control Panel/EventViewer following warning is shown:
Couldn't create the primary connection (attempt 10): fe_sendauth: no password supplied
and then an error:
Stopping pgAgent: Couldn't establish the primary connection with the database server.
If it could help, I downloaded pgAgent separately and placed pgAgent.exe in pgAdmin III/1.14 folder where libpq.dll also resides. I am using PostgreSQL 9.0, pgAdmin 1.14 and pgAgent 3.0.0
Can somebody please help me with this?
Go to pgAgent installation folder on windows and execute
C:\Program Files (x86)\pgAgent\bin>pgagent REMOVE pgAgent
This will remove the existing misconfigured windows service
then reinstall the service in the following way giving the password credentials properly. The first -u gives the postgres user created on windows and the second username in the connection string is the db username.
After doing the below start the service and check the Event Viewer if you still see the error.
C:\Program Files (x86)\pgAgent\bin>pgagent --help
Usage:
pgagent REMOVE <serviceName>
pgagent INSTALL <serviceName> [options] <connect-string>
pgagent DEBUG [options] <connect-string>
options:
-u <user or DOMAIN\user>
-p <password>
-d <displayname>
-t <poll time interval in seconds (default 10)>
-r <retry period after connection abort in seconds (>=10, default 30)>
-l <logging verbosity (ERROR=0, WARNING=1, DEBUG=2, default 0)>
C:\Program Files (x86)\pgAgent\bin>pgagent INSTALL pgAgent -u postgres -p admin
-l 2 hostaddr=127.0.0.1 port=5433 user=postgres dbname=first password=admin
ok guys, i am able to solve the issue, by reinstalling PostgreSQL and then installing pgAgent with StackBuilder.