[GENERAL] Logfile permissions

2009-02-10 Thread Thomas Guettler
Hi, my logfiles all have this permission: -rw--- 1 postgres postgres14841 10. Feb 08:52 postgresql-2009-02-10_00.log Is it possible that postgres creates group readable files? I want to monitor this logfile, but for security I don't want to use the postgres user for this. I looked

[GENERAL] Query Question

2009-02-10 Thread Schwaighofer Clemens
I have two tables Table public.mailings Column | Type| Modifiers +---+--- key| character varying | name | character varying | Table public.userdata Column | Type| Modifiers

[GENERAL] tablelog

2009-02-10 Thread Philippe Lang
Hi, I'm using tablelog (http://pgfoundry.org/projects/tablelog/) on an old FreeBSD 6 / Postgresql 7.4 server, and I'm really happy with it. It always worked great. I saw this morning that the project used to be accepted for a while in the debian packages repository, but has been removed last

Re: [GENERAL] dbi_link help

2009-02-10 Thread SHARMILA JOTHIRAJAH
Thanks Richard --- On Tue, 2/10/09, Richard Huxton d...@archonet.com wrote: From: Richard Huxton d...@archonet.com Subject: Re: [GENERAL] dbi_link help To: sharmi...@yahoo.com Cc: General postgres mailing list pgsql-general@postgresql.org Date: Tuesday, February 10, 2009, 2:51 AM SHARMILA

[GENERAL] Deleting conflicting rows when creating a foreign key

2009-02-10 Thread Igor Katson
I am doing an ALTER TABLE to create a foreign key, however with some rows i get: insert or update on table name violates foreign key constraint name_fkey How can I just drop the conflicting rows while doing that? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make

[GENERAL] Slow database creation

2009-02-10 Thread Rob Richardson
Greetings! My company has an application that runs on one machine and reads a PostgreSQL database that may be located on another. I have a test version of this application and a copy of their database on my computer. A problem that the application solves on my machine in under 10 seconds takes

Re: [GENERAL] Convert Arbitrary Table to Array?

2009-02-10 Thread Merlin Moncure
On Mon, Feb 9, 2009 at 4:14 PM, Harald Fuchs hari.fu...@gmail.com wrote: In article 17050.1234200...@sss.pgh.pa.us, Tom Lane t...@sss.pgh.pa.us writes: Lee Hughes l...@hughesys.com writes: Hi, I need a function that accepts a table name and returns a 2-dimensional array of the table data.

Re: [GENERAL] tablelog

2009-02-10 Thread Andreas 'ads' Scherbaum
Hello Philippe, i'm the author of tablelog. On Tue, 10 Feb 2009 11:52:13 +0100 Philippe Lang wrote: I'm using tablelog (http://pgfoundry.org/projects/tablelog/) on an old FreeBSD 6 / Postgresql 7.4 server, and I'm really happy with it. It always worked great. I saw this morning that

[GENERAL] No MD5SUM for 8.1.16 RHEL5 rpms

2009-02-10 Thread Joey K.
Hello, I downloaded RHEL5 rpm files for the latest 8.1.16 release and could not find the MD5 file for them. http://ftp9.us.postgresql.org/pub/mirrors/postgresql/binary/v8.1.16/linux/rpms/redhat/rhel-5-i386/ 8.1.15 RHEL5 roms had them,

Re: [GENERAL] Slow database creation

2009-02-10 Thread Richard Huxton
Rob Richardson wrote: Can anyone explain why it would take 167 seconds to create a database? I am hoping that it's the same reason that data access is slowing our application by a factor of about 200. The customer's machines run Windows Server 2003. My machine runs Windows XP

Re: [GENERAL] Deleting conflicting rows when creating a foreign key

2009-02-10 Thread Richard Huxton
Igor Katson wrote: I am doing an ALTER TABLE to create a foreign key, however with some rows i get: insert or update on table name violates foreign key constraint name_fkey How can I just drop the conflicting rows while doing that? You can't automatically. You can do something like:

[GENERAL] Good Delimiter for copy command

2009-02-10 Thread SHARMILA JOTHIRAJAH
Hi, What is a good delimiter to use for COPY command. Im trying to use COPY command to copy data from one table to another in 2 different databases. Can you suggest a unique delimiter that I can use for this COPY command Thanks Sharmial

[GENERAL] Slow cross-machine read on one table

2009-02-10 Thread Rob Richardson
Hello again! I modified the application I mentioned in my last post, the one that is taking 20 minutes to solve a problem on our customer's system that is solved in under ten seconds on my machine. The application is written in C++. All data access is through a class named CCRecordset. We

Re: [GENERAL] Convert Arbitrary Table to Array?

2009-02-10 Thread Martin Gainty
the array needs to be named to a different name than the original table e.g. CREATE OR REPLACE TYPE DOUBLE_NUMBER AS OBJECT (num1 NUMBER,num2 NUMBER); --Create an Array which will use 2 of the double_numbers we just created CREATE OR REPLACE TYPE TABLE_ARRAY AS VARRAY(2) OF DOUBLE_NUMBER;

Re: [GENERAL] tablelog

2009-02-10 Thread Bruno Lavoie
While we are talking about this, is a development like Oracle Flashback queries planned maybe? You can flashback to old data, but you need to use the tablelog functions. Oracle Flashback Query seems to use undo logs to return in a point in time if the undo retention param permit it.

[GENERAL] does anyone know what to use in pg_hba.conf that will allow me to run cronjobs with pg_dump?

2009-02-10 Thread Jonathan Vanasco
i think i just need a METHOD for localhost only. thanks. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Slow database creation

2009-02-10 Thread Andrej
2009/2/11 Rob Richardson rob.richard...@rad-con.com: [... snipped ...] In order to test without disturbing the customer's production, I created a copy of their production database on the production server. I often create test databases, and I've never seen the CREATE DATABASE command take

Re: [GENERAL] does anyone know what to use in pg_hba.conf that will allow me to run cronjobs with pg_dump?

2009-02-10 Thread Richard Huxton
Jonathan Vanasco wrote: i think i just need a METHOD for localhost only. You can either trust any connections from the local machine, or if that's too insecure use a .pgpass file. http://www.postgresql.org/docs/current/static/libpq-pgpass.html -- Richard Huxton Archonet Ltd -- Sent via

[GENERAL] createdb.exe and psql.exe without Promting Password

2009-02-10 Thread Inigo Barandiaran
Hi. I would like to create an script that includes calls to createdb.exe and psql.exe. I would like to use them with a user but without asking or prompting for pasword. For example: createdb.exe -T template0 -U MyPosgresUser MyDataBaseName. I've read that if I define an environment variable

Re: [GENERAL] createdb.exe and psql.exe without Promting Password

2009-02-10 Thread Richard Huxton
Inigo Barandiaran wrote: Hi. I would like to create an script that includes calls to createdb.exe and psql.exe. I would like to use them with a user but without asking or prompting for pasword. For example: createdb.exe -T template0 -U MyPosgresUser MyDataBaseName.

Re: [GENERAL] createdb.exe and psql.exe without Promting Password

2009-02-10 Thread Raymond O'Donnell
On 10/02/2009 18:04, Inigo Barandiaran wrote: I would like to create an script that includes calls to createdb.exe and psql.exe. I would like to use them with a user but without asking or prompting for pasword. For example: createdb.exe -T template0 -U MyPosgresUser MyDataBaseName. I've

Re: [GENERAL] Slow database creation

2009-02-10 Thread Alban Hertroys
On Feb 10, 2009, at 3:09 PM, Rob Richardson wrote: In order to test without disturbing the customer's production, I created a copy of their production database on the production server. I often create test databases, and I've never seen the CREATE DATABASE command take longer than five

Re: [GENERAL] createdb.exe and psql.exe without Promting Password

2009-02-10 Thread Iñigo Barandiaran
Thanks Raymon. I'm using Windows XP. What does "visible to the script" means? Thanks in advance! Best, On 10/02/2009 18:04, Inigo Barandiaran wrote: I would like to create an script that includes calls to createdb.exe and psql.exe. I would like to use them with a user but

Re: [GENERAL] does anyone know what to use in pg_hba.conf that will allow me to run cronjobs with pg_dump?

2009-02-10 Thread Sam Mason
On Tue, Feb 10, 2009 at 05:45:27PM +, Richard Huxton wrote: Jonathan Vanasco wrote: i think i just need a METHOD for localhost only. You can either trust any connections from the local machine, or if that's too insecure use a .pgpass file. If your database user has the same name as the

Re: [GENERAL] Good Delimiter for copy command

2009-02-10 Thread Sam Mason
On Tue, Feb 10, 2009 at 07:07:42AM -0800, SHARMILA JOTHIRAJAH wrote: What is a good delimiter to use for COPY command. Im trying to use COPY command to copy data from one table to another in 2 different databases. Can you suggest a unique delimiter that I can use for this COPY command If

Fwd: [GENERAL] createdb.exe and psql.exe without Promting Password

2009-02-10 Thread Iñigo Barandiaran
Thanks Raymon. I'm using Windows XP. What does visible to the script means? Thanks in advance! Best, On 10/02/2009 18:04, Inigo Barandiaran wrote: I would like to create an script that includes calls to createdb.exe and psql.exe. I would like to use them with a user but without asking

Fwd: [GENERAL] createdb.exe and psql.exe without Promting Password

2009-02-10 Thread Iñigo Barandiaran
Thanks Raymon. I'm using Windows XP. What does visible to the script means? Thanks in advance! Best, On 10/02/2009 18:04, Inigo Barandiaran wrote: I would like to create an script that includes calls to createdb.exe and psql.exe. I would like to use them with a user but without asking or

Re: [GENERAL] tablelog

2009-02-10 Thread Andreas 'ads' Scherbaum
On Tue, 10 Feb 2009 11:36:38 -0500 Bruno Lavoie wrote: Oracle Flashback Query seems to use undo logs to return in a point in time if the undo retention param permit it. You can do it with a date, or with the SCN (system change number), a kind of transaction number. It saves you

Re: [GENERAL] tablelog

2009-02-10 Thread Tom Lane
Andreas 'ads' Scherbaum adsm...@wars-nicht.de writes: On Tue, 10 Feb 2009 11:36:38 -0500 Bruno Lavoie wrote: Oracle Flashback Query seems to use undo logs to return in a point in time if the undo retention param permit it. You can do it with a date, or with the SCN (system change number), a

[GENERAL] Referencing Cursor/Row/Record Fields in PL/PgSQL

2009-02-10 Thread Lee Hughes
Trying to figure out how to reference a field in a cursor result, or in a row/record variable that I've FETCHed the cursor into, where the target field name is in a variable or parameter. I think I'm just missing the dereferencing syntax. I've studied the manual and tried using EXECUTE to no

Re: [GENERAL] Referencing Cursor/Row/Record Fields in PL/PgSQL

2009-02-10 Thread Tom Lane
Lee Hughes l...@hughesys.com writes: Trying to figure out how to reference a field in a cursor result, or in a row/record variable that I've FETCHed the cursor into, where the target field name is in a variable or parameter. I think I'm just missing the dereferencing syntax. There isn't any

Re: [GENERAL] createdb.exe and psql.exe without Promting Password

2009-02-10 Thread Sam Mason
On Tue, Feb 10, 2009 at 07:22:24PM +0100, IIIigo Barandiaran wrote: What does visible to the script means? Each command interpreter has its own set of variables; you need to set them in the correct one. For example, starting one copy of cmd and typing SET var=value and then closing it and

[GENERAL] In need of help with message fetching query

2009-02-10 Thread Max Strömberg
Hello everyone. I'm working on a small project of mine, which basically revolves around messages. These messages are to be ordered in a very standard fashion of single-depth threads. That is, a message can be a reply, and a so-called head. A head is simply the head of a chain. To put it more

Re: [GENERAL] createdb.exe and psql.exe without Promting Password

2009-02-10 Thread Raymond O'Donnell
On 10/02/2009 21:47, Sam Mason wrote: On Tue, Feb 10, 2009 at 07:22:24PM +0100, IIIigo Barandiaran wrote: What does visible to the script means? Each command interpreter has its own set of variables; you need to set them in the correct one. For example, starting one copy of cmd and typing

[GENERAL] Continual increase of age(datfrozenxid) for template0

2009-02-10 Thread Justin Pasher
Hello, I'm trying to understand if this is normal. This is a Postgres 8.1.15 server (the same one in use when I reported the autovacuum problem here: http://archives.postgresql.org/pgsql-general/2009-01/msg00404.php). Since most of our servers are still stuck on Postgres 7.4, I don't have

Re: [GENERAL] In need of help with message fetching query

2009-02-10 Thread Sam Mason
On Tue, Feb 10, 2009 at 11:19:13PM +0100, Max Strrrmberg wrote: [...] messages are to be ordered in a very standard fashion of single-depth threads. That is, a message can be a reply, and a so-called head. create table messages ( id serial not null primary key, author_id integer null

Re: [GENERAL] encoding of PostgreSQL messages

2009-02-10 Thread Hiroshi Inoue
Tom Lane wrote: Peter Eisentraut pete...@gmx.net writes: Bruce Momjian wrote: Can someone comment on this? I think we have discussed more proper solutions earlier in this thread. IMO the best approach would be for the client to include the client encoding in the startup package.

Re: [GENERAL] Referencing Cursor/Row/Record Fields in PL/PgSQL

2009-02-10 Thread Lee Hughes
I thought that's what EXECUTE was for in plpgsql -- isn't there a way to extract the value of a field in a row/record variable by building a SELECT string and passing it to EXECUTE? On Tue, Feb 10, 2009 at 1:22 PM, Tom Lane t...@sss.pgh.pa.us wrote: Lee Hughes l...@hughesys.com writes: Trying

Re: [GENERAL] Continual increase of age(datfrozenxid) for template0

2009-02-10 Thread Tom Lane
Justin Pasher just...@newmediagateway.com writes: As you can see, it is starting to approach the 2 billion mark. If I change the datallowconn setting to TRUE, connect to template0, then perform a VACUUM FREEZE, the age(datfrozenxid) goes way down (probably around the 3 million mark).

Re: [GENERAL] encoding of PostgreSQL messages

2009-02-10 Thread Tom Lane
Hiroshi Inoue in...@tpf.co.jp writes: I'm thinking of the following steps in the backend code. 1.Set LC_MESSAGES to C until the client_encoding is determined. 2.When a client_encoding is specifed in the startup message, bind the corrsponding codeset to the textdomain and set

[GENERAL] Intel SSD

2009-02-10 Thread Sebastian Böhm
Hi, I consider buying one of these Intel SSDs for my Database (MLC). I have a few questions regarding this, maybe some of you already have some experience with that. - which files should not be put onto the SSD (pg_clog ? pg_xlog ? ) to reduce wear (which may be an issue with the MLC

[GENERAL] 'text' is gone?

2009-02-10 Thread johnf
Looks like microsoft is going to drop the data type text in the near future. VarChar(max) will be taking it's place. Does Postgres have some like varChar(max)? -- John Fabiani -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] 'text' is gone?

2009-02-10 Thread Chris
johnf wrote: Looks like microsoft is going to drop the data type text in the near future. VarChar(max) will be taking it's place. Does Postgres have some like varChar(max)? You can either specify a max length (varchar(X)) or leave the length off to get a text like field: varchar

Re: [GENERAL] 'text' is gone?

2009-02-10 Thread Adrian Klaver
On Tuesday 10 February 2009 6:39:27 pm johnf wrote: Looks like microsoft is going to drop the data type text in the near future. VarChar(max) will be taking it's place. Does Postgres have some like varChar(max)? -- John Fabiani

Re: [GENERAL] 'text' is gone?

2009-02-10 Thread Tom Lane
Adrian Klaver akla...@comcast.net writes: On Tuesday 10 February 2009 6:39:27 pm johnf wrote: Looks like microsoft is going to drop the data type text in the near future. VarChar(max) will be taking it's place. Does Postgres have some like varChar(max)?

[GENERAL] Case-sensitive connect in psql is perplexing

2009-02-10 Thread Kevin Murphy
I've noticed that the argument to the \c (connect) meta-command is case-sensitive. This doesn't seem to be consistent with other meta-commands or the SQL standard of case-insensitive identifiers. Would it hurt to change the behavior? Regards, Kevin Murphy -- Sent via pgsql-general mailing

Re: [GENERAL] Case-sensitive connect in psql is perplexing

2009-02-10 Thread Tom Lane
Kevin Murphy mur...@genome.chop.edu writes: I've noticed that the argument to the \c (connect) meta-command is case-sensitive. This doesn't seem to be consistent with other meta-commands or the SQL standard of case-insensitive identifiers. ... however, it's consistent with the behavior of

Re: [GENERAL] Referencing Cursor/Row/Record Fields in PL/PgSQL

2009-02-10 Thread Pavel Stehule
Hello 2009/2/11 Lee Hughes l...@hughesys.com: I thought that's what EXECUTE was for in plpgsql -- isn't there a way to extract the value of a field in a row/record variable by building a SELECT string and passing it to EXECUTE? not in plpgsql. Try, plperl or some synamic PL language, please

Re: [GENERAL] Deleting conflicting rows when creating a foreign key

2009-02-10 Thread Craig Ringer
Richard Huxton wrote: DELETE FROM table1 WHERE col1 NOT IN (SELECT id from table2); Just as a side note: If you have a large number of missing IDs and don't want to wait a long time, you may be better off with something like (untested, but I think it's right - TEST FIRST): SELECT * FROM table1

Re: [GENERAL] Slow cross-machine read on one table

2009-02-10 Thread Craig Ringer
Rob Richardson wrote: The slow access seems to be happening with a single table. Here's the query: Can you post EXPLAIN ANALYZE output? This query took about 75 seconds. I ran PGAdmin on the same machine that the application is running on, and executed the same query on the same

Re: [GENERAL] encoding of PostgreSQL messages

2009-02-10 Thread Hiroshi Inoue
Tom Lane wrote: Hiroshi Inoue in...@tpf.co.jp writes: I'm thinking of the following steps in the backend code. 1.Set LC_MESSAGES to C until the client_encoding is determined. 2.When a client_encoding is specifed in the startup message, bind the corrsponding codeset to the textdomain

Re: [GENERAL] 'text' is gone?

2009-02-10 Thread johnf
On Tuesday 10 February 2009 07:22:45 pm Tom Lane wrote: I don't think I believe the OP's premise anyway.  The concept that every string column has to have a specific hard-coded maximum length is an evil hangover from the days of punched cards.  It seems very unlikely that M$, who are not

Re: [GENERAL] 'text' is gone?

2009-02-10 Thread Scott Marlowe
On Tue, Feb 10, 2009 at 10:49 PM, johnf jfabi...@yolo.com wrote: To solve this problem, Microsoft introduced the VARCHAR(MAX), NVARCHAR(MAX), and VARBINARY(MAX) data types in SQL Server 2005. These data types can hold the same amount of data BLOBs can hold (2 GB) and they are stored in the

[GENERAL] creating tables using a file

2009-02-10 Thread Kusuma Pabba
hello all, i have used a file containing all the queries and directly executed the file to create tables in mysql, now i want to use the same for psql is it possible? if yes how? Do i need to make any changes to the file? Thanks for any help Regards kusuma.p -- Sent via pgsql-general

[GENERAL] Pl/PgSQL String formatting like raise?

2009-02-10 Thread Csaba Együd
Hi, is there a way in a Pl/PgSQL function (PG 8.1.* / 8.3.*) to cut together a string value like it is done for RAISE Note/Exception? I'd like to use s.g. like this : StrVar := 'select * from t1 where f1=% and f2=%', quote_literal(Param1),quote_literal(Param2); Many Thanks! csaba --

Re: [GENERAL] 'text' is gone?

2009-02-10 Thread Craig Ringer
Scott Marlowe wrote: So, they did exactly what pgsql crew did with TOAST, but instead of sticking it under an existing datatype that everyone already had, they made another new type to keep track of. I can't think of a reason to not just update the text type to be just like the leader's,

Re: [GENERAL] creating tables using a file

2009-02-10 Thread Craig Ringer
Kusuma Pabba wrote: hello all, i have used a file containing all the queries and directly executed the file to create tables in mysql, now i want to use the same for psql is it possible? psql -f filename.sql Do i need to make any changes to the file? Lots. PostgreSQL and MySQL have

Re: [GENERAL] Intel SSD

2009-02-10 Thread John R Pierce
Sebastian Böhm wrote: I consider buying one of these Intel SSDs for my Database (MLC). . currently I have a lot of small random reads/writes causing heavy iowait. how many r/s and w/s in `iostat -x 5` while your database is humming are you seeing now?Thats the single key performance

Re: [GENERAL] creating tables using a file

2009-02-10 Thread A. Kretschmer
In response to Kusuma Pabba : hello all, i have used a file containing all the queries and directly executed the file to create tables in mysql, now i want to use the same for psql is it possible? Sure, psql -f or within psql with \i. Andreas -- Andreas Kretschmer Kontakt: Heynitz:

Re: [GENERAL] Pl/PgSQL String formatting like raise?

2009-02-10 Thread Pavel Stehule
Hello there is nothing similar. You should to use module plvsubst from Orafce http://www.postgres.cz/index.php/Oracle_functionality_(en)#PLVsubst regards Pavel Stehule 2009/2/11 Csaba Együd cseg...@gmail.com: Hi, is there a way in a Pl/PgSQL function (PG 8.1.* / 8.3.*) to cut together a

Re: [GENERAL] encoding of PostgreSQL messages

2009-02-10 Thread Peter Eisentraut
Tom Lane wrote: Reflecting on the bigger picture ... I would imagine that the vast majority of existing applications depend on client_encoding settings that come from postgresql.conf, ALTER USER SET, ALTER DATABASE SET, or just the default (== database encoding). I don't think a solution that

Re: [GENERAL] encoding of PostgreSQL messages

2009-02-10 Thread Peter Eisentraut
Tom Lane wrote: I believe the only real fix is to guarantee that messages are sent as untranslated ASCII until we have sent an encoding indicator at the end of the startup sequence. Which has its own pretty clear downside: no more translation of authorization failures. We should process the

[GENERAL] Key Vs Index

2009-02-10 Thread Abdul Rahman
In Oracle, the index is automatically created during the creation of Primary Key. But in PostgreSQL either index is implicitly created of the user hast create it explicitly. I don't find any index against Primary Key and have to create index on this key.

Re: [GENERAL] Intel SSD

2009-02-10 Thread Scott Marlowe
On Tue, Feb 10, 2009 at 11:55 PM, John R Pierce pie...@hogranch.com wrote: Sebastian Böhm wrote: I consider buying one of these Intel SSDs for my Database (MLC). . currently I have a lot of small random reads/writes causing heavy iowait. how many r/s and w/s in `iostat -x 5` while your

Re: [GENERAL] Key Vs Index

2009-02-10 Thread Craig Ringer
Abdul Rahman wrote: In Oracle, the index is automatically created during the creation of Primary Key. The same is true in PostgreSQL. For example, here's a message from a recent job I ran that created a temp table with SELECT ... INTO and added a primary key to it: psql:import_checks.sql:79:

Re: [GENERAL] Key Vs Index

2009-02-10 Thread Scott Marlowe
On Wed, Feb 11, 2009 at 12:09 AM, Abdul Rahman abr_...@yahoo.com wrote: In Oracle, the index is automatically created during the creation of Primary Key. But in PostgreSQL either index is implicitly created of the user hast create it explicitly. I don't find any index against Primary Key and

Re: [GENERAL] Key Vs Index

2009-02-10 Thread Abdul Rahman
I have found the answer. PostgreSQL creates index on primary key implicitly and can be seen via \d tablename; command on psql prompt. But PG_Admin-III does not show this index. Sorry to say that I faced several problems because of PG_Admin-III. And I advise you to use psql prompt instead of

Re: [GENERAL] Key Vs Index

2009-02-10 Thread Craig Ringer
Scott Marlowe wrote: Note that the index on the FK side isn't auto created. Of course, you often don't want one - you might rarely or never DELETE from the referenced table or UPDATE the primary key value. In that case, the index just slows down updates and deletes on the table with the fk

Re: [GENERAL] Key Vs Index

2009-02-10 Thread Scott Marlowe
On Wed, Feb 11, 2009 at 12:37 AM, Abdul Rahman abr_...@yahoo.com wrote: I have found the answer. PostgreSQL creates index on primary key implicitly and can be seen via \d tablename; command on psql prompt. But PG_Admin-III does not show this index. Sorry to say that I faced several problems

Re: [GENERAL] createdb.exe and psql.exe without Promting Password

2009-02-10 Thread Iñigo Barandiaran
Thank you all! and Thanks Sam for the explanation about environment variable. I didn't know about that :) I've also tried the option of .pgpass file, that as far as I understand in Windows is pgpass.conf. I did a file containing only this line