如题,只有 dump 出的 SQL 文件,部分内容截取如下:
--
-- PostgreSQL database dump
--
SET client_encoding = 'SQL_ASCII';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
--
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres
--
CREATE PROCEDURAL LANGUAGE plpgsql;
ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres;
SET search_path = public, pg_catalog;
--
-- Name: res_set; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE res_set AS (
pidnum integer,
nret smallint
);
ALTER TYPE public.res_set OWNER TO postgres;
--
-- Name: account_login(character varying, character varying, character varying); Type: FUNCTION; Schema: public; Owner: spiritking
--
CREATE FUNCTION account_login(character varying, character varying, character varying) RETURNS res_set
AS $_$declare
ppAccountID ALIAS FOR $1;
pPassword ALIAS FOR $2;
pClientIP ALIAS FOR $3;
pAccountID varchar(20);
pcount int;
pPwd char(32) default null;
pBAuthority int2 default 0;
pGMIP varchar(15) default null;
res res_set;
BEGIN
pAccountID = lower(ppAccountID);
res.nRet=-1;
...
请教如何确定原数据库的名称呢?
纯外行请教 查到了挺多关于 PostgreSQL 数据库迁移的教程,但是就没有一个提及数据库名称的 或者 PostgreSQL 对数据库命名不敏感?可以随便改名?
1
babyrjw 2023-11-17 13:03:14 +08:00
用啥名不影响 db 运行,在应用程序里改一下连接字符串就好了
|
3
yjhatfdu2 2023-11-17 13:24:47 +08:00
应用程序连接,连不上后看数据库日志里面的报错,应该可以看到尝试连接的数据库名,然后改成这个就行了
|
4
orangie 2023-11-17 14:03:17 +08:00
postgres 默认连接不加密,尝试抓包看一看?
|
5
zydxn 2023-11-17 14:07:43 +08:00
文件哪来的,能不能直接问下数据库名?正常 pg_dump 的时候一般也会 -d 指定库名。
|