Re: insert aborted commands ignored

Поиск
Список
Период
Сортировка
От Pepe TD Vo
Тема Re: insert aborted commands ignored
Дата
Msg-id 192333709.3965062.1549465512951@mail.yahoo.com
обсуждение исходный текст
Ответ на Re: insert aborted commands ignored  (Pepe TD Vo <pepevo@yahoo.com>)
Ответы Re: insert aborted commands ignored
Re: insert aborted commands ignored
Список pgsql-admin
sorry, my server was out of network for couple days.

I have tried to remove all " E' " of each column and when i run the insert script.  I get another error, "value too long for type character varying(34).  How do I know which table



sorry, my server was out of network for a coupole days.  
I have tried to remove all " E' " of each column and rerun the insert script.  I get an error, "value too long for type character varying(34)."
I am unclear as how and which table this error message upon attemting?
Also, when I run another schema insert script, I get right away as same as the one above after remove 
ERROR: invalid input syntax for integer:"42P01"
CONTEXT: PL/pgSQL function cidr_staging.trigger_fct_tr_stg_adjudicative_status_ins() line 29 at assignment.

the trigger is:
Create or replace function cidr_staging.trigger_fct_tr_stg_adjudicative_status_in() RETURNS trigger AS $BODY$
declare
v_seq bigint:=0;
v_ErrorCode bigint;
V_ErrorMsg varchar(512)'
v_Module varchar(32):= 'TR_STG_ADJUDICATIVE_STATUS_INS';
BEGIN
BEGIN
select nextval('sq_staging') into STRICT v_seq;
if NEW.mig_seg is null then
   NEW.mig_seq:=v_seq;
enf if;
if NEW.mig_filename is null then
   NEW.mig_filename :='Unknown';
end if;
exception
when others then
   v_ErrorCode := SQLSTATE'
   v_ErrorMsg := SQLERRM;
   insert into cidrmgmt.errorlog(stamp, os_user, host, module, errorcode, erromsg) values (CURRENT_TIMESTAMP, sys_context('userenv','session_user'), sys_context('userenv','host'),v_Module, v_ErrorCode, v_ErrorMsg);
END;
RETURN NEW;
end
$BODY$
LANGUAGE 'plpgsql';
CREATE TRIGGER tr_stg_adjudicative_status_ins BEFORE INSERT ON cidr_staging.stg_adjudicative_status FOR EACH ROW
  EXECUTE PROCEDURE cidr_staging.trigger_fct_tr_stg_adjudicative_status_ins();

all scripts, tables/insert/procedure/triggers are inherited from ora2pg.  I have corrected the scripts to make them work for tables, triggers, functions.  All created well excepted the inserts are the issue and I couldn't find much information for those errors.  Thank you for your helps.

Bach-Nga

No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.
To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)

**Live simply **Love generously **Care deeply **Speak kindly.
*** Genuinely rich *** Faithful talent *** Sharing success


On Friday, February 1, 2019 9:18 AM, Pepe TD Vo <pepevo@yahoo.com> wrote:


it worked fine using oracle export and import to oracle unclass and then import to postgres using Amazon RDS, the problem is AWS is for unclass and currently I am doing in the high side and not using AWS.
How do I export oracle to postgres to avoid this issue?

thank you.
 
Bach-Nga

No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.
To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)

**Live simply **Love generously **Care deeply **Speak kindly.
*** Genuinely rich *** Faithful talent *** Sharing success


On Friday, February 1, 2019 8:54 AM, Shreeyansh Dba <shreeyansh2014@gmail.com> wrote:


Hi Pepe,

It look like foreign key reference by child table, so you are trying to insert values into chile table "cidr_ds_roles" that don't match with Parent table 'cidr_roles".


Thanks & Regards,
Shreeyansh DBA Team
www.shreeyansh.com


On Fri, Feb 1, 2019 at 6:51 PM Pepe TD Vo <pepevo@yahoo.com> wrote:
thank you for your tip.
I ran a insert.sql again with AN_ERROR_STOP=1 and output to insert.txt, I get:
ERROR: insert or update on table "cidr_ds_roles" violates foreign key constraint "cidr_ds_roles_cidr_roles_fk1"
DETAIL: key (role_id)=(3) is not present in table "cidr_roles"

from insert.txt I get 
INSERT 0 1 (repeat for the rest of insert)

thank you.
 
Bach-Nga

No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.
To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)

**Live simply **Love generously **Care deeply **Speak kindly.
*** Genuinely rich *** Faithful talent *** Sharing success


On Thursday, January 31, 2019 4:09 PM, Andrew Gierth <andrew@tao11.riddles.org.uk> wrote:


>>>>> "Pepe" == Pepe TD Vo <pepevo@yahoo.com> writes:

Pepe> here how I run the script
Pepe> $ psql -U postgres -d CIDR < insert.sql > insert_cidrmgmt.txt

psql -v ON_ERROR_STOP=1 -U postgres -d CIDR < insert.sql > insert_cidrmgmt.txt

That tells psql to stop on the first error, so you'll be able to see
what the real error was.

Your .txt file does not capture the error because you redirected only
stdout, and errors go to stderr instead.

--
Andrew (irc:RhodiumToad)








В списке pgsql-admin по дате отправления:

Предыдущее
От: Thomas Vatter
Дата:
Сообщение: errordump
Следующее
От: Scott Ribe
Дата:
Сообщение: Re: insert aborted commands ignored