fix: wrong field in odbc conf for db connection
The current "Server" field is invalid and cannot be used to configure remote database server
The unixODBC 2.3.12 man page for odbc.ini does show Servername as the parameter but the mysql/mariadb connector will accept Server as well. If Socket is also specified it will ignore Server/Servername and use the socket specified. If neither Server/Servername nor Socket are specified the driver will use localhost as the server and connect via TCP.
The Postgresql driver on the other hand, oinly accepts Servername and ignores Server altogether. If neither Servername nor Socket are specified, it will connect via the default socket /var/run/postgresql/.s.PGSQL.5432.
So, it does seem that Servername is correct.
Oh, for both drivers, if both Servername and Socket are specified, Socket takes precedence and Servername is ignored.
@gibix You might want to add a note to that effect on those pages.
The Postgresql driver on the other hand, oinly accepts
Servernameand ignoresServeraltogether.
Can you cite your source on this?
This is really minor but I would love to see some documentation that Server is "invalid."
odbc.ini:
[asterisk-pgsql]
Description=PostgreSQL connection to 'asterisk' database
Driver=PostgreSQL
Database=asterisk
Server=foobar
UserName=asterisk
Password=asterisk
Port=5432
Protocol=13.0
# isql asterisk-pgsql
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| echo [string] |
| quit |
| |
+---------------------------------------+
SQL>
# netstat -anxp | grep '[.]5432'
unix 2 [ ACC ] STREAM LISTENING 13184 2812/postgres /tmp/.s.PGSQL.5432
unix 3 [ ] STREAM CONNECTED 46871406 1788870/postgres: a /var/run/postgresql/.s.PGSQL.5432
unix 2 [ ACC ] STREAM LISTENING 13183 2812/postgres /var/run/postgresql/.s.PGSQL.5432
[asterisk-pgsql]
Description=PostgreSQL connection to 'asterisk' database
Driver=PostgreSQL
Database=asterisk
Servername=foobar
UserName=asterisk
Password=asterisk
Port=5432
Protocol=13.0
# isql asterisk-pgsql
[ISQL]ERROR: Could not SQLConnect
Hello, thanks for the review. I can confirm that I spotted the bug while trying to connect odbc with postgres on a remote server. I add a note for server