Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error handling #7

Closed
wants to merge 4 commits into from
Closed

Fix error handling #7

wants to merge 4 commits into from

Conversation

dveeden
Copy link

@dveeden dveeden commented Jan 22, 2013

The error handling seemed broken. All errors logged with log_to_postgres() were logged as NOTICE.

@rdunklau
Copy link
Contributor

I can't reproduce the problem you mention. Do you have a test case for this ?

I added a non regression test on that in 81ba7a4, and it seems to work fine.

Could you please try to run make installcheck and tell me what possible errors you get ?

Thank you.

@dveeden
Copy link
Author

dveeden commented Jan 24, 2013

dveeden=# CREATE EXTENSION multicorn;
CREATE EXTENSION
dveeden=# CREATE server multicorn_srv foreign data wrapper multicorn options (
dveeden(#     wrapper 'multicorn.testfdw.TestForeignDataWrapper'
dveeden(# );
CREATE SERVER
dveeden=# 
dveeden=# CREATE foreign table testmulticorn (
dveeden(#     test1 character varying,
dveeden(#     test2 character varying
dveeden(# ) server multicorn_srv options (
dveeden(#     option1 'option1',
dveeden(#     test_type 'logger'
dveeden(# );
CREATE FOREIGN TABLE
dveeden=# 
dveeden=# -- Test "normal" usage
dveeden=# select * from testmulticorn;
   test1    |   test2    
------------+------------
 test1 1 0  | test2 2 0
 test1 3 1  | test2 1 1
 test1 2 2  | test2 3 2
 test1 1 3  | test2 2 3
 test1 3 4  | test2 1 4
 test1 2 5  | test2 3 5
 test1 1 6  | test2 2 6
 test1 3 7  | test2 1 7
 test1 2 8  | test2 3 8
 test1 1 9  | test2 2 9
 test1 3 10 | test2 1 10
 test1 2 11 | test2 3 11
 test1 1 12 | test2 2 12
 test1 3 13 | test2 1 13
 test1 2 14 | test2 3 14
 test1 1 15 | test2 2 15
 test1 3 16 | test2 1 16
 test1 2 17 | test2 3 17
 test1 1 18 | test2 2 18
 test1 3 19 | test2 1 19
(20 rows)

dveeden=# 
dveeden=# DROP EXTENSION multicorn cascade;
DROP EXTENSION

I've changed the Makefile:
PYEXEC = python2.7

I've added the following lines to multicorn_alchemy_test.sql:
DROP EXTENSION multicorn cascade;
DROP TABLE basetable;

@dveeden
Copy link
Author

dveeden commented Jan 24, 2013

I also added some basic docs about how to run the tests.

@dveeden
Copy link
Author

dveeden commented Jan 24, 2013

With client_min_messages = notice

dveeden=# CREATE EXTENSION multicorn;
CREATE EXTENSION
dveeden=# CREATE server multicorn_srv foreign data wrapper multicorn options (
dveeden(#     wrapper 'multicorn.testfdw.TestForeignDataWrapper'
dveeden(# );
CREATE SERVER
dveeden=# 
dveeden=# CREATE foreign table testmulticorn (
dveeden(#     test1 character varying,
dveeden(#     test2 character varying
dveeden(# ) server multicorn_srv options (
dveeden(#     option1 'option1',
dveeden(#     test_type 'logger'
dveeden(# );
CREATE FOREIGN TABLE
dveeden=# 
dveeden=# -- Test "normal" usage
dveeden=# select * from testmulticorn;
NOTICE:  {'test_type': 'logger', 'option1': 'option1'}
NOTICE:  {'test1': 'character varying', 'test2': 'character varying'}
NOTICE:  An error is about to occur
NOTICE:  An error occured
NOTICE:  []
NOTICE:  set(['test1', 'test2'])
   test1    |   test2    
------------+------------
 test1 1 0  | test2 2 0
 test1 3 1  | test2 1 1
 test1 2 2  | test2 3 2
 test1 1 3  | test2 2 3
 test1 3 4  | test2 1 4
 test1 2 5  | test2 3 5
 test1 1 6  | test2 2 6
 test1 3 7  | test2 1 7
 test1 2 8  | test2 3 8
 test1 1 9  | test2 2 9
 test1 3 10 | test2 1 10
 test1 2 11 | test2 3 11
 test1 1 12 | test2 2 12
 test1 3 13 | test2 1 13
 test1 2 14 | test2 3 14
 test1 1 15 | test2 2 15
 test1 3 16 | test2 1 16
 test1 2 17 | test2 3 17
 test1 1 18 | test2 2 18
 test1 3 19 | test2 1 19
(20 rows)

dveeden=# 
dveeden=# DROP EXTENSION multicorn cascade;
NOTICE:  drop cascades to 2 other objects
DETAIL:  drop cascades to server multicorn_srv
drop cascades to foreign table testmulticorn
DROP EXTENSION

@rdunklau rdunklau closed this Mar 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants