|
|
| version 1.48, 2021/11/03 15:14:05 | version 1.49, 2021/11/03 16:27:15 |
|---|---|
| Line 155 public: | Line 155 public: |
| connection.autocommit=true; | connection.autocommit=true; |
| connection.standard_conforming_strings=true; | connection.standard_conforming_strings=true; |
| connection.conn=PQsetdbLogin( (host && strcasecmp(host, "local") == 0) ? NULL /* local Unix domain socket */ : host, port, NULL, NULL, db, user, pwd); | |
| if(!connection.conn) | |
| services._throw("PQsetdbLogin failed"); | |
| if(PQstatus(connection.conn)!=CONNECTION_OK) | |
| throwPQerror; | |
| while(options){ | while(options){ |
| if(char *key=lsplit(&options, '&')){ | if(char *key=lsplit(&options, '&')){ |
| if(*key){ | if(*key){ |
| Line 188 public: | Line 180 public: |
| } | } |
| } | } |
| connection.conn=PQsetdbLogin( (host && strcasecmp(host, "local") == 0) ? NULL /* local Unix domain socket */ : host, port, NULL, NULL, db, user, pwd); | |
| if(!connection.conn) | |
| services._throw("PQsetdbLogin failed"); | |
| if(PQstatus(connection.conn)!=CONNECTION_OK) | |
| throwPQerror; | |
| if(charset){ | if(charset){ |
| char statement[MAX_STRING+1]="SET CLIENT_ENCODING="; | char statement[MAX_STRING+1]="SET CLIENT_ENCODING="; |
| strncat(statement, charset, MAX_STRING); | strncat(statement, charset, MAX_STRING); |