This Foreign Data Wrapper (FDW) allows to receive messages from and send to Amazon Simple Message Service (SQS) via SELECT and INSERT.
This FDW requires the Multicorn extension to be installed.
pip install pgxnclient
pgxn install multicorn
python setup.py install
CREATE EXTENSION IF NOT EXISTS multicorn;
CREATE SERVER IF NOT EXISTS multicorn_sqs
FOREIGN DATA WRAPPER multicorn
OPTIONS (
wrapper 'sqs_fdw.SQSForeignDataWrapper'
);
CREATE FOREIGN TABLE multicorn_test (
message_id uuid,
test character varying,
test2 int,
message_attributes jsonb
) SERVER multicorn_sqs OPTIONS (
aws_access_key_id '',
aws_secret_access_key '',
aws_region 'ap-southeast-2',
queue_url 'https://sqs.*',
message_attributes 'foo,bar'
);
INSERT INTO multicorn_test (test, test2)
VALUES ('a', 1), ('b', 2);
SELECT * FROM multicorn_test;