shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Remover linhas do arquivo


From: weberlf
Subject: Remover linhas do arquivo
Date: Tue, 29 Nov 2005 23:45:28 -0000
User-agent: eGroups-EW/0.82

  Boa noite lista,

    Tenho um arquivo gerado pelo dump de um banco de dados e 
necessito remover as linhas que iniciam por ALTER TABLE com as 
linhas que seguem logo abaixo, que fazem parte do mesmo comando.
    O comando para gerar o arquivo e o arquivo estao logo abaixo.
 

pg_dump -d nome_banco -s -x -O | sed 's/mor_/'tmor_`date +%d%
m`_'/g'  | cat > dump.txt



SET client_encoding = 'SQL_ASCII';
SET check_function_bodies = false;
SET client_min_messages = warning;

COMMENT ON SCHEMA public IS 'Standard public schema';
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = true;

CREATE TABLE tmor_2911_abastecimento (
    seq_abastecimento integer NOT NULL,
    placa character(7) NOT NULL,
    nro_litros numeric(5,2) NOT NULL
);

CREATE TABLE tmor_2911_adicionais (
    seq_adicionais integer NOT NULL,
    vlr_lancto numeric(9,2) NOT NULL,
    seq_log_inc integer NOT NULL
);

CREATE INDEX idx01_tmor_2911_fat_hist ON tmor_2911_fat_hist USING 
btree (seq_fatura_ori);

ALTER TABLE ONLY tmor_2911_lancto_cta_obs
    ADD CONSTRAINT cst50_tmor_2911_lancto_cta_obs FOREIGN KEY 
(seq_lancto_cta_cc) REFERENCES tmor_2911_lancto_cta_cc(seq_lanc
to_cta_cc) MATCH FULL;

Se puderem me ajudar agradeço.


Weber




reply via email to

[Prev in Thread] Current Thread [Next in Thread]