Обсуждение: Postgresql On Windows

Поиск
Список
Период
Сортировка

Postgresql On Windows

От
MDB
Дата:
What is the path format for the i (\i) command in the SQL shell?



Thank you.





Re: Postgresql On Windows

От
Raymond O'Donnell
Дата:
On 27/03/2009 14:28, MDB wrote:
> What is the path format for the i (\i) command in the SQL shell?

I think it's just as anywhere else on Windows, e.g.

    \i c:\path\to\file.sql

If there are spaces in the path you may have to enclose it in double-quotes:

    \i "c:\path with spaces\file.sql"

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

Re: Postgresql On Windows

От
Aurimas Černius
Дата:
Hi,

>> What is the path format for the i (\i) command in the SQL shell?
>
> I think it's just as anywhere else on Windows, e.g.
>
>      \i c:\path\to\file.sql

Windows support forward slashes as well, only not all Windows programs
do support that (cmd.exe for example doesn't). So, it's worth a try.

--
Aurimas

Re: Postgresql On Windows

От
John Cheng
Дата:
From my experience, you must use the forward slash. Using the backslash may give you an error:

\i C:\sql\test.sql
C:: Permission denied

Instead, use

\i C:/sql/test.sql

________________________________
From: Raymond O'Donnell <rod@iol.ie>
To: MDB <mdb002@yahoo.com>
Cc: pgsql-general@postgresql.org
Sent: Friday, March 27, 2009 7:35:47 AM
Subject: Re: [GENERAL] Postgresql On Windows

On 27/03/2009 14:28, MDB wrote:
> What is the path format for the i (\i) command in the SQL shell?

I think it's just as anywhere else on Windows, e.g.

    \i c:\path\to\file.sql

If there are spaces in the path you may have to enclose it in double-quotes:

    \i "c:\path with spaces\file.sql"

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general






Re: Postgresql On Windows

От
Sam Mason
Дата:
On Fri, Mar 27, 2009 at 04:45:26PM +0200, Aurimas Černius wrote:
> Windows support forward slashes as well, only not all Windows programs
> do support that (cmd.exe for example doesn't). So, it's worth a try.

Where did you get the idea that cmd.exe doesn't support forward slashes?
It just passes them on to Windows like every other program and hence
(pretty much) just works.  The only time I've found it not to work is
when you type "cd /" and it doesn't go to the root of the drive you're
in which is a little strange.

If programs attempt to interpret the path and attribute special meaning
to backslashes then they will indeed break, but very few programs seem
to do this.

--
  Sam  http://samason.me.uk/

Re: Postgresql On Windows

От
MDB
Дата:
Thank you,

I also found you could drop the "C:" (e.g. "/sql/test.sql") if it is on the c drive. The backslashes on my system threw
thesame error.. 

--- On Fri, 3/27/09, John Cheng <jlcheng@ymail.com> wrote:

> From: John Cheng <jlcheng@ymail.com>
> Subject: Re: [GENERAL] Postgresql On Windows
> To: pgsql-general@postgresql.org
> Date: Friday, March 27, 2009, 12:16 PM
>
> From my experience, you must use the forward slash. Using
> the backslash may give you an error:
>
> \i C:\sql\test.sql
> C:: Permission denied
>
> Instead, use
>
> \i C:/sql/test.sql
>
> ________________________________
> From: Raymond O'Donnell <rod@iol.ie>
> To: MDB <mdb002@yahoo.com>
> Cc: pgsql-general@postgresql.org
> Sent: Friday, March 27, 2009 7:35:47 AM
> Subject: Re: [GENERAL] Postgresql On Windows
>
> On 27/03/2009 14:28, MDB wrote:
> > What is the path format for the i (\i) command in the
> SQL shell?
>
> I think it's just as anywhere else on Windows, e.g.
>
>     \i c:\path\to\file.sql
>
> If there are spaces in the path you may have to enclose it
> in double-quotes:
>
>     \i "c:\path with spaces\file.sql"
>
> Ray.
>
> ------------------------------------------------------------------
> Raymond O'Donnell, Director of Music, Galway Cathedral,
> Ireland
> rod@iol.ie
> Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
> ------------------------------------------------------------------
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
>
>
>      
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>





Re: Postgresql On Windows

От
John R Pierce
Дата:
MDB wrote:
> Thank you,
>
> I also found you could drop the "C:" (e.g. "/sql/test.sql") if it is on the c drive.

to be more precise, you can drop the C: if its the same as the current
default drive for whatever process is reading it.   Windows, for legacy
reasons that date at least back to Digital Research's CP/M circa 1976,
tracks default drive separately from default directory.

Re: Postgresql On Windows

От
Dhaval Jaiswal
Дата:
 
>>     postgres=# \i C:/dj1.sql;
 
>>     If there are space.
         ------------------
          postgres=# \i  'C:/Program Files/PostgreSQL/8.3/bin/dj.sql';
    
 
Thanks & Regards
Dhaval Jaiswal
 

 


From: Raymond O'Donnell <rod@iol.ie>
To: MDB <mdb002@yahoo.com>
Cc: pgsql-general@postgresql.org
Sent: Friday, March 27, 2009 8:05:47 PM
Subject: Re: [GENERAL] Postgresql On Windows

On 27/03/2009 14:28, MDB wrote:
> What is the path format for the i (\i) command in the SQL shell?

I think it's just as anywhere else on Windows, e.g.

    \i c:\path\to\file.sql

If there are spaces in the path you may have to enclose it in double-quotes:

    \i "c:\path with spaces\file.sql"

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general