installing + using pgAgent?[edited]

Questions and answers regarding general SQL and backend databases

Re: installing + using pgAgent?[edited]

Postby ROCLASI » Fri Apr 15, 2011 10:09 am

Hi Thomas,

Can you post here the output of the following command:
Code: Select all
psql -U postgres -d postgres -l

This lists all the databases without parsing them.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: installing + using pgAgent?[edited]

Postby tgs » Fri Apr 15, 2011 10:32 am

Hi Robert,
ROCLASI wrote:Can you post here the output of the following command:
Code: Select all
psql -U postgres -d postgres -l

This lists all the databases without parsing them.

I have tried the command in the Terminal, but: -bash: psql: command not found
What exactly shall I do to get the output?
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: installing + using pgAgent?[edited]

Postby ROCLASI » Fri Apr 15, 2011 10:34 am

tgs wrote:I have tried the command in the Terminal, but: -bash: psql: command not found
What exactly shall I do to get the output?

Use the full path:
Code: Select all
/Library/PostgreSQL/9.0/bin/psql -U postgres -d postgres -l
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: installing + using pgAgent?[edited]

Postby tgs » Fri Apr 15, 2011 10:41 am

Thank you once more Robert!!

Here is the output:
Code: Select all
List of databases
       Name        |  Owner   | Encoding |  Collation  |    Ctype    |   Access privileges   
-------------------+----------+----------+-------------+-------------+-----------------------
core_data         | postgres | UTF8     | de_DE.UTF-8 | de_DE.UTF-8 |
i18n_data         | postgres | UTF8     | de_DE.UTF-8 | de_DE.UTF-8 |
log_data          | postgres | UTF8     | de_DE.UTF-8 | de_DE.UTF-8 |
postgres          | postgres | UTF8     | de_DE.UTF-8 | de_DE.UTF-8 |
sample_data       | postgres | UTF8     | de_DE.UTF-8 | de_DE.UTF-8 |
servoy_repository | postgres | UTF8     | de_DE.UTF-8 | de_DE.UTF-8 |
template0         | postgres | UTF8     | de_DE.UTF-8 | de_DE.UTF-8 | =c/postgres          +
                   |          |          |             |             | postgres=CTc/postgres
template1         | postgres | UTF8     | de_DE.UTF-8 | de_DE.UTF-8 | =c/postgres          +
                   |          |          |             |             | postgres=CTc/postgres
tgsproject        | postgres | UTF8     | de_DE.UTF-8 | de_DE.UTF-8 |
Last edited by tgs on Fri Apr 15, 2011 11:00 am, edited 1 time in total.
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: installing + using pgAgent?[edited]

Postby ROCLASI » Fri Apr 15, 2011 10:55 am

Hi Thomas,

Found the issue. Here is the updated code:
Code: Select all
databases=`$pg_tools/psql $pg_host -U postgres -d postgres -l | sed -n 4,/\eof/p | grep -v rows\) | awk {'print$1'} | grep -v \| | grep -v template | grep -v postgres`


I also update the script in my first post in this thread.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: installing + using pgAgent?[edited]

Postby tgs » Fri Apr 15, 2011 11:33 am

Hi Robert,

now the script is working well as it should be!
You are the Master :) and helped me (and perhaps many others) a lot. All my PostgreSQL installations should now be professional backed up.

Regards,
Thomas
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Previous

Return to SQL Databases

Who is online

Users browsing this forum: No registered users and 3 guests