¾�ΥС�������ʸ�� �� 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9.6 | 9.5 | 9.4 | 9.3 | 9.2 | 9.1 | 9.0 | 8.4 | 8.3 | 8.2 | 8.1 | 8.0 | 7.4 | 7.3 | 7.2

dblink_exec

名前

dblink_exec -- ��⡼�ȥǡ����١����ǥ��ޥ�ɤ�¹Ԥ��ޤ�

概要

dblink_exec(text connname, text sql [, bool fail_on_error]) returns text
dblink_exec(text connstr, text sql [, bool fail_on_error]) returns text
dblink_exec(text sql [, bool fail_on_error]) returns text

����

dblink_exec�ϥ�⡼�ȥǡ����١����ǥ��ޥ�ɡʤĤޤ�Ԥ��֤��ʤ�Ǥ�դ�SQLʸ�ˤ�¹Ԥ��ޤ���

2�Ĥ�text���ΰ�����Ϳ����줿��硢�����ܤΰ����Ϥޤ���³��³��̾���򸡺����뤿��˻Ȥ��ޤ��� �⤷���Ĥ���С����ޥ�ɤ�������³��Ǽ¹Ԥ���ޤ��� ���Ĥ���ʤ���С������ܤΰ�����dblink_connect�Ѥ���³����ʸ����Ȥ��ư���졢���Υ��ޥ�ɼ¹Ի���Ʊ�ͤ˻��ꤵ�줿��³�������ޤ���

����

conname

���Ѥ�����³��̾���Ǥ��� ̵̾����³����Ѥ�����Ϥ��Υѥ�᡼�����ά���ޤ���

connstr

���dblink_connect������������³����ʸ����Ǥ���

sql

�㤨��insert into foo values(0,'a','{"a0","b0","c0"}')�Ȥ��ä�����⡼�ȥǡ����١����Ǽ¹Ԥ�����SQL�䤤��碌�Ǥ���

fail_on_error

���ʾ�ά���Υǥե���ȡˤξ�硢��³�Υ�⡼��¦��ȯ���������顼�ˤ���������¦�Ǥ⥨�顼��ȯ�����ޤ��� ���ξ���⡼��¦�Υ��顼�ϥ�������¦�ˤ�NOTICE�Ȥ�����𤵤졢���δؿ�������ͤ�ERROR�ˤʤ�ޤ���

�����

���֡��Ĥޤꥳ�ޥ�ɤξ��֤ޤ���ERROR���֤��ޤ���

��

SELECT dblink_connect('dbname=dblink_test_standby');
 dblink_connect
----------------
 OK
(1 row)

SELECT dblink_exec('insert into foo values(21,''z'',''{"a0","b0","c0"}'');');
   dblink_exec
-----------------
 INSERT 943366 1
(1 row)

SELECT dblink_connect('myconn', 'dbname=regression');
 dblink_connect
----------------
 OK
(1 row)

SELECT dblink_exec('myconn', 'insert into foo values(21,''z'',''{"a0","b0","c0"}'');');
   dblink_exec
------------------
 INSERT 6432584 1
(1 row)

SELECT dblink_exec('myconn', 'insert into pg_class values (''foo'')',false);
NOTICE:  sql error
DETAIL:  ERROR:  null value in column "relnamespace" violates not-null constraint

 dblink_exec
-------------
 ERROR
(1 row)