dbTalk Databases Forums  

[BUGS] BUG #1725: psql --command and PQexec do not work and fail silently

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1725: psql --command and PQexec do not work and fail silently in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Charlie Monkton
 
Posts: n/a

Default [BUGS] BUG #1725: psql --command and PQexec do not work and fail silently - 06-23-2005 , 09:34 AM







The following bug has been logged online:

Bug reference: 1725
Logged by: Charlie Monkton
Email address: charlie (AT) hwhc (DOT) net
PostgreSQL version: 7.4.6
Operating system: Solaris 9
Description: psql --command and PQexec do not work and fail silently
Details:

Create the following tables:

create table test
(
i int primary key not null
);
create table test_ref
(
i int references test(i) on delete cascade
);

Executing the following SQL via the psql -c option (or PQexec does not
work:

psql -c "delete from test;insert into test values ( 1 );insert into
test_ref values ( 1 );"
INSERT 30816 1

#select * from test_ref;
i
---
(0 rows)

echo "delete from test;insert into test values ( 1 );insert into test_ref
values ( 1 );" | /usr/local/pgsql/bin/psql
DELETE 1
INSERT 30813 1
INSERT 30814 1

# select * from test_ref;
i
---
1
(1 row)

This is very bad as multiple statement executed by PQexec fail and do not
return an error message.

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #1725: psql --command and PQexec do not work and fail silently - 06-23-2005 , 10:14 AM






"Charlie Monkton" <charlie (AT) hwhc (DOT) net> writes:
Quote:
Executing the following SQL via the psql -c option (or PQexec does not
work:

psql -c "delete from test;insert into test values ( 1 );insert into
test_ref values ( 1 );"
In 7.4 and before, test's ON DELETE trigger won't be fired until the end
of that command string, so it deletes both the old and new rows in
test_ref. We changed the timing of trigger firing in 8.0, and now that
example works as you expect.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.