[pgsql-jp: 34935] Re: Windows 版の \i での読み込みホルダ
Sato_Kenichi
satok-point @ mf.point.ne.jp
2005年 2月 27日 (日) 21:55:13 JST
さとうです。
>Windows版のPostgresの psqlにも\iメニュがあるようなのですが、
>dataホルダ等にファイルを置いても、読んでくれないようです。
フルパスでファイル名を指定すればいいのではないでしょうか?
パスを省略するとカレントフォルダから読み込むみたいです。
とりあえず d:\work\tst.sql というファイルを作成して、コマンドプロンプトか
ら実行したところ、正常に動作しました。
パス区切りは \\ でも / でもいいみたいですね。
---
佐藤 研一
E-Mail: satok-point @ mf.point.ne.jp
////// 以下実行ログです //////////////////////////////////////////
C:\>type d:\work\tst.sql
select version();
C:\>psql template1
Welcome to psql 8.0.1, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
template1=# \i 'd:/work/tst.sql'
version
--------------------------------------------------------------------------------
----------
PostgreSQL 8.0.1 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw
-special)
(1 row)
template1=# \i 'd:\\work\\tst.sql'
version
--------------------------------------------------------------------------------
----------
PostgreSQL 8.0.1 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw
-special)
(1 row)
template1=#
pgsql-jp メーリングリストの案内