Re: Authentication in batch processing
2002-06-02 20:22:08 GMT
Password prompting was changed in 7.2.X. You can now pass a script into psql, and you will be prompted for the password on your terminal rather than having the password coming from the script. The best way send the password in 7.2.X is to use 'expect', or use the PGPASSWORD environment variable. (However, on some OS's, environment values like PGPASSWORD can be seen by 'ps'.) Another option is that if /dev/tty can't get opened, the password will be requested from stdin. Unfortunately, I can't think of an easy way to make /dev/tty fail. --------------------------------------------------------------------------- Hal Lynch wrote: > I have postgres set up to require usernames and passwords for access. > > The following script works just fine in 7.1.2 without manual > intervention. Using 7.2.1 psql issues a password prompt and > blocks until a password is manually entered. > > ####################################### > #!/bin/sh > > psql mydb <<\__EOD__ > mypassword > create table mytable > ( > ssn char(9), > name char(50) > );(Continue reading)
>
> If you change these I'd strongly advise bumping the protocol minor
> version number, so that you don't have weird behavior should you try
> to interoperate with standard code.
>
> This is another thing that should be on the list of stuff to fix when
> we next change the FE/BE protocol ...
Comment added to source that SM_USER length should match the others.
RSS Feed