From: | fernando villarroel <bbddlinux(at)yahoo(dot)es> |
---|---|
To: | Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> |
Cc: | pgsql-es-ayuda(at)postgresql(dot)org |
Subject: | Re: Scrpt batch |
Date: | 2005-03-11 16:02:25 |
Message-ID: | 20050311160225.72783.qmail@web26004.mail.ukl.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Gracias Alvaro, que debo poner en $datos_de_conexion?
algo asi:
datos de conexion='psql base_de_datos'
Fernando Villarroel
--- Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> wrote:
> On Fri, Mar 11, 2005 at 03:30:24PM +0100, fernando
> villarroel wrote:
>
> > y el script seria algo asi:
> >
> > #!/bin/sh
> > grant select on clientes to $1
> >
> > grant select,insert,update,delete on ventas to $1
>
> #!/bin/sh
> if [ -z "$datos_de_conexion" ]; then
> echo "ugh" >&2
> exit 1
> fi
> if [ -z "$1" ]; then
> echo "gack" >&1
> exit 1
> fi
> psql $datos_de_conexion <<EOF
> grant select on clientes to $1
> grant select,insert,update,delete on ventas to $1
> EOF
>
>
> Esto lo puedes ejecutar desde el shell, pasandole
> como parametro el
> nombre de usuario.
>
> Otra alternativa seria usar las variables de psql,
> :VAR -- revisa la
> documentacion.
>
> --
> Alvaro Herrera (<alvherre[(at)]dcc(dot)uchile(dot)cl>)
> Y dijo Dios: "Que sea Satanás, para que la gente no
> me culpe de todo a mí."
> "Y que hayan abogados, para que la gente no culpe de
> todo a Satanás"
>
> ---------------------------(fin del
> mensaje)---------------------------
> TIP 5: ¿Has leído nuestro extenso FAQ?
>
>
>
http://www.postgresql.org/files/documentation/faqs/FAQ.html
>
______________________________________________
Renovamos el Correo Yahoo!: ¡250 MB GRATIS!
Nuevos servicios, más seguridad
http://correo.yahoo.es
From | Date | Subject | |
---|---|---|---|
Next Message | T.S.U. Eric Aponte | 2005-03-11 16:17:25 | Re: ADO RecordSet |
Previous Message | Alvaro Herrera | 2005-03-11 14:51:11 | Re: cambiar tipo dato |