el parametro -h es el nombre o ip de host ejemplo localhost o 127.0.0.1
El 21/06/2013 09:23 p.m., Frank Ernesto Matos Matos escribió:
trato de ejecutar en un entorno Windows pg_restore y miren lo que
obtengo..alguien sabe la razon? en linux hago exactamente lo mismo y
funciona
.\pg_restore.exe
http://www.postgresql.org/docs/9.2/static/functions-array.html
El 11/04/2013 03:30 p.m., Patricio Gigoux escribió:
¿Como puedo comparar con un array en una condición, algo como:
Salect * from la_tabla where id= a algún elemento en ARRAY['a','d','e']
es decir, si el id corresponde a alguno de eso
CREATE OR REPLACE FUNCTION test(e_num integer)
RETURNS integer AS
$BODY$
DECLARE
registro RECORD;
registro_anterior RECORD;
BEGIN
registro_anterior:=NULL;
FOR registro IN SELECT num , nombre FROM tabla LOOP
IF registro.num = e_num THEN
activar el log en postgresql.conf
logging_collector = on
log_min_messages = notice
log_min_duration_statement = 0 # -1 is disabled, 0 logs all statements
# and their durations, > 0 logs only
# statements running at least this number
# of
NEW es valido en INSERT Y UPDATE
OLD es valido en UPDATE Y DELETE
con esta función puede probar los valores para cualquier tabla.
CREATE OR REPLACE FUNCTION tr_datos_d()
RETURNS trigger AS
$BODY$
DECLARE
BEGIN
IF TG_OP = 'INSERT' THEN
RAISE NOTICE 'INSERT NEW %',NEW;
RETUR
utiliza TG_OP para saber que esta haciendo
http://www.postgresql.org/docs/9.2/static/plpgsql-trigger.html
la estructura del triger debe algo parecida a:
CREATE OR REPLACE FUNCTION tr_datos_d()
RETURNS trigger AS
$BODY$
DECLARE
BEGIN
IF TG_OP = 'INSERT' THEN
-- ...
RETURN NEW;