BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
ytcaudience
Fluorite | Level 6

Whenever I run the following line of code in SAS Studio:

 

libname test1 postgres server="192.xxx.xx.xxx" port=5432
user=postgres password='postgres' database=mydb;

 

I get this error:

 

ERROR: CLI error trying to establish connection: could not connect to server: Connection timed outIs the server running on host
"192.xxx.xx.xxx" and acceptingTCP/IP connections on port 5432?
 
Note: I can access the database server "192.xxx.xx.xxx" from a pgadmin UI on machines other than "192.xxx.xx.xxx". 
I can ping to "192.xxx.xx.xxx".
This connects perfectly well from any machine:
psql -h 192.xxx.xx.xxx -U postgres -d postgres
 
This also works from any machine:
telnet 192.xxx.xx.xxx 5432
 
Please help.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ytcaudience
Fluorite | Level 6

Thank you for your help @SASKiwi 

 

The actual problem was that the 192.xxx.xx.xxx address is not reachable from the SAS Studio compute server. 

The solution was that I had to ping my hostname and it revealed the SAS net ip address ("xxx.xxx.xx.xxx") and when I replaced my local server's ip (192.xxx.xx.xxx) with this new SAS net ip address, it WORKED!!!

 

libname test1 postgres server="xxx.xxx.xx.xxx" port=5432
user=postgres password='postgres' database=mydb;

 

 

View solution in original post

2 REPLIES 2
SASKiwi
PROC Star

It is port 5432 on your SAS Compute server that needs to be checked. Try your PSQL command while remotely logged onto this server.

ytcaudience
Fluorite | Level 6

Thank you for your help @SASKiwi 

 

The actual problem was that the 192.xxx.xx.xxx address is not reachable from the SAS Studio compute server. 

The solution was that I had to ping my hostname and it revealed the SAS net ip address ("xxx.xxx.xx.xxx") and when I replaced my local server's ip (192.xxx.xx.xxx) with this new SAS net ip address, it WORKED!!!

 

libname test1 postgres server="xxx.xxx.xx.xxx" port=5432
user=postgres password='postgres' database=mydb;

 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 585 views
  • 1 like
  • 2 in conversation