我写了这个 PostgreSQL 代码行,但是我遇到了以下错误:
错误:无法连接到服务器“server\sqlexpress”
SQL状态:08001
我究竟做错了什么?
我的代码:
在 Windows 8.1 上使用 PostgreSQL 9.3,在同一窗口上使用 MS SQL Express 2012
CREATE EXTENSION posgres_fdw;
Query returned successfully with no result in 11 ms.
CREATE SERVER "server\SQLExpress" FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (host 'localhost', dbname 'andesmar');
Query returned successfully with no result in 12 ms.
CREATE USER MAPPING FOR public SERVER "server\sqlexpress"
OPTIONS (user 'sa', password '1234');
Query returned successfully with no result in 12 ms.
CREATE FOREIGN TABLE datosplataforma (
id bigint NOT NULL,
messagedate date NOT NULL,
receiveddate date NOT NULL,
latitude real,
longitude real,
GPSspeed real,
bearingangle integer,
odometer integer,
eventtypeid integer,
vehicleid integer,
alertid integer
)
SERVER "server\sqlexpress";
Query returned successfully with no result in 12 ms.
select * from datosplataforma;
ERROR: could not connect to server "server\sqlexpress"
SQL state: 08001