Обсуждение: \i running on windows
Hi all, I'd like to use for the first time postgres on windows, used the installer no problem (good stuff) i saw pgadmin (good gui) but when trying to use the \i I can't figure a way to find my script to be imported... What is the correct PATH to be used ? Where should I put my files in order to Postgres top find them ? It 's very annoying... I tried several notations (windows or Unix ones), I tried absolute & relative paths ? I set up some env vars (PG_HOME & PG_DATA) soi I tried to put scripts on the PG_HOME directory but it doesn't work.. Any idea ? Cheers jerome
Where are you trying to run your scripts, in PgAdmin, or from the psql client? In psql you should specify the full path to your script, ie. \i C:\The folder\the script.sql In PgAdmin, the easiest way is to start a new query, then copy and paste your script in (or there may be an "open script" option to read it from file) - I haven't used PgAdmin, I use SQL Manager's PostgreSQL Manager Lite - it's much more intuitive. Andy -----Original Message----- From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of jerome Sent: Friday, 26 May, 2006 7:20 pm To: pgsql-admin@postgresql.org Subject: [ADMIN] \i running on windows Hi all, I'd like to use for the first time postgres on windows, used the installer no problem (good stuff) i saw pgadmin (good gui) but when trying to use the \i I can't figure a way to find my script to be imported... What is the correct PATH to be used ? Where should I put my files in order to Postgres top find them ? It 's very annoying... I tried several notations (windows or Unix ones), I tried absolute & relative paths ? I set up some env vars (PG_HOME & PG_DATA) soi I tried to put scripts on the PG_HOME directory but it doesn't work.. Any idea ? Cheers jerome ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match !DSPAM:14,44774d5a34493449410149!
Andy Shellam a écrit : >Where are you trying to run your scripts, in PgAdmin, or from the psql >client? In psql you should specify the full path to your script, ie. \i >C:\The folder\the script.sql > >In PgAdmin, the easiest way is to start a new query, then copy and paste >your script in (or there may be an "open script" option to read it from >file) - I haven't used PgAdmin, I use SQL Manager's PostgreSQL Manager Lite >- it's much more intuitive. > >Andy > >-----Original Message----- >From: pgsql-admin-owner@postgresql.org >[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of jerome >Sent: Friday, 26 May, 2006 7:20 pm >To: pgsql-admin@postgresql.org >Subject: [ADMIN] \i running on windows > >Hi all, >I'd like to use for the first time postgres on windows, used the installer >no problem (good stuff) i saw pgadmin (good gui) but when trying to use the >\i I can't figure a way to find my script to be imported... >What is the correct PATH to be used ? Where should I put my files in order >to Postgres top find them ? It 's very annoying... >I tried several notations (windows or Unix ones), I tried absolute & >relative paths ? I set up some env vars (PG_HOME & PG_DATA) soi I tried to >put scripts on the PG_HOME directory but it doesn't work.. >Any idea ? > >Cheers >jerome > >---------------------------(end of broadcast)--------------------------- >TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match > >!DSPAM:14,44774d5a34493449410149! > > > > > thanks for your answer andy... but it doesn't help me much , be cause eveen using simple paths like c:\myscript.sql fail with a fristrating error permission...I can't guess how to change permissions to enable reading (files saved under my windows profile & read from the postgres user).. thanks jerome
Have you tried running your script in PgAdmin (or similar GUI)? e.g. copy and paste your script into a new query? jerome wrote: > Andy Shellam a écrit : > > >> Where are you trying to run your scripts, in PgAdmin, or from the psql >> client? In psql you should specify the full path to your script, ie. \i >> C:\The folder\the script.sql >> >> In PgAdmin, the easiest way is to start a new query, then copy and paste >> your script in (or there may be an "open script" option to read it from >> file) - I haven't used PgAdmin, I use SQL Manager's PostgreSQL Manager Lite >> - it's much more intuitive. >> >> Andy >> >> -----Original Message----- >> From: pgsql-admin-owner@postgresql.org >> [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of jerome >> Sent: Friday, 26 May, 2006 7:20 pm >> To: pgsql-admin@postgresql.org >> Subject: [ADMIN] \i running on windows >> >> Hi all, >> I'd like to use for the first time postgres on windows, used the installer >> no problem (good stuff) i saw pgadmin (good gui) but when trying to use the >> \i I can't figure a way to find my script to be imported... >> What is the correct PATH to be used ? Where should I put my files in order >> to Postgres top find them ? It 's very annoying... >> I tried several notations (windows or Unix ones), I tried absolute & >> relative paths ? I set up some env vars (PG_HOME & PG_DATA) soi I tried to >> put scripts on the PG_HOME directory but it doesn't work.. >> Any idea ? >> >> Cheers >> jerome >> >> ---------------------------(end of broadcast)--------------------------- >> TIP 9: In versions below 8.0, the planner will ignore your desire to >> choose an index scan if your joining column's datatypes do not >> match >> >> >> >> >> >> >> >> > thanks for your answer andy... > but it doesn't help me much , be cause eveen using simple paths like > c:\myscript.sql fail with a fristrating error permission...I can't guess > how to change permissions to enable reading (files saved under my > windows profile & read from the postgres user).. > > thanks > jerome > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly > > !DSPAM:14,4478078334491417513125! > > >
Andy Shellam a écrit : >Have you tried running your script in PgAdmin (or similar GUI)? e.g. >copy and paste your script into a new query? > > > yes the script is perfectly right .. it was just a test of table creation in order to try this aspect but whatever the location is, I can't even execute it..
Hi Jerome Change the Windows-backslashes into *normal* slashes like: test=# \i c:/Apache/htdocs/projekte/ulm_lokal/pg_dump.sql regards Conni