Entradas

Mostrando entradas de abril, 2014

INSTALACION DE POSTGRES EN OPENSUSE

$ sudo su # zypper install -y postgresql postgresql-server # rcpostgresql start # su – postgres # psql postgres=# ALTER USER postgres WITH PASSWORD 'postgres'; postgres=# \q $ sudo su # rcpostgresql restart # su - postgres In file /var/lib/pgsql/data/pg_hba.conf you should replace peer and ident authentication method with trust method, so this lines: # "local" is for Unix domain socket connections only local all all peer # IPv4 local connections: host all all 127.0.0.1/32 ident … should be replaced on: # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/32 trust Command belows should do this replacing (logged as postgres):

RETORNAR VALORES DE UN RECORD DESDE POSTGRES

Opción para no tener que definir las columnas al momento de llamar la función.   CREATE OR REPLACE FUNCTION nombre_funcion()   RETURNS table(campo1 smallint,campo5 double precision,campo6 double precision,campo7 double precision,campo8 double precision) AS $BODY$                 select   campo1, campo5, campo6,campo7, campo8                 from nombre_tabla                        $BODY$   LANGUAGE sql VOLATILE