libpgtcl.sgml
上传用户:blenddy
上传日期:2007-01-07
资源大小:6495k
文件大小:45k
源码类别:

数据库系统

开发平台:

Unix_Linux

  1. <Chapter Id="pgtcl">
  2. <Title>pgtcl</Title>
  3. <Para>
  4. <literal>pgtcl</literal> is a tcl package for front-end programs 
  5. to interface with <ProductName>Postgres</ProductName>
  6. backends.  It makes most of the functionality of <literal>libpq</literal> available to
  7. tcl scripts.
  8. </Para>
  9. <Para>
  10. This package was originally written by Jolly Chen.
  11. </Para>
  12. <Sect1>
  13. <Title>Commands</Title>
  14. <Para>
  15. <TABLE TOCENTRY="1">
  16. <TITLE><literal>pgtcl</literal> Commands</TITLE>
  17. <TGROUP COLS="2">
  18. <THEAD>
  19.   <ROW>
  20.     <ENTRY>Command</ENTRY>
  21.     <ENTRY>Description</ENTRY>
  22.   </ROW>
  23. </THEAD>
  24. <TBODY>
  25.   <ROW>
  26.     <ENTRY>pg_connect</ENTRY>
  27.     <ENTRY>opens a connection to the backend server</ENTRY>
  28.   </ROW>
  29.   <ROW>
  30.     <ENTRY>pg_disconnect</ENTRY>
  31.     <ENTRY>closes a connection</ENTRY>
  32.   </ROW>
  33.   <ROW>
  34.     <ENTRY>pg_conndefaults</ENTRY>
  35.     <ENTRY>get connection options and their defaults</ENTRY>
  36.   </ROW>
  37.   <ROW>
  38.     <ENTRY>pg_exec</ENTRY>
  39.     <ENTRY>send a query to the backend</ENTRY>
  40.   </ROW>
  41.   <ROW>
  42.     <ENTRY>pg_result</ENTRY>
  43.     <ENTRY>manipulate the results of a query</ENTRY>
  44.   </ROW>
  45.   <ROW>
  46.     <ENTRY>pg_select</ENTRY>
  47.     <ENTRY>loop over the result of a SELECT statement</ENTRY>
  48.   </ROW>
  49.   <ROW>
  50.     <ENTRY>pg_listen</ENTRY>
  51.     <ENTRY>establish a callback for NOTIFY messages</ENTRY>
  52.   </ROW>
  53.   <ROW>
  54.     <ENTRY>pg_lo_creat</ENTRY>
  55.     <ENTRY>create a large object</ENTRY>
  56.   </ROW>
  57.   <ROW>
  58.     <ENTRY>pg_lo_open</ENTRY>
  59.     <ENTRY>open a large object</ENTRY>
  60.   </ROW>
  61.   <ROW>
  62.     <ENTRY>pg_lo_close</ENTRY>
  63.     <ENTRY>close a large object</ENTRY>
  64.   </ROW>
  65.   <ROW>
  66.     <ENTRY>pg_lo_read</ENTRY>
  67.     <ENTRY>read a large object</ENTRY>
  68.   </ROW>
  69.   <ROW>
  70.     <ENTRY>pg_lo_write</ENTRY>
  71.     <ENTRY>write a large object</ENTRY>
  72.   </ROW>
  73.   <ROW>
  74.     <ENTRY>pg_lo_lseek</ENTRY>
  75.     <ENTRY>seek to a position in a large object</ENTRY>
  76.   </ROW>
  77.   <ROW>
  78.     <ENTRY>pg_lo_tell</ENTRY>
  79.     <ENTRY>return the current seek position of a large object</ENTRY>
  80.   </ROW>
  81.   <ROW>
  82.     <ENTRY>pg_lo_unlink</ENTRY>
  83.     <ENTRY>delete a large object</ENTRY>
  84.   </ROW>
  85.   <ROW>
  86.     <ENTRY>pg_lo_import</ENTRY>
  87.     <ENTRY>import a Unix file into a large object</ENTRY>
  88.   </ROW>
  89.   <ROW>
  90.     <ENTRY>pg_lo_export</ENTRY>
  91.     <ENTRY>export a large object into a Unix file</ENTRY>
  92.   </ROW>
  93. </TBODY>
  94. </TGROUP>
  95. </TABLE>
  96. </Para>
  97. <Para>
  98. These commands are described further on subsequent pages.
  99. </Para>
  100. <Para>
  101. The pg_lo* routines are interfaces to the Large Object features of
  102. <ProductName>Postgres</ProductName>.
  103. The functions are designed to mimic the analogous file system functions in
  104. the standard Unix file system interface.
  105. The pg_lo* routines should be used within a BEGIN/END transaction
  106. block because the file descriptor returned by pg_lo_open is only valid for
  107. the current transaction.  pg_lo_import and pg_lo_export MUST be used
  108. in a BEGIN/END transaction block.
  109. </Para>
  110. </Sect1>
  111. <Sect1>
  112. <Title>Examples</Title>
  113. <Para>
  114. Here's a small example of how to use the routines:
  115. <ProgramListing>
  116. # getDBs :
  117. #   get the names of all the databases at a given host and port number
  118. #   with the defaults being the localhost and port 5432
  119. #   return them in alphabetical order
  120. proc getDBs { {host "localhost"} {port "5432"} } {
  121.     # datnames is the list to be result
  122.     set conn [pg_connect template1 -host $host -port $port]
  123.     set res [pg_exec $conn "SELECT datname FROM pg_database ORDER BY datname"]
  124.     set ntups [pg_result $res -numTuples]
  125.     for {set i 0} {$i < $ntups} {incr i} {
  126. lappend datnames [pg_result $res -getTuple $i]
  127.     }
  128.     pg_result $res -clear
  129.     pg_disconnect $conn
  130.     return $datnames
  131. }
  132. </ProgramListing>
  133. </Para>
  134. </Sect1>
  135. <Sect1>
  136. <Title>pgtcl Command Reference Information</Title>
  137. <REFENTRY ID="PGTCL-PGCONNECT">
  138. <REFMETA>
  139. <REFENTRYTITLE>pg_connect</REFENTRYTITLE>
  140. <REFMISCINFO>PGTCL - Connection Management</REFMISCINFO>
  141. </REFMETA>
  142. <REFNAMEDIV>
  143. <REFNAME>pg_connect
  144. </REFNAME>
  145. <REFPURPOSE>opens a connection to the backend server
  146. </REFPURPOSE>
  147. <INDEXTERM ID="IX-PGTCL-PGCONNECT-1"><PRIMARY>pgtcl</PRIMARY><SECONDARY>connecting</SECONDARY></INDEXTERM>
  148. <INDEXTERM ID="IX-PGTCL-PGCONNECT-2"><PRIMARY>pg_connect</PRIMARY></INDEXTERM>
  149. </REFNAMEDIV>
  150. <REFSYNOPSISDIV>
  151. <REFSYNOPSISDIVINFO>
  152. <DATE>1997-12-24</DATE>
  153. </REFSYNOPSISDIVINFO>
  154. <SYNOPSIS>
  155. pg_connect -conninfo <REPLACEABLE CLASS="PARAMETER">connectOptions</REPLACEABLE>
  156. pg_connect <REPLACEABLE CLASS="PARAMETER">dbName</REPLACEABLE> <OPTIONAL>-host <REPLACEABLE CLASS="PARAMETER">hostName</REPLACEABLE></OPTIONAL>
  157.   <OPTIONAL>-port <REPLACEABLE
  158.   CLASS="PARAMETER">portNumber</REPLACEABLE></OPTIONAL> <OPTIONAL>-tty <REPLACEABLE
  159.   CLASS="PARAMETER">pqtty</REPLACEABLE></OPTIONAL>
  160.   <OPTIONAL>-options <REPLACEABLE
  161.   CLASS="PARAMETER">optionalBackendArgs</REPLACEABLE></OPTIONAL>
  162. </SYNOPSIS>
  163. <REFSECT2 ID="R2-PGTCL-PGCONNECT-1">
  164. <REFSECT2INFO>
  165. <DATE>1998-10-07</DATE>
  166. </REFSECT2INFO>
  167. <TITLE>Inputs (new style)
  168. </TITLE>
  169. <VARIABLELIST>
  170. <VARLISTENTRY>
  171. <TERM>
  172.   <REPLACEABLE CLASS="PARAMETER">connectOptions</REPLACEABLE>
  173. </TERM>
  174. <LISTITEM>
  175. <PARA>A string of connection options, each written in the form keyword = value.
  176. </PARA>
  177. </LISTITEM>
  178. </VARLISTENTRY>
  179. </VARIABLELIST>
  180. </REFSECT2>
  181. <REFSECT2 ID="R2-PGTCL-PGCONNECT-2">
  182. <REFSECT2INFO>
  183. <DATE>1997-12-24</DATE>
  184. </REFSECT2INFO>
  185. <TITLE>Inputs (old style)
  186. </TITLE>
  187. <VARIABLELIST>
  188. <VARLISTENTRY>
  189. <TERM>
  190.   <REPLACEABLE CLASS="PARAMETER">dbName</REPLACEABLE>
  191. </TERM>
  192. <LISTITEM>
  193. <PARA>Specifies a valid database name.
  194. </PARA>
  195. </LISTITEM>
  196. </VARLISTENTRY>
  197. <VARLISTENTRY>
  198. <TERM>
  199.   <OPTIONAL>-host <REPLACEABLE CLASS="PARAMETER">hostName</REPLACEABLE></OPTIONAL>
  200. </TERM>
  201. <LISTITEM>
  202. <PARA>Specifies the domain name of the backend server for <REPLACEABLE CLASS="PARAMETER">dbName</REPLACEABLE>.
  203. </PARA>
  204. </LISTITEM>
  205. </VARLISTENTRY>
  206. <VARLISTENTRY>
  207. <TERM>
  208.   <OPTIONAL>-port <REPLACEABLE CLASS="PARAMETER">portNumber</REPLACEABLE></OPTIONAL>
  209. </TERM>
  210. <LISTITEM>
  211. <PARA>Specifies the IP port number of the backend server for <REPLACEABLE CLASS="PARAMETER">dbName</REPLACEABLE>.
  212. </PARA>
  213. </LISTITEM>
  214. </VARLISTENTRY>
  215. <VARLISTENTRY>
  216. <TERM>
  217.   <OPTIONAL>-tty <REPLACEABLE CLASS="PARAMETER">pqtty</REPLACEABLE></OPTIONAL>
  218. </TERM>
  219. <LISTITEM>
  220. <PARA>Specifies file or tty for optional debug output from backend.
  221. </PARA>
  222. </LISTITEM>
  223. </VARLISTENTRY>
  224. <VARLISTENTRY>
  225. <TERM>
  226.   <OPTIONAL>-options <REPLACEABLE CLASS="PARAMETER">optionalBackendArgs</REPLACEABLE></OPTIONAL>
  227. </TERM>
  228. <LISTITEM>
  229. <PARA>Specifies options for the backend server for <REPLACEABLE CLASS="PARAMETER">dbName</REPLACEABLE>.
  230. </PARA>
  231. </LISTITEM>
  232. </VARLISTENTRY>
  233. </VARIABLELIST>
  234. </REFSECT2>
  235. <REFSECT2 ID="R2-PGTCL-PGCONNECT-3">
  236. <REFSECT2INFO>
  237. <DATE>1997-12-24</DATE>
  238. </REFSECT2INFO>
  239. <TITLE>Outputs
  240. </TITLE>
  241. <VARIABLELIST>
  242. <VARLISTENTRY>
  243. <TERM>
  244.   <REPLACEABLE CLASS="PARAMETER">dbHandle</REPLACEABLE>
  245. </TERM>
  246. <LISTITEM>
  247. <PARA>
  248. If successful, a handle for a database connection is returned.
  249. Handles start with the prefix "pgsql".
  250. </PARA>
  251. </LISTITEM>
  252. </VARLISTENTRY>
  253. </VARIABLELIST>
  254. </REFSECT2>
  255. </REFSYNOPSISDIV>
  256. <!-- ********************************************************** -->
  257. <REFSECT1 ID="R1-PGTCL-PGCONNECT-1">
  258. <REFSECT1INFO>
  259. <DATE>1997-12-24</DATE>
  260. </REFSECT1INFO>
  261. <TITLE>Description
  262. </TITLE>
  263. <PARA><FUNCTION>pg_connect</FUNCTION> opens a connection to the
  264. <ProductName>Postgres</ProductName> backend.
  265. </Para>
  266. <para>
  267. Two syntaxes are available.  In the older one, each possible option
  268. has a separate option switch in the pg_connect statement.  In the
  269. newer form, a single option string is supplied that can contain
  270. multiple option values.  See <FUNCTION>pg_conndefaults</FUNCTION>
  271. for info about the available options in the newer syntax.
  272. </PARA>
  273. </REFSECT1>
  274. <REFSECT1 ID="R1-PGTCL-PGCONNECT-2">
  275. <TITLE>Usage
  276. </TITLE>
  277. <PARA>XXX thomas 1997-12-24
  278. </PARA>
  279. </REFSECT1>
  280. </REFENTRY>
  281. <REFENTRY ID="PGTCL-PGDISCONNECT">
  282. <REFMETA>
  283. <REFENTRYTITLE>pg_disconnect</REFENTRYTITLE>
  284. <REFMISCINFO>PGTCL - Connection Management</REFMISCINFO>
  285. </REFMETA>
  286. <REFNAMEDIV>
  287. <REFNAME>pg_disconnect
  288. </REFNAME>
  289. <REFPURPOSE>closes a connection to the backend server
  290. </REFPURPOSE>
  291. <INDEXTERM ID="IX-PGTCL-PGDISCONNECT-1"><PRIMARY>pgtcl</PRIMARY><SECONDARY>connecting</SECONDARY></INDEXTERM>
  292. <INDEXTERM ID="IX-PGTCL-PGDISCONNECT-2"><PRIMARY>pg_connect</PRIMARY></INDEXTERM>
  293. </REFNAMEDIV>
  294. <REFSYNOPSISDIV>
  295. <REFSYNOPSISDIVINFO>
  296. <DATE>1997-12-24</DATE>
  297. </REFSYNOPSISDIVINFO>
  298. <SYNOPSIS>
  299. pg_disconnect <REPLACEABLE CLASS="PARAMETER">dbHandle</REPLACEABLE>
  300. </SYNOPSIS>
  301. <REFSECT2 ID="R2-PGTCL-PGDISCONNECT-1">
  302. <REFSECT2INFO>
  303. <DATE>1997-12-24</DATE>
  304. </REFSECT2INFO>
  305. <TITLE>Inputs
  306. </TITLE>
  307. <VARIABLELIST>
  308. <VARLISTENTRY>
  309. <TERM>
  310.   <REPLACEABLE CLASS="PARAMETER">dbHandle</REPLACEABLE>
  311. </TERM>
  312. <LISTITEM>
  313. <PARA>Specifies a valid database handle.
  314. </PARA>
  315. </LISTITEM>
  316. </VARLISTENTRY>
  317. </VARIABLELIST>
  318. </REFSECT2>
  319. <REFSECT2 ID="R2-PGTCL-PGDISCONNECT-2">
  320. <REFSECT2INFO>
  321. <DATE>1997-12-24</DATE>
  322. </REFSECT2INFO>
  323. <TITLE>Outputs
  324. </TITLE>
  325. <VARIABLELIST>
  326. <VARLISTENTRY>
  327. <TERM>
  328.   None
  329. </TERM>
  330. <LISTITEM>
  331. <PARA>
  332. </PARA>
  333. </LISTITEM>
  334. </VARLISTENTRY>
  335. </VARIABLELIST>
  336. </REFSECT2>
  337. </REFSYNOPSISDIV>
  338. <REFSECT1 ID="R1-PGTCL-PGDISCONNECT-1">
  339. <REFSECT1INFO>
  340. <DATE>1997-12-24</DATE>
  341. </REFSECT1INFO>
  342. <TITLE>Description
  343. </TITLE>
  344. <PARA><FUNCTION>pg_disconnect</FUNCTION> closes a connection to the <ProductName>Postgres</ProductName> backend.
  345. </PARA>
  346. </REFSECT1>
  347. </REFENTRY>
  348. <REFENTRY ID="PGTCL-PGCONNDEFAULTS">
  349. <REFMETA>
  350. <REFENTRYTITLE>pg_conndefaults</REFENTRYTITLE>
  351. <REFMISCINFO>PGTCL - Connection Management</REFMISCINFO>
  352. </REFMETA>
  353. <REFNAMEDIV>
  354. <REFNAME>pg_conndefaults
  355. </REFNAME>
  356. <REFPURPOSE>obtain information about default connection parameters
  357. </REFPURPOSE>
  358. <INDEXTERM ID="IX-PGTCL-PGCONNDEFAULTS-1"><PRIMARY>pgtcl</PRIMARY><SECONDARY>connecting</SECONDARY></INDEXTERM>
  359. <INDEXTERM ID="IX-PGTCL-PGCONNDEFAULTS-2"><PRIMARY>pg_conndefaults</PRIMARY></INDEXTERM>
  360. </REFNAMEDIV>
  361. <REFSYNOPSISDIV>
  362. <REFSYNOPSISDIVINFO>
  363. <DATE>1998-10-07</DATE>
  364. </REFSYNOPSISDIVINFO>
  365. <SYNOPSIS>
  366. pg_conndefaults
  367. </SYNOPSIS>
  368. <REFSECT2 ID="R2-PGTCL-PGCONNDEFAULTS-1">
  369. <REFSECT2INFO>
  370. <DATE>1998-10-07</DATE>
  371. </REFSECT2INFO>
  372. <TITLE>Inputs
  373. </TITLE>
  374. <PARA>
  375. None.
  376. </PARA>
  377. </REFSECT2>
  378. <REFSECT2 ID="R2-PGTCL-PGCONNDEFAULTS-2">
  379. <REFSECT2INFO>
  380. <DATE>1998-10-07</DATE>
  381. </REFSECT2INFO>
  382. <TITLE>Outputs
  383. </TITLE>
  384. <VARIABLELIST>
  385. <VARLISTENTRY>
  386. <TERM>
  387.   <REPLACEABLE CLASS="PARAMETER">option list</REPLACEABLE>
  388. </TERM>
  389. <LISTITEM>
  390. <PARA>
  391. The result is a list describing the possible connection options and their
  392. current default values.
  393. Each entry in the list is a sublist of the format:
  394. </Para>
  395. <para>
  396.  {optname label dispchar dispsize value}
  397. </Para>
  398. <Para>
  399. where the optname is usable as an option in
  400. <FUNCTION>pg_connect -conninfo</FUNCTION>.
  401. </PARA>
  402. </LISTITEM>
  403. </VARLISTENTRY>
  404. </VARIABLELIST>
  405. </REFSECT2>
  406. </REFSYNOPSISDIV>
  407. <REFSECT1 ID="R1-PGTCL-PGCONNDEFAULTS-1">
  408. <REFSECT1INFO>
  409. <DATE>1998-10-07</DATE>
  410. </REFSECT1INFO>
  411. <TITLE>Description
  412. </TITLE>
  413. <para>
  414. <FUNCTION>pg_conndefaults</FUNCTION> returns info about the connection
  415. options available in <FUNCTION>pg_connect -conninfo</FUNCTION> and the
  416. current default value for each option.
  417. </PARA>
  418. </REFSECT1>
  419. <REFSECT1 ID="R1-PGTCL-PGCONNDEFAULTS-2">
  420. <TITLE>Usage
  421. </TITLE>
  422. <PARA>pg_conndefaults
  423. </PARA>
  424. </REFSECT1>
  425. </REFENTRY>
  426. <REFENTRY ID="PGTCL-PGEXEC">
  427. <REFMETA>
  428. <REFENTRYTITLE>pg_exec</REFENTRYTITLE>
  429. <REFMISCINFO>PGTCL - Query Processing</REFMISCINFO>
  430. </REFMETA>
  431. <REFNAMEDIV>
  432. <REFNAME>pg_exec
  433. </REFNAME>
  434. <REFPURPOSE>
  435. send a query string to the backend 
  436. </REFPURPOSE>
  437. <INDEXTERM ID="IX-PGTCL-PGEXEC-1"><PRIMARY>pgtcl</PRIMARY><SECONDARY>connecting</SECONDARY></INDEXTERM>
  438. <INDEXTERM ID="IX-PGTCL-PGEXEC-2"><PRIMARY>pg_connect</PRIMARY></INDEXTERM>
  439. </REFNAMEDIV>
  440. <REFSYNOPSISDIV>
  441. <REFSYNOPSISDIVINFO>
  442. <DATE>1997-12-24</DATE>
  443. </REFSYNOPSISDIVINFO>
  444. <SYNOPSIS>
  445. pg_exec <REPLACEABLE CLASS="PARAMETER">dbHandle</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">queryString</REPLACEABLE>
  446. </SYNOPSIS>
  447. <!-- ********************************************************** -->
  448. <REFSECT2 ID="R2-PGTCL-PGEXEC-1">
  449. <REFSECT2INFO>
  450. <DATE>1997-12-24</DATE>
  451. </REFSECT2INFO>
  452. <TITLE>Inputs
  453. </TITLE>
  454. <VARIABLELIST>
  455. <VARLISTENTRY>
  456. <TERM>
  457.   <REPLACEABLE CLASS="PARAMETER">dbHandle</REPLACEABLE>
  458. </TERM>
  459. <LISTITEM>
  460. <PARA>Specifies a valid database handle.
  461. </PARA>
  462. </LISTITEM>
  463. </VARLISTENTRY>
  464. <VARLISTENTRY>
  465. <TERM>
  466.   <REPLACEABLE CLASS="PARAMETER">queryString</REPLACEABLE>
  467. </TERM>
  468. <LISTITEM>
  469. <PARA>Specifies a valid SQL query.
  470. </PARA>
  471. </LISTITEM>
  472. </VARLISTENTRY>
  473. </VARIABLELIST>
  474. </REFSECT2>
  475. <REFSECT2 ID="R2-PGTCL-PGEXEC-2">
  476. <REFSECT2INFO>
  477. <DATE>1997-12-24</DATE>
  478. </REFSECT2INFO>
  479. <TITLE>Outputs
  480. </TITLE>
  481. <VARIABLELIST>
  482. <VARLISTENTRY>
  483. <TERM>
  484.   <REPLACEABLE CLASS="PARAMETER">resultHandle</REPLACEABLE>
  485. </TERM>
  486. <LISTITEM>
  487. <PARA>
  488. A Tcl error will be returned if Pgtcl was unable to obtain a backend
  489. response.  Otherwise, a query result object is created and a handle for
  490. it is returned.  This handle can be passed to <FUNCTION>pg_result</FUNCTION>
  491. to obtain the results of the query.
  492. </PARA>
  493. </LISTITEM>
  494. </VARLISTENTRY>
  495. </VARIABLELIST>
  496. </REFSECT2></REFSYNOPSISDIV>
  497. <REFSECT1 ID="R1-PGTCL-PGEXEC-1">
  498. <REFSECT1INFO>
  499. <DATE>1997-12-24</DATE>
  500. </REFSECT1INFO>
  501. <TITLE>Description
  502. </TITLE>
  503. <PARA>
  504. <FUNCTION>pg_exec</FUNCTION> submits a query to the <ProductName>Postgres</ProductName> backend and returns a result.
  505. Query result handles start with the connection handle and add a period
  506. and a result number.
  507. </Para>
  508. <PARA>
  509. Note that lack of a Tcl error is not proof that the query succeeded!
  510. An error message returned by the backend will be processed
  511. as a query result with failure status, not by generating a Tcl error
  512. in pg_exec.
  513. </PARA>
  514. </REFSECT1>
  515. </refentry>
  516. <REFENTRY ID="PGTCL-PGRESULT">
  517. <REFMETA>
  518. <REFENTRYTITLE>pg_result</REFENTRYTITLE>
  519. <REFMISCINFO>PGTCL - Query Processing</REFMISCINFO>
  520. </REFMETA>
  521. <REFNAMEDIV>
  522. <REFNAME>pg_result
  523. </REFNAME>
  524. <REFPURPOSE>
  525. get information about a query result
  526. </REFPURPOSE>
  527. <INDEXTERM ID="IX-PGTCL-PGRESULT-1"><PRIMARY>pgtcl</PRIMARY><SECONDARY>connecting</SECONDARY></INDEXTERM>
  528. <INDEXTERM ID="IX-PGTCL-PGRESULT-2"><PRIMARY>pg_connect</PRIMARY></INDEXTERM>
  529. </REFNAMEDIV>
  530. <REFSYNOPSISDIV>
  531. <REFSYNOPSISDIVINFO>
  532. <DATE>1997-12-24</DATE>
  533. </REFSYNOPSISDIVINFO>
  534. <SYNOPSIS>
  535. pg_result <REPLACEABLE CLASS="PARAMETER">resultHandle</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">resultOption</REPLACEABLE>
  536. </SYNOPSIS>
  537. <REFSECT2 ID="R2-PGTCL-PGRESULT-1">
  538. <REFSECT2INFO>
  539. <DATE>1997-12-24</DATE>
  540. </REFSECT2INFO>
  541. <TITLE>Inputs
  542. </TITLE>
  543. <VARIABLELIST>
  544. <VARLISTENTRY>
  545. <TERM>
  546.   <REPLACEABLE CLASS="PARAMETER">resultHandle</REPLACEABLE>
  547. </TERM>
  548. <LISTITEM>
  549. <PARA>
  550.   The handle for a query result.
  551. </PARA>
  552. </LISTITEM>
  553. </VARLISTENTRY>
  554. <VARLISTENTRY>
  555. <TERM>
  556.   <REPLACEABLE CLASS="PARAMETER">resultOption</REPLACEABLE>
  557. </TERM>
  558. <LISTITEM>
  559. <PARA>
  560. Specifies one of several possible options.
  561. </PARA>
  562. </LISTITEM>
  563. </VARLISTENTRY>
  564. </VARIABLELIST>
  565. <REFSECT3>
  566. <TITLE>Options</TITLE>
  567. <VARIABLELIST>
  568. <VARLISTENTRY>
  569. <TERM>
  570. -status  
  571. </TERM>
  572. <LISTITEM>
  573. <PARA>
  574. the status of the result.
  575. </PARA>
  576. </LISTITEM>
  577. </VARLISTENTRY>
  578. <VARLISTENTRY>
  579. <TERM>
  580. -error
  581. </TERM>
  582. <LISTITEM>
  583. <PARA>
  584. the error message, if the status indicates error; otherwise an empty string.
  585. </PARA>
  586. </LISTITEM>
  587. </VARLISTENTRY>
  588. <VARLISTENTRY>
  589. <TERM>
  590. -conn
  591. </TERM>
  592. <LISTITEM>
  593. <PARA>
  594. the connection that produced the result.
  595. </PARA>
  596. </LISTITEM>
  597. </VARLISTENTRY>
  598. <VARLISTENTRY>
  599. <TERM>
  600. -oid
  601. </TERM>
  602. <LISTITEM>
  603. <PARA>
  604. if the command was an INSERT, the OID of the 
  605. inserted tuple; otherwise an empty string.
  606. </PARA>
  607. </LISTITEM>
  608. </VARLISTENTRY>
  609. <VARLISTENTRY>
  610. <TERM>
  611. -numTuples
  612. </TERM>
  613. <LISTITEM>
  614. <PARA>
  615. the number of tuples returned by the query.
  616. </PARA>
  617. </LISTITEM>
  618. </VARLISTENTRY>
  619. <VARLISTENTRY>
  620. <TERM>
  621. -numAttrs
  622. </TERM>
  623. <LISTITEM>
  624. <PARA>
  625. the number of attributes in each tuple.
  626. </PARA>
  627. </LISTITEM>
  628. </VARLISTENTRY>
  629. <VARLISTENTRY>
  630. <TERM>
  631. -assign arrayName
  632. </TERM>
  633. <LISTITEM>
  634. <PARA>
  635. assign the results to an array, using subscripts of the form
  636. (tupno,attributeName).
  637. </PARA>
  638. </LISTITEM>
  639. </VARLISTENTRY>
  640. <VARLISTENTRY>
  641. <TERM>
  642. -assignbyidx arrayName ?appendstr?
  643. </TERM>
  644. <LISTITEM>
  645. <PARA>
  646. assign the results to an array using the first attribute's value and
  647. the remaining attributes' names as keys.  If appendstr is given then
  648. it is appended to each key.  In short, all but the first field of each
  649. tuple are stored into the array, using subscripts of the form
  650. (firstFieldValue,fieldNameAppendStr).
  651. </PARA>
  652. </LISTITEM>
  653. </VARLISTENTRY>
  654. <VARLISTENTRY>
  655. <TERM>
  656. -getTuple tupleNumber
  657. </TERM>
  658. <LISTITEM>
  659. <PARA>
  660. returns the fields of the indicated tuple in a list.  Tuple numbers
  661. start at zero.
  662. </PARA>
  663. </LISTITEM>
  664. </VARLISTENTRY>
  665. <VARLISTENTRY>
  666. <TERM>
  667. -tupleArray tupleNumber arrayName
  668. </TERM>
  669. <LISTITEM>
  670. <PARA>
  671. stores the fields of the tuple in array arrayName, indexed by field names.
  672. Tuple numbers start at zero.
  673. </PARA>
  674. </LISTITEM>
  675. </VARLISTENTRY>
  676. <VARLISTENTRY>
  677. <TERM>
  678. -attributes
  679. </TERM>
  680. <LISTITEM>
  681. <PARA>
  682. returns a list of the names of the tuple attributes.
  683. </PARA>
  684. </LISTITEM>
  685. </VARLISTENTRY>
  686. <VARLISTENTRY>
  687. <TERM>
  688. -lAttributes
  689. </TERM>
  690. <LISTITEM>
  691. <PARA>
  692. returns a list of sublists, {name ftype fsize} for each tuple attribute.
  693. </PARA>
  694. </LISTITEM>
  695. </VARLISTENTRY>
  696. <VARLISTENTRY>
  697. <TERM>
  698. -clear 
  699. </TERM>
  700. <LISTITEM>
  701. <PARA>
  702. clear the result query object.
  703. </PARA>
  704. </LISTITEM>
  705. </VARLISTENTRY>
  706. </VARIABLELIST>
  707. </REFSECT3>
  708. </REFSECT2>
  709. <REFSECT2 ID="R2-PGTCL-PGRESULT-2">
  710. <REFSECT2INFO>
  711. <DATE>1997-12-24</DATE>
  712. </REFSECT2INFO>
  713. <TITLE>Outputs
  714. </TITLE>
  715. <PARA>
  716. The result depends on the selected option, as described above.
  717. </PARA>
  718. </REFSECT2></REFSYNOPSISDIV>
  719. <REFSECT1 ID="R1-PGTCL-PGRESULT-1">
  720. <REFSECT1INFO>
  721. <DATE>1997-12-24</DATE>
  722. </REFSECT1INFO>
  723. <TITLE>Description
  724. </TITLE>
  725. <PARA>
  726. <FUNCTION>pg_result</FUNCTION> returns information about a query result
  727. created by a prior <FUNCTION>pg_exec</FUNCTION>.
  728. </Para>
  729. <para>
  730. You can keep a query result around for as long as you need it, but when
  731. you are done with it, be sure to free it by
  732. executing <FUNCTION>pg_result -clear</FUNCTION>.  Otherwise, you have
  733. a memory leak, and Pgtcl will eventually start complaining that you've
  734. created too many query result objects.
  735. </PARA>
  736. </REFSECT1>
  737. </REFENTRY>
  738. <!-- ********************************************************** -->
  739. <REFENTRY ID="PGTCL-PGSELECT">
  740. <REFMETA>
  741. <REFENTRYTITLE>pg_select</REFENTRYTITLE>
  742. <REFMISCINFO>PGTCL - Query Processing</REFMISCINFO>
  743. </REFMETA>
  744. <REFNAMEDIV>
  745. <REFNAME>pg_select
  746. </REFNAME>
  747. <REFPURPOSE>
  748. loop over the result of a SELECT statement
  749. </REFPURPOSE>
  750. <INDEXTERM ID="IX-PGTCL-PGSELECT-1"><PRIMARY>pgtcl</PRIMARY><SECONDARY>connecting</SECONDARY></INDEXTERM>
  751. <INDEXTERM ID="IX-PGTCL-PGSELECT-2"><PRIMARY>pg_connect</PRIMARY></INDEXTERM>
  752. </REFNAMEDIV>
  753. <REFSYNOPSISDIV>
  754. <REFSYNOPSISDIVINFO>
  755. <DATE>1997-12-24</DATE>
  756. </REFSYNOPSISDIVINFO>
  757. <SYNOPSIS>
  758. pg_select <REPLACEABLE CLASS="PARAMETER">dbHandle</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">queryString</REPLACEABLE>
  759.   <REPLACEABLE CLASS="PARAMETER">arrayVar</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">queryProcedure</REPLACEABLE>
  760. </SYNOPSIS>
  761. <REFSECT2 ID="R2-PGTCL-PGSELECT-1">
  762. <REFSECT2INFO>
  763. <DATE>1997-12-24</DATE>
  764. </REFSECT2INFO>
  765. <TITLE>Inputs
  766. </TITLE>
  767. <VARIABLELIST>
  768. <VARLISTENTRY>
  769. <TERM>
  770.   <REPLACEABLE CLASS="PARAMETER">dbHandle</REPLACEABLE>
  771. </TERM>
  772. <LISTITEM>
  773. <PARA>Specifies a valid database handle.
  774. </PARA>
  775. </LISTITEM>
  776. </VARLISTENTRY>
  777. <VARLISTENTRY>
  778. <TERM>
  779.   <REPLACEABLE CLASS="PARAMETER">queryString</REPLACEABLE>
  780. </TERM>
  781. <LISTITEM>
  782. <PARA>Specifies a valid SQL select query.
  783. </PARA>
  784. </LISTITEM>
  785. </VARLISTENTRY>
  786. <VARLISTENTRY>
  787. <TERM>
  788.   <REPLACEABLE CLASS="PARAMETER">arrayVar</REPLACEABLE>
  789. </TERM>
  790. <LISTITEM>
  791. <PARA>Array variable for tuples returned.
  792. </PARA>
  793. </LISTITEM>
  794. </VARLISTENTRY>
  795. <VARLISTENTRY>
  796. <TERM>
  797.   <REPLACEABLE CLASS="PARAMETER">queryProcedure</REPLACEABLE>
  798. </TERM>
  799. <LISTITEM>
  800. <PARA>Procedure run on each tuple found.
  801. </PARA>
  802. </LISTITEM>
  803. </VARLISTENTRY>
  804. </VARIABLELIST>
  805. </REFSECT2>
  806. <REFSECT2 ID="R2-PGTCL-PGSELECT-2">
  807. <REFSECT2INFO>
  808. <DATE>1997-12-24</DATE>
  809. </REFSECT2INFO>
  810. <TITLE>Outputs
  811. </TITLE>
  812. <VARIABLELIST>
  813. <VARLISTENTRY>
  814. <TERM>
  815.   <REPLACEABLE CLASS="PARAMETER">resultHandle</REPLACEABLE>
  816. </TERM>
  817. <LISTITEM>
  818. <PARA>
  819.    the return result is either an error message or a handle for a query result.
  820. </PARA>
  821. </LISTITEM>
  822. </VARLISTENTRY>
  823. </VARIABLELIST>
  824. </REFSECT2></REFSYNOPSISDIV>
  825. <REFSECT1 ID="R1-PGTCL-PGSELECT-1">
  826. <REFSECT1INFO>
  827. <DATE>1997-12-24</DATE>
  828. </REFSECT1INFO>
  829. <TITLE>Description
  830. </TITLE>
  831. <PARA>
  832. <FUNCTION>pg_select</FUNCTION> submits a SELECT query to the
  833. <ProductName>Postgres</ProductName> backend, and executes a
  834. given chunk of code for each tuple in the result.
  835.   The <REPLACEABLE CLASS="PARAMETER">queryString</REPLACEABLE>
  836.   must be a SELECT statement.  Anything else returns an error.
  837.   The <REPLACEABLE CLASS="PARAMETER">arrayVar</REPLACEABLE>
  838.   variable is an array name used in the loop.  For each tuple,
  839.   <REPLACEABLE CLASS="PARAMETER">arrayVar</REPLACEABLE> is filled in
  840.   with the tuple field values, using the field names as the array
  841.   indexes.  Then the
  842.   <REPLACEABLE CLASS="PARAMETER">queryProcedure</REPLACEABLE>
  843.   is executed.
  844. </PARA>
  845. </REFSECT1>
  846. <REFSECT1 ID="R1-PGTCL-PGSELECT-2">
  847. <TITLE>Usage
  848. </TITLE>
  849. <PARA>
  850. This would work if table "table" has fields "control" and "name"
  851. (and, perhaps, other fields):
  852. <ProgramListing>
  853. pg_select $pgconn "SELECT * from table" array {
  854. puts [format "%5d %s" array(control) array(name)]
  855. }
  856. </ProgramListing>
  857. </PARA>
  858. </REFSECT1>
  859. </REFENTRY>
  860. <!-- ********************************************************** -->
  861. <REFENTRY ID="PGTCL-PGLISTEN">
  862. <REFMETA>
  863. <REFENTRYTITLE>pg_listen</REFENTRYTITLE>
  864. <REFMISCINFO>PGTCL - Asynchronous Notify</REFMISCINFO>
  865. </REFMETA>
  866. <REFNAMEDIV>
  867. <REFNAME>pg_listen
  868. </REFNAME>
  869. <REFPURPOSE>sets or changes a callback for asynchronous NOTIFY messages
  870. </REFPURPOSE>
  871. <INDEXTERM ID="IX-PGTCL-PGLISTEN-1"><PRIMARY>pgtcl</PRIMARY><SECONDARY>notify</SECONDARY></INDEXTERM>
  872. <INDEXTERM ID="IX-PGTCL-PGLISTEN-2"><PRIMARY>notify</PRIMARY></INDEXTERM>
  873. </REFNAMEDIV>
  874. <REFSYNOPSISDIV>
  875. <REFSYNOPSISDIVINFO>
  876. <DATE>1998-5-22</DATE>
  877. </REFSYNOPSISDIVINFO>
  878. <SYNOPSIS>
  879. pg_listen <REPLACEABLE CLASS="PARAMETER">dbHandle</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">notifyName</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">callbackCommand</REPLACEABLE>
  880. </SYNOPSIS>
  881. <REFSECT2 ID="R2-PGTCL-PGLISTEN-1">
  882. <REFSECT2INFO>
  883. <DATE>1998-5-22</DATE>
  884. </REFSECT2INFO>
  885. <TITLE>Inputs
  886. </TITLE>
  887. <VARIABLELIST>
  888. <VARLISTENTRY>
  889. <TERM>
  890.   <REPLACEABLE CLASS="PARAMETER">dbHandle</REPLACEABLE>
  891. </TERM>
  892. <LISTITEM>
  893. <PARA>Specifies a valid database handle.
  894. </PARA>
  895. </LISTITEM>
  896. </VARLISTENTRY>
  897. <VARLISTENTRY>
  898. <TERM>
  899.   <REPLACEABLE CLASS="PARAMETER">notifyName</REPLACEABLE>
  900. </TERM>
  901. <LISTITEM>
  902. <PARA>Specifies the notify condition name to start or stop listening to.
  903. </PARA>
  904. </LISTITEM>
  905. </VARLISTENTRY>
  906. <VARLISTENTRY>
  907. <TERM>
  908.   <REPLACEABLE CLASS="PARAMETER">callbackCommand</REPLACEABLE>
  909. </TERM>
  910. <LISTITEM>
  911. <PARA>If present and not empty, provides the command string to execute
  912. when a matching notification arrives.
  913. </PARA>
  914. </LISTITEM>
  915. </VARLISTENTRY>
  916. </VARIABLELIST>
  917. </REFSECT2>
  918. <REFSECT2 ID="R2-PGTCL-PGLISTEN-2">
  919. <REFSECT2INFO>
  920. <DATE>1998-5-22</DATE>
  921. </REFSECT2INFO>
  922. <TITLE>Outputs
  923. </TITLE>
  924. <VARIABLELIST>
  925. <VARLISTENTRY>
  926. <TERM>
  927.   None
  928. </TERM>
  929. <LISTITEM>
  930. <PARA>
  931. </PARA>
  932. </LISTITEM>
  933. </VARLISTENTRY>
  934. </VARIABLELIST>
  935. </REFSECT2>
  936. </REFSYNOPSISDIV>
  937. <REFSECT1 ID="R1-PGTCL-PGLISTEN-1">
  938. <REFSECT1INFO>
  939. <DATE>1998-5-22</DATE>
  940. </REFSECT1INFO>
  941. <TITLE>Description
  942. </TITLE>
  943. <PARA><FUNCTION>pg_listen</FUNCTION> creates, changes, or cancels a request
  944. to listen for asynchronous NOTIFY messages from the
  945. <ProductName>Postgres</ProductName> backend.  With a callbackCommand
  946. parameter, the request is established, or the command string of an already
  947. existing request is replaced.  With no callbackCommand parameter, a prior
  948. request is canceled.
  949. </PARA>
  950. <para>
  951. After a <FUNCTION>pg_listen</FUNCTION> request is established,
  952. the specified command string is executed whenever a NOTIFY message bearing
  953. the given name arrives from the backend.  This occurs when any
  954. <ProductName>Postgres</ProductName> client application issues a NOTIFY command
  955. referencing that name.  (Note that the name can be, but does not have to be,
  956. that of an existing relation in the database.)
  957. The command string is executed from the Tcl idle loop.  That is the normal
  958. idle state of an application written with Tk.  In non-Tk Tcl shells, you can
  959. execute <FUNCTION>update</FUNCTION> or <FUNCTION>vwait</FUNCTION> to cause
  960. the idle loop to be entered.
  961. </Para>
  962. <para>
  963. You should not invoke the SQL statements LISTEN or UNLISTEN directly when
  964. using <FUNCTION>pg_listen</FUNCTION>.  Pgtcl takes care of issuing those
  965. statements for you.  But if you want to send a NOTIFY message yourself,
  966. invoke the SQL NOTIFY statement using <FUNCTION>pg_exec</FUNCTION>.
  967. </PARA>
  968. </REFSECT1>
  969. </REFENTRY>
  970. <!-- ********************************************************** -->
  971. <REFENTRY ID="PGTCL-PGLOCREAT">
  972. <REFMETA>
  973. <REFENTRYTITLE>pg_lo_creat</REFENTRYTITLE>
  974. <REFMISCINFO>PGTCL - Large Objects</REFMISCINFO>
  975. </REFMETA>
  976. <REFNAMEDIV>
  977. <REFNAME>pg_lo_creat
  978. </REFNAME>
  979. <REFPURPOSE>create a large object
  980. </REFPURPOSE>
  981. <INDEXTERM ID="IX-PGTCL-PGLOCREAT-1"><PRIMARY>pgtcl</PRIMARY><SECONDARY>creating</SECONDARY></INDEXTERM>
  982. <INDEXTERM ID="IX-PGTCL-PGLOCREAT-2"><PRIMARY>pg_lo_creat</PRIMARY></INDEXTERM>
  983. </REFNAMEDIV>
  984. <REFSYNOPSISDIV>
  985. <REFSYNOPSISDIVINFO>
  986. <DATE>1997-12-24</DATE>
  987. </REFSYNOPSISDIVINFO>
  988. <SYNOPSIS>
  989. pg_lo_creat <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">mode</REPLACEABLE>
  990. </SYNOPSIS>
  991. <REFSECT2 ID="R2-PGTCL-PGLOCREAT-1">
  992. <REFSECT2INFO>
  993. <DATE>1997-12-24</DATE>
  994. </REFSECT2INFO>
  995. <TITLE>Inputs
  996. </TITLE>
  997. <VARIABLELIST>
  998. <VARLISTENTRY>
  999. <TERM>
  1000.   <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE>
  1001. </TERM>
  1002. <LISTITEM>
  1003. <PARA>Specifies a valid database connection.
  1004. </PARA>
  1005. </LISTITEM>
  1006. </VARLISTENTRY>
  1007. <VARLISTENTRY>
  1008. <TERM>
  1009.   <REPLACEABLE CLASS="PARAMETER">mode</REPLACEABLE>
  1010. </TERM>
  1011. <LISTITEM>
  1012. <PARA>Specifies the access mode for the large object</PARA>
  1013. </LISTITEM>
  1014. </VARLISTENTRY>
  1015. </VARIABLELIST>
  1016. </REFSECT2>
  1017. <REFSECT2 ID="R2-PGTCL-PGLOCREAT-2">
  1018. <REFSECT2INFO>
  1019. <DATE>1997-12-24</DATE>
  1020. </REFSECT2INFO>
  1021. <TITLE>Outputs
  1022. </TITLE>
  1023. <VARIABLELIST>
  1024. <VARLISTENTRY>
  1025. <TERM>
  1026.   <REPLACEABLE CLASS="PARAMETER">objOid</REPLACEABLE>
  1027. </TERM>
  1028. <LISTITEM>
  1029. <PARA>
  1030. The oid of the large object created.
  1031. </PARA>
  1032. </LISTITEM>
  1033. </VARLISTENTRY>
  1034. </VARIABLELIST>
  1035. </REFSECT2>
  1036. </REFSYNOPSISDIV>
  1037. <REFSECT1 ID="R1-PGTCL-PGLOCREAT-1">
  1038. <REFSECT1INFO>
  1039. <DATE>1997-12-24</DATE>
  1040. </REFSECT1INFO>
  1041. <TITLE>Description
  1042. </TITLE>
  1043. <PARA><FUNCTION>pg_lo_creat</FUNCTION> creates an Inversion Large Object.
  1044. </PARA>
  1045. </REFSECT1>
  1046. <REFSECT1 ID="R1-PGTCL-PGLOCREAT-2">
  1047. <TITLE>Usage
  1048. </TITLE>
  1049. <PARA>
  1050. mode can be any OR'ing together of INV_READ, INV_WRITE, and INV_ARCHIVE. 
  1051. The OR delimiter character is "|".
  1052. <ProgramListing>
  1053. [pg_lo_creat $conn "INV_READ|INV_WRITE"]
  1054. </ProgramListing>
  1055. </PARA>
  1056. </REFSECT1>
  1057. </REFENTRY>
  1058. <!-- ********************************************************** -->
  1059. <REFENTRY ID="PGTCL-PGLOOPEN">
  1060. <REFMETA>
  1061. <REFENTRYTITLE>pg_lo_open</REFENTRYTITLE>
  1062. <REFMISCINFO>PGTCL - Large Objects</REFMISCINFO>
  1063. </REFMETA>
  1064. <REFNAMEDIV>
  1065. <REFNAME>pg_lo_open
  1066. </REFNAME>
  1067. <REFPURPOSE>open a large object
  1068. </REFPURPOSE>
  1069. <INDEXTERM ID="IX-PGTCL-PGLOOPEN-1"><PRIMARY>pgtcl</PRIMARY><SECONDARY>opening</SECONDARY></INDEXTERM>
  1070. <INDEXTERM ID="IX-PGTCL-PGLOOPEN-2"><PRIMARY>pg_lo_open</PRIMARY></INDEXTERM>
  1071. </REFNAMEDIV>
  1072. <REFSYNOPSISDIV>
  1073. <REFSYNOPSISDIVINFO>
  1074. <DATE>1997-12-24</DATE>
  1075. </REFSYNOPSISDIVINFO>
  1076. <SYNOPSIS>
  1077. pg_lo_open <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">objOid</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">mode</REPLACEABLE>
  1078. </SYNOPSIS>
  1079. <REFSECT2 ID="R2-PGTCL-PGLOOPEN-1">
  1080. <REFSECT2INFO>
  1081. <DATE>1997-12-24</DATE>
  1082. </REFSECT2INFO>
  1083. <TITLE>Inputs
  1084. </TITLE>
  1085. <VARIABLELIST>
  1086. <VARLISTENTRY>
  1087. <TERM>
  1088.   <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE>
  1089. </TERM>
  1090. <LISTITEM>
  1091. <PARA>Specifies a valid database connection.
  1092. </PARA>
  1093. </LISTITEM>
  1094. </VARLISTENTRY>
  1095. <VARLISTENTRY>
  1096. <TERM>
  1097.   <REPLACEABLE CLASS="PARAMETER">objOid</REPLACEABLE>
  1098. </TERM>
  1099. <LISTITEM>
  1100. <PARA>Specifies a valid large object oid.
  1101. </PARA>
  1102. </LISTITEM>
  1103. </VARLISTENTRY>
  1104. <VARLISTENTRY>
  1105. <TERM>
  1106.   <REPLACEABLE CLASS="PARAMETER">mode</REPLACEABLE>
  1107. </TERM>
  1108. <LISTITEM>
  1109. <PARA>Specifies the access mode for the large object</PARA>
  1110. </LISTITEM>
  1111. </VARLISTENTRY>
  1112. </VARIABLELIST>
  1113. </REFSECT2>
  1114. <REFSECT2 ID="R2-PGTCL-PGLOOPEN-2">
  1115. <REFSECT2INFO>
  1116. <DATE>1997-12-24</DATE>
  1117. </REFSECT2INFO>
  1118. <TITLE>Outputs
  1119. </TITLE>
  1120. <VARIABLELIST>
  1121. <VARLISTENTRY>
  1122. <TERM>
  1123.   <REPLACEABLE CLASS="PARAMETER">fd</REPLACEABLE>
  1124. </TERM>
  1125. <LISTITEM>
  1126. <PARA>
  1127. A file descriptor for use in later pg_lo* routines.
  1128. </PARA>
  1129. </LISTITEM>
  1130. </VARLISTENTRY>
  1131. </VARIABLELIST>
  1132. </REFSECT2>
  1133. </REFSYNOPSISDIV>
  1134. <REFSECT1 ID="R1-PGTCL-PGLOOPEN-1">
  1135. <REFSECT1INFO>
  1136. <DATE>1997-12-24</DATE>
  1137. </REFSECT1INFO>
  1138. <TITLE>Description
  1139. </TITLE>
  1140. <PARA><FUNCTION>pg_lo_open</FUNCTION> open an Inversion Large Object.
  1141. </PARA>
  1142. </REFSECT1>
  1143. <REFSECT1 ID="R1-PGTCL-PGLOOPEN-2">
  1144. <TITLE>Usage
  1145. </TITLE>
  1146. <PARA>
  1147. Mode can be either "r", "w", or "rw".
  1148. </PARA>
  1149. </REFSECT1>
  1150. </REFENTRY>
  1151. <!-- ********************************************************** -->
  1152. <REFENTRY ID="PGTCL-PGLOCLOSE">
  1153. <REFMETA>
  1154. <REFENTRYTITLE>pg_lo_close</REFENTRYTITLE>
  1155. <REFMISCINFO>PGTCL - Large Objects</REFMISCINFO>
  1156. </REFMETA>
  1157. <REFNAMEDIV>
  1158. <REFNAME>pg_lo_close
  1159. </REFNAME>
  1160. <REFPURPOSE>close a large object
  1161. </REFPURPOSE>
  1162. <INDEXTERM ID="IX-PGTCL-PGLOCLOSE-1"><PRIMARY>pgtcl</PRIMARY><SECONDARY>closing</SECONDARY></INDEXTERM>
  1163. <INDEXTERM ID="IX-PGTCL-PGLOCLOSE-2"><PRIMARY>pg_lo_close</PRIMARY></INDEXTERM>
  1164. </REFNAMEDIV>
  1165. <REFSYNOPSISDIV>
  1166. <REFSYNOPSISDIVINFO>
  1167. <DATE>1997-12-24</DATE>
  1168. </REFSYNOPSISDIVINFO>
  1169. <SYNOPSIS>
  1170. pg_lo_close <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">fd</REPLACEABLE>
  1171. </SYNOPSIS>
  1172. <REFSECT2 ID="R2-PGTCL-PGLOCLOSE-1">
  1173. <REFSECT2INFO>
  1174. <DATE>1997-12-24</DATE>
  1175. </REFSECT2INFO>
  1176. <TITLE>Inputs
  1177. </TITLE>
  1178. <VARIABLELIST>
  1179. <VARLISTENTRY>
  1180. <TERM>
  1181.   <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE>
  1182. </TERM>
  1183. <LISTITEM>
  1184. <PARA>Specifies a valid database connection.
  1185. </PARA>
  1186. </LISTITEM>
  1187. </VARLISTENTRY>
  1188. <VARLISTENTRY>
  1189. <TERM>
  1190.   <REPLACEABLE CLASS="PARAMETER">fd</REPLACEABLE>
  1191. </TERM>
  1192. <LISTITEM>
  1193. <PARA>
  1194. A file descriptor for use in later pg_lo* routines.
  1195. </PARA>
  1196. </LISTITEM>
  1197. </VARLISTENTRY>
  1198. </VARIABLELIST>
  1199. </REFSECT2>
  1200. <REFSECT2 ID="R2-PGTCL-PGLOCLOSE-2">
  1201. <REFSECT2INFO>
  1202. <DATE>1997-12-24</DATE>
  1203. </REFSECT2INFO>
  1204. <TITLE>Outputs
  1205. </TITLE>
  1206. <PARA>None</PARA>
  1207. </REFSECT2>
  1208. </REFSYNOPSISDIV>
  1209. <REFSECT1 ID="R1-PGTCL-PGLOCLOSE-1">
  1210. <REFSECT1INFO>
  1211. <DATE>1997-12-24</DATE>
  1212. </REFSECT1INFO>
  1213. <TITLE>Description
  1214. </TITLE>
  1215. <PARA><FUNCTION>pg_lo_close</FUNCTION> closes an Inversion Large Object.
  1216. </PARA>
  1217. </REFSECT1>
  1218. <REFSECT1 ID="R1-PGTCL-PGLOCLOSE-2">
  1219. <TITLE>Usage
  1220. </TITLE>
  1221. <PARA>
  1222. </PARA>
  1223. </REFSECT1>
  1224. </REFENTRY>
  1225. <!-- ********************************************************** -->
  1226. <REFENTRY ID="PGTCL-PGLOREAD">
  1227. <REFMETA>
  1228. <REFENTRYTITLE>pg_lo_read</REFENTRYTITLE>
  1229. <REFMISCINFO>PGTCL - Large Objects</REFMISCINFO>
  1230. </REFMETA>
  1231. <REFNAMEDIV>
  1232. <REFNAME>pg_lo_read
  1233. </REFNAME>
  1234. <REFPURPOSE>read a large object
  1235. </REFPURPOSE>
  1236. <INDEXTERM ID="IX-PGTCL-PGLOREAD-1"><PRIMARY>pgtcl</PRIMARY><SECONDARY>reading</SECONDARY></INDEXTERM>
  1237. <INDEXTERM ID="IX-PGTCL-PGLOREAD-2"><PRIMARY>pg_lo_read</PRIMARY></INDEXTERM>
  1238. </REFNAMEDIV>
  1239. <REFSYNOPSISDIV>
  1240. <REFSYNOPSISDIVINFO>
  1241. <DATE>1997-12-24</DATE>
  1242. </REFSYNOPSISDIVINFO>
  1243. <SYNOPSIS>
  1244. pg_lo_read <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">fd</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">bufVar</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">len</REPLACEABLE>
  1245. </SYNOPSIS>
  1246. <REFSECT2 ID="R2-PGTCL-PGLOREAD-1">
  1247. <REFSECT2INFO>
  1248. <DATE>1997-12-24</DATE>
  1249. </REFSECT2INFO>
  1250. <TITLE>Inputs
  1251. </TITLE>
  1252. <VARIABLELIST>
  1253. <VARLISTENTRY>
  1254. <TERM>
  1255.   <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE>
  1256. </TERM>
  1257. <LISTITEM>
  1258. <PARA>Specifies a valid database connection.
  1259. </PARA>
  1260. </LISTITEM>
  1261. </VARLISTENTRY>
  1262. <VARLISTENTRY>
  1263. <TERM>
  1264.   <REPLACEABLE CLASS="PARAMETER">fd</REPLACEABLE>
  1265. </TERM>
  1266. <LISTITEM>
  1267. <PARA>
  1268. File descriptor for the large object from pg_lo_open.
  1269. </PARA>
  1270. </LISTITEM>
  1271. </VARLISTENTRY>
  1272. <VARLISTENTRY>
  1273. <TERM>
  1274.   <REPLACEABLE CLASS="PARAMETER">bufVar</REPLACEABLE>
  1275. </TERM>
  1276. <LISTITEM>
  1277. <PARA>Specifies a valid buffer variable to contain the large object segment.
  1278. </PARA>
  1279. </LISTITEM>
  1280. </VARLISTENTRY>
  1281. <VARLISTENTRY>
  1282. <TERM>
  1283.   <REPLACEABLE CLASS="PARAMETER">len</REPLACEABLE>
  1284. </TERM>
  1285. <LISTITEM>
  1286. <PARA>Specifies the maximum allowable size of the large object segment.</PARA>
  1287. </LISTITEM>
  1288. </VARLISTENTRY>
  1289. </VARIABLELIST>
  1290. </REFSECT2>
  1291. <REFSECT2 ID="R2-PGTCL-PGLOREAD-2">
  1292. <REFSECT2INFO>
  1293. <DATE>1997-12-24</DATE>
  1294. </REFSECT2INFO>
  1295. <TITLE>Outputs
  1296. </TITLE>
  1297. <PARA>None</PARA>
  1298. </REFSECT2>
  1299. </REFSYNOPSISDIV>
  1300. <REFSECT1 ID="R1-PGTCL-PGLOREAD-1">
  1301. <REFSECT1INFO>
  1302. <DATE>1997-12-24</DATE>
  1303. </REFSECT1INFO>
  1304. <TITLE>Description
  1305. </TITLE>
  1306. <PARA><FUNCTION>pg_lo_read</FUNCTION> reads 
  1307. at most <REPLACEABLE CLASS="PARAMETER">len</REPLACEABLE> bytes from a large object into a variable
  1308.  named <REPLACEABLE CLASS="PARAMETER">bufVar</REPLACEABLE>.
  1309. </PARA>
  1310. </REFSECT1>
  1311. <REFSECT1 ID="R1-PGTCL-PGLOREAD-2">
  1312. <TITLE>Usage
  1313. </TITLE>
  1314. <PARA>
  1315. <REPLACEABLE CLASS="PARAMETER">bufVar</REPLACEABLE> must be a valid variable name.
  1316. </PARA>
  1317. </REFSECT1>
  1318. </REFENTRY>
  1319. <!-- ********************************************************** -->
  1320. <REFENTRY ID="PGTCL-PGLOWRITE">
  1321. <REFMETA>
  1322. <REFENTRYTITLE>pg_lo_write</REFENTRYTITLE>
  1323. <REFMISCINFO>PGTCL - Large Objects</REFMISCINFO>
  1324. </REFMETA>
  1325. <REFNAMEDIV>
  1326. <REFNAME>pg_lo_write
  1327. </REFNAME>
  1328. <REFPURPOSE>write a large object
  1329. </REFPURPOSE>
  1330. <INDEXTERM ID="IX-PGTCL-PGLOWRITE-1"><PRIMARY>pgtcl</PRIMARY><SECONDARY>writing</SECONDARY></INDEXTERM>
  1331. <INDEXTERM ID="IX-PGTCL-PGLOWRITE-2"><PRIMARY>pg_lo_write</PRIMARY></INDEXTERM>
  1332. </REFNAMEDIV>
  1333. <REFSYNOPSISDIV>
  1334. <REFSYNOPSISDIVINFO>
  1335. <DATE>1997-12-24</DATE>
  1336. </REFSYNOPSISDIVINFO>
  1337. <SYNOPSIS>
  1338. pg_lo_write <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">fd</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">buf</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">len</REPLACEABLE>
  1339. </SYNOPSIS>
  1340. <REFSECT2 ID="R2-PGTCL-PGLOWRITE-1">
  1341. <REFSECT2INFO>
  1342. <DATE>1997-12-24</DATE>
  1343. </REFSECT2INFO>
  1344. <TITLE>Inputs
  1345. </TITLE>
  1346. <VARIABLELIST>
  1347. <VARLISTENTRY>
  1348. <TERM>
  1349.   <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE>
  1350. </TERM>
  1351. <LISTITEM>
  1352. <PARA>Specifies a valid database connection.
  1353. </PARA>
  1354. </LISTITEM>
  1355. </VARLISTENTRY>
  1356. <VARLISTENTRY>
  1357. <TERM>
  1358.   <REPLACEABLE CLASS="PARAMETER">fd</REPLACEABLE>
  1359. </TERM>
  1360. <LISTITEM>
  1361. <PARA>
  1362. File descriptor for the large object from pg_lo_open.
  1363. </PARA>
  1364. </LISTITEM>
  1365. </VARLISTENTRY>
  1366. <VARLISTENTRY>
  1367. <TERM>
  1368.   <REPLACEABLE CLASS="PARAMETER">buf</REPLACEABLE>
  1369. </TERM>
  1370. <LISTITEM>
  1371. <PARA>Specifies a valid string variable to write to the large object.
  1372. </PARA>
  1373. </LISTITEM>
  1374. </VARLISTENTRY>
  1375. <VARLISTENTRY>
  1376. <TERM>
  1377.   <REPLACEABLE CLASS="PARAMETER">len</REPLACEABLE>
  1378. </TERM>
  1379. <LISTITEM>
  1380. <PARA>Specifies the maximum size of the string to write.</PARA>
  1381. </LISTITEM>
  1382. </VARLISTENTRY>
  1383. </VARIABLELIST>
  1384. </REFSECT2>
  1385. <REFSECT2 ID="R2-PGTCL-PGLOWRITE-2">
  1386. <REFSECT2INFO>
  1387. <DATE>1997-12-24</DATE>
  1388. </REFSECT2INFO>
  1389. <TITLE>Outputs
  1390. </TITLE>
  1391. <PARA>None</PARA>
  1392. </REFSECT2>
  1393. </REFSYNOPSISDIV>
  1394. <REFSECT1 ID="R1-PGTCL-PGLOWRITE-1">
  1395. <REFSECT1INFO>
  1396. <DATE>1997-12-24</DATE>
  1397. </REFSECT1INFO>
  1398. <TITLE>Description
  1399. </TITLE>
  1400. <PARA><FUNCTION>pg_lo_write</FUNCTION> writes 
  1401. at most <REPLACEABLE CLASS="PARAMETER">len</REPLACEABLE> bytes to a large object from a variable
  1402.  <REPLACEABLE CLASS="PARAMETER">buf</REPLACEABLE>.
  1403. </PARA>
  1404. </REFSECT1>
  1405. <REFSECT1 ID="R1-PGTCL-PGLOWRITE-2">
  1406. <TITLE>Usage
  1407. </TITLE>
  1408. <PARA>
  1409. <REPLACEABLE CLASS="PARAMETER">buf</REPLACEABLE> must be 
  1410. the actual string to write, not a variable name.
  1411. </PARA>
  1412. </REFSECT1>
  1413. </REFENTRY>
  1414. <!-- ********************************************************** -->
  1415. <REFENTRY ID="PGTCL-PGLOLSEEK">
  1416. <REFMETA>
  1417. <REFENTRYTITLE>pg_lo_lseek</REFENTRYTITLE>
  1418. <REFMISCINFO>PGTCL - Large Objects</REFMISCINFO>
  1419. </REFMETA>
  1420. <REFNAMEDIV>
  1421. <REFNAME>pg_lo_lseek
  1422. </REFNAME>
  1423. <REFPURPOSE>seek to a position in a large object
  1424. </REFPURPOSE>
  1425. <INDEXTERM ID="IX-PGTCL-PGLOLSEEK-1"><PRIMARY>pgtcl</PRIMARY><SECONDARY>positioning</SECONDARY></INDEXTERM>
  1426. <INDEXTERM ID="IX-PGTCL-PGLOLSEEK-2"><PRIMARY>pg_lo_lseek</PRIMARY></INDEXTERM>
  1427. </REFNAMEDIV>
  1428. <REFSYNOPSISDIV>
  1429. <REFSYNOPSISDIVINFO>
  1430. <DATE>1997-12-24</DATE>
  1431. </REFSYNOPSISDIVINFO>
  1432. <SYNOPSIS>
  1433. pg_lo_lseek <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">fd</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">offset</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">whence</REPLACEABLE>
  1434. </SYNOPSIS>
  1435. <REFSECT2 ID="R2-PGTCL-PGLOLSEEK-1">
  1436. <REFSECT2INFO>
  1437. <DATE>1997-12-24</DATE>
  1438. </REFSECT2INFO>
  1439. <TITLE>Inputs
  1440. </TITLE>
  1441. <VARIABLELIST>
  1442. <VARLISTENTRY>
  1443. <TERM>
  1444.   <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE>
  1445. </TERM>
  1446. <LISTITEM>
  1447. <PARA>Specifies a valid database connection.
  1448. </PARA>
  1449. </LISTITEM>
  1450. </VARLISTENTRY>
  1451. <VARLISTENTRY>
  1452. <TERM>
  1453.   <REPLACEABLE CLASS="PARAMETER">fd</REPLACEABLE>
  1454. </TERM>
  1455. <LISTITEM>
  1456. <PARA>
  1457. File descriptor for the large object from pg_lo_open.
  1458. </PARA>
  1459. </LISTITEM>
  1460. </VARLISTENTRY>
  1461. <VARLISTENTRY>
  1462. <TERM>
  1463.   <REPLACEABLE CLASS="PARAMETER">offset</REPLACEABLE>
  1464. </TERM>
  1465. <LISTITEM>
  1466. <PARA>Specifies a zero-based offset in bytes.
  1467. </PARA>
  1468. </LISTITEM>
  1469. </VARLISTENTRY>
  1470. <VARLISTENTRY>
  1471. <TERM>
  1472.   <REPLACEABLE CLASS="PARAMETER">whence</REPLACEABLE>
  1473. </TERM>
  1474. <LISTITEM>
  1475. <PARA> whence can be "SEEK_CUR", "SEEK_END", or "SEEK_SET" </PARA>
  1476. </LISTITEM>
  1477. </VARLISTENTRY>
  1478. </VARIABLELIST>
  1479. </REFSECT2>
  1480. <REFSECT2 ID="R2-PGTCL-PGLOLSEEK-2">
  1481. <REFSECT2INFO>
  1482. <DATE>1997-12-24</DATE>
  1483. </REFSECT2INFO>
  1484. <TITLE>Outputs
  1485. </TITLE>
  1486. <PARA>None</PARA>
  1487. </REFSECT2>
  1488. </REFSYNOPSISDIV>
  1489. <REFSECT1 ID="R1-PGTCL-PGLOLSEEK-1">
  1490. <REFSECT1INFO>
  1491. <DATE>1997-12-24</DATE>
  1492. </REFSECT1INFO>
  1493. <TITLE>Description
  1494. </TITLE>
  1495. <PARA><FUNCTION>pg_lo_lseek</FUNCTION> positions 
  1496. to <REPLACEABLE CLASS="PARAMETER">offset</REPLACEABLE> bytes from the beginning of the large object.
  1497. </PARA>
  1498. </REFSECT1>
  1499. <REFSECT1 ID="R1-PGTCL-PGLOLSEEK-2">
  1500. <TITLE>Usage
  1501. </TITLE>
  1502. <PARA>
  1503. <REPLACEABLE CLASS="PARAMETER">whence</REPLACEABLE> 
  1504. can be "SEEK_CUR", "SEEK_END", or "SEEK_SET".
  1505. </PARA>
  1506. </REFSECT1>
  1507. </REFENTRY>
  1508. <!-- ********************************************************** -->
  1509. <REFENTRY ID="PGTCL-PGLOTELL">
  1510. <REFMETA>
  1511. <REFENTRYTITLE>pg_lo_tell</REFENTRYTITLE>
  1512. <REFMISCINFO>PGTCL - Large Objects</REFMISCINFO>
  1513. </REFMETA>
  1514. <REFNAMEDIV>
  1515. <REFNAME>pg_lo_tell
  1516. </REFNAME>
  1517. <REFPURPOSE>return the current seek position of a large object
  1518. </REFPURPOSE>
  1519. <INDEXTERM ID="IX-PGTCL-PGLOTELL-1"><PRIMARY>pgtcl</PRIMARY><SECONDARY>positioning</SECONDARY></INDEXTERM>
  1520. <INDEXTERM ID="IX-PGTCL-PGLOTELL-2"><PRIMARY>pg_lo_tell</PRIMARY></INDEXTERM>
  1521. </REFNAMEDIV>
  1522. <REFSYNOPSISDIV>
  1523. <REFSYNOPSISDIVINFO>
  1524. <DATE>1997-12-24</DATE>
  1525. </REFSYNOPSISDIVINFO>
  1526. <SYNOPSIS>
  1527. pg_lo_tell <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">fd</REPLACEABLE>
  1528. </SYNOPSIS>
  1529. <REFSECT2 ID="R2-PGTCL-PGLOTELL-1">
  1530. <REFSECT2INFO>
  1531. <DATE>1997-12-24</DATE>
  1532. </REFSECT2INFO>
  1533. <TITLE>Inputs
  1534. </TITLE>
  1535. <VARIABLELIST>
  1536. <VARLISTENTRY>
  1537. <TERM>
  1538.   <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE>
  1539. </TERM>
  1540. <LISTITEM>
  1541. <PARA>Specifies a valid database connection.
  1542. </PARA>
  1543. </LISTITEM>
  1544. </VARLISTENTRY>
  1545. <VARLISTENTRY>
  1546. <TERM>
  1547.   <REPLACEABLE CLASS="PARAMETER">fd</REPLACEABLE>
  1548. </TERM>
  1549. <LISTITEM>
  1550. <PARA>
  1551. File descriptor for the large object from pg_lo_open.
  1552. </PARA>
  1553. </LISTITEM>
  1554. </VARLISTENTRY>
  1555. </VARIABLELIST>
  1556. </REFSECT2>
  1557. <REFSECT2 ID="R2-PGTCL-PGLOTELL-2">
  1558. <REFSECT2INFO>
  1559. <DATE>1997-12-24</DATE>
  1560. </REFSECT2INFO>
  1561. <TITLE>Outputs
  1562. </TITLE>
  1563. <VARIABLELIST>
  1564. <VARLISTENTRY>
  1565. <TERM>
  1566.   <REPLACEABLE CLASS="PARAMETER">offset</REPLACEABLE>
  1567. </TERM>
  1568. <LISTITEM>
  1569. <PARA>A zero-based offset in bytes suitable for input to <Function>pg_lo_lseek</Function>.
  1570. </PARA>
  1571. </LISTITEM>
  1572. </VARLISTENTRY>
  1573. </VARIABLELIST>
  1574. </REFSECT2>
  1575. </REFSYNOPSISDIV>
  1576. <REFSECT1 ID="R1-PGTCL-PGLOTELL-1">
  1577. <REFSECT1INFO>
  1578. <DATE>1997-12-24</DATE>
  1579. </REFSECT1INFO>
  1580. <TITLE>Description
  1581. </TITLE>
  1582. <PARA><FUNCTION>pg_lo_tell</FUNCTION> returns the current
  1583. to <REPLACEABLE CLASS="PARAMETER">offset</REPLACEABLE> in bytes from the beginning of the large object.
  1584. </PARA>
  1585. </REFSECT1>
  1586. <REFSECT1 ID="R1-PGTCL-PGLOTELL-2">
  1587. <TITLE>Usage
  1588. </TITLE>
  1589. <PARA>
  1590. </PARA>
  1591. </REFSECT1>
  1592. </REFENTRY>
  1593. <!-- ********************************************************** -->
  1594. <REFENTRY ID="PGTCL-PGLOUNLINK">
  1595. <REFMETA>
  1596. <REFENTRYTITLE>pg_lo_unlink</REFENTRYTITLE>
  1597. <REFMISCINFO>PGTCL - Large Objects</REFMISCINFO>
  1598. </REFMETA>
  1599. <REFNAMEDIV>
  1600. <REFNAME>pg_lo_unlink
  1601. </REFNAME>
  1602. <REFPURPOSE>delete a large object
  1603. </REFPURPOSE>
  1604. <INDEXTERM ID="IX-PGTCL-PGLOUNLINK-1"><PRIMARY>pgtcl</PRIMARY><SECONDARY>delete</SECONDARY></INDEXTERM>
  1605. <INDEXTERM ID="IX-PGTCL-PGLOUNLINK-2"><PRIMARY>pg_lo_unlink</PRIMARY></INDEXTERM>
  1606. </REFNAMEDIV>
  1607. <REFSYNOPSISDIV>
  1608. <REFSYNOPSISDIVINFO>
  1609. <DATE>1997-12-24</DATE>
  1610. </REFSYNOPSISDIVINFO>
  1611. <SYNOPSIS>
  1612. pg_lo_unlink <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">lobjId</REPLACEABLE>
  1613. </SYNOPSIS>
  1614. <REFSECT2 ID="R2-PGTCL-PGLOUNLINK-1">
  1615. <REFSECT2INFO>
  1616. <DATE>1997-12-24</DATE>
  1617. </REFSECT2INFO>
  1618. <TITLE>Inputs
  1619. </TITLE>
  1620. <VARIABLELIST>
  1621. <VARLISTENTRY>
  1622. <TERM>
  1623.   <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE>
  1624. </TERM>
  1625. <LISTITEM>
  1626. <PARA>Specifies a valid database connection.
  1627. </PARA>
  1628. </LISTITEM>
  1629. </VARLISTENTRY>
  1630. <VARLISTENTRY>
  1631. <TERM>
  1632.   <REPLACEABLE CLASS="PARAMETER">lobjId</REPLACEABLE>
  1633. </TERM>
  1634. <LISTITEM>
  1635. <PARA>
  1636. Identifier for a large object.
  1637. XXX Is this the same as objOid in other calls?? - thomas 1998-01-11
  1638. </PARA>
  1639. </LISTITEM>
  1640. </VARLISTENTRY>
  1641. </VARIABLELIST>
  1642. </REFSECT2>
  1643. <REFSECT2 ID="R2-PGTCL-PGLOUNLINK-2">
  1644. <REFSECT2INFO>
  1645. <DATE>1997-12-24</DATE>
  1646. </REFSECT2INFO>
  1647. <TITLE>Outputs
  1648. </TITLE>
  1649. <PARA>
  1650. None
  1651. </PARA>
  1652. </REFSECT2>
  1653. </REFSYNOPSISDIV>
  1654. <REFSECT1 ID="R1-PGTCL-PGLOUNLINK-1">
  1655. <REFSECT1INFO>
  1656. <DATE>1997-12-24</DATE>
  1657. </REFSECT1INFO>
  1658. <TITLE>Description
  1659. </TITLE>
  1660. <PARA><FUNCTION>pg_lo_unlink</FUNCTION> deletes the specified large object.
  1661. </PARA>
  1662. </REFSECT1>
  1663. <REFSECT1 ID="R1-PGTCL-PGLOUNLINK-2">
  1664. <TITLE>Usage
  1665. </TITLE>
  1666. <PARA>
  1667. </PARA>
  1668. </REFSECT1>
  1669. </REFENTRY>
  1670. <!-- ********************************************************** -->
  1671. <REFENTRY ID="PGTCL-PGLOIMPORT">
  1672. <REFMETA>
  1673. <REFENTRYTITLE>pg_lo_import</REFENTRYTITLE>
  1674. <REFMISCINFO>PGTCL - Large Objects</REFMISCINFO>
  1675. </REFMETA>
  1676. <REFNAMEDIV>
  1677. <REFNAME>pg_lo_import
  1678. </REFNAME>
  1679. <REFPURPOSE>import a large object from a Unix file
  1680. </REFPURPOSE>
  1681. <INDEXTERM ID="IX-PGTCL-PGLOIMPORT-1"><PRIMARY>pgtcl</PRIMARY><SECONDARY>import</SECONDARY></INDEXTERM>
  1682. <INDEXTERM ID="IX-PGTCL-PGLOIMPORT-2"><PRIMARY>pg_lo_import</PRIMARY></INDEXTERM>
  1683. </REFNAMEDIV>
  1684. <REFSYNOPSISDIV>
  1685. <REFSYNOPSISDIVINFO>
  1686. <DATE>1997-12-24</DATE>
  1687. </REFSYNOPSISDIVINFO>
  1688. <SYNOPSIS>
  1689. pg_lo_import <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">filename</REPLACEABLE>
  1690. </SYNOPSIS>
  1691. <REFSECT2 ID="R2-PGTCL-PGLOIMPORT-1">
  1692. <REFSECT2INFO>
  1693. <DATE>1997-12-24</DATE>
  1694. </REFSECT2INFO>
  1695. <TITLE>Inputs
  1696. </TITLE>
  1697. <VARIABLELIST>
  1698. <VARLISTENTRY>
  1699. <TERM>
  1700.   <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE>
  1701. </TERM>
  1702. <LISTITEM>
  1703. <PARA>Specifies a valid database connection.
  1704. </PARA>
  1705. </LISTITEM>
  1706. </VARLISTENTRY>
  1707. <VARLISTENTRY>
  1708. <TERM>
  1709.   <REPLACEABLE CLASS="PARAMETER">filename</REPLACEABLE>
  1710. </TERM>
  1711. <LISTITEM>
  1712. <PARA>
  1713. Unix file name.
  1714. </PARA>
  1715. </LISTITEM>
  1716. </VARLISTENTRY>
  1717. </VARIABLELIST>
  1718. </REFSECT2>
  1719. <REFSECT2 ID="R2-PGTCL-PGLOIMPORT-2">
  1720. <REFSECT2INFO>
  1721. <DATE>1997-12-24</DATE>
  1722. </REFSECT2INFO>
  1723. <TITLE>Outputs
  1724. </TITLE>
  1725. <PARA>
  1726. None
  1727. XXX Does this return a lobjId? Is that the same as the objOid in other calls? thomas - 1998-01-11
  1728. </PARA>
  1729. </REFSECT2>
  1730. </REFSYNOPSISDIV>
  1731. <REFSECT1 ID="R1-PGTCL-PGLOIMPORT-1">
  1732. <REFSECT1INFO>
  1733. <DATE>1997-12-24</DATE>
  1734. </REFSECT1INFO>
  1735. <TITLE>Description
  1736. </TITLE>
  1737. <PARA><FUNCTION>pg_lo_import</FUNCTION> reads the specified file and places the contents into a large object.
  1738. </PARA>
  1739. </REFSECT1>
  1740. <REFSECT1 ID="R1-PGTCL-PGLOIMPORT-2">
  1741. <TITLE>Usage
  1742. </TITLE>
  1743. <PARA>
  1744.   <Function>pg_lo_import</Function> must be called within a BEGIN/END transaction block.
  1745. </PARA>
  1746. </REFSECT1>
  1747. </REFENTRY>
  1748. <!-- ********************************************************** -->
  1749. <REFENTRY ID="PGTCL-PGLOEXPORT">
  1750. <REFMETA>
  1751. <REFENTRYTITLE>pg_lo_export</REFENTRYTITLE>
  1752. <REFMISCINFO>PGTCL - Large Objects</REFMISCINFO>
  1753. </REFMETA>
  1754. <REFNAMEDIV>
  1755. <REFNAME>pg_lo_export
  1756. </REFNAME>
  1757. <REFPURPOSE>export a large object to a Unix file
  1758. </REFPURPOSE>
  1759. <INDEXTERM ID="IX-PGTCL-PGLOEXPORT-1"><PRIMARY>pgtcl</PRIMARY><SECONDARY>export</SECONDARY></INDEXTERM>
  1760. <INDEXTERM ID="IX-PGTCL-PGLOEXPORT-2"><PRIMARY>pg_lo_export</PRIMARY></INDEXTERM>
  1761. </REFNAMEDIV>
  1762. <REFSYNOPSISDIV>
  1763. <REFSYNOPSISDIVINFO>
  1764. <DATE>1997-12-24</DATE>
  1765. </REFSYNOPSISDIVINFO>
  1766. <SYNOPSIS>
  1767. pg_lo_export <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">lobjId</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">filename</REPLACEABLE>
  1768. </SYNOPSIS>
  1769. <REFSECT2 ID="R2-PGTCL-PGLOEXPORT-1">
  1770. <REFSECT2INFO>
  1771. <DATE>1997-12-24</DATE>
  1772. </REFSECT2INFO>
  1773. <TITLE>Inputs
  1774. </TITLE>
  1775. <VARIABLELIST>
  1776. <VARLISTENTRY>
  1777. <TERM>
  1778.   <REPLACEABLE CLASS="PARAMETER">conn</REPLACEABLE>
  1779. </TERM>
  1780. <LISTITEM>
  1781. <PARA>Specifies a valid database connection.
  1782. </PARA>
  1783. </LISTITEM>
  1784. </VARLISTENTRY>
  1785. <VARLISTENTRY>
  1786. <TERM>
  1787.   <REPLACEABLE CLASS="PARAMETER">lobjId</REPLACEABLE>
  1788. </TERM>
  1789. <LISTITEM>
  1790. <PARA>
  1791. Large object identifier.
  1792. XXX Is this the same as the objOid in other calls?? thomas - 1998-01-11
  1793. </PARA>
  1794. </LISTITEM>
  1795. </VARLISTENTRY>
  1796. <VARLISTENTRY>
  1797. <TERM>
  1798.   <REPLACEABLE CLASS="PARAMETER">filename</REPLACEABLE>
  1799. </TERM>
  1800. <LISTITEM>
  1801. <PARA>
  1802. Unix file name.
  1803. </PARA>
  1804. </LISTITEM>
  1805. </VARLISTENTRY>
  1806. </VARIABLELIST>
  1807. </REFSECT2>
  1808. <REFSECT2 ID="R2-PGTCL-PGLOEXPORT-2">
  1809. <REFSECT2INFO>
  1810. <DATE>1997-12-24</DATE>
  1811. </REFSECT2INFO>
  1812. <TITLE>Outputs
  1813. </TITLE>
  1814. <PARA>
  1815. None
  1816. XXX Does this return a lobjId? Is that the same as the objOid in other calls? thomas - 1998-01-11
  1817. </PARA>
  1818. </REFSECT2>
  1819. </REFSYNOPSISDIV>
  1820. <REFSECT1 ID="R1-PGTCL-PGLOEXPORT-1">
  1821. <REFSECT1INFO>
  1822. <DATE>1997-12-24</DATE>
  1823. </REFSECT1INFO>
  1824. <TITLE>Description
  1825. </TITLE>
  1826. <PARA><FUNCTION>pg_lo_export</FUNCTION> writes the specified large object into a Unix file.
  1827. </PARA>
  1828. </REFSECT1>
  1829. <REFSECT1 ID="R1-PGTCL-PGLOEXPORT-2">
  1830. <TITLE>Usage
  1831. </TITLE>
  1832. <PARA>
  1833.   <Function>pg_lo_export</Function> must be called within a BEGIN/END transaction block.
  1834. </PARA>
  1835. </REFSECT1>
  1836. </REFENTRY>
  1837. </Sect1>
  1838. </Chapter>