Mercurial > forge
annotate main/database/inst/pq_exec_params.m @ 12720:52ca082757c2 octave-forge tip
Update copyright notices.
author | i7tiol |
---|---|
date | Sat, 27 Feb 2016 11:21:29 +0000 |
parents | b3dfecfecbf4 |
children |
rev | line source |
---|---|
12720 | 1 ## Copyright (C) 2013-2016 Olaf Till <i7tiol@t-online.de> |
11551
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
2 ## |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
3 ## This program is free software; you can redistribute it and/or modify it under |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
4 ## the terms of the GNU General Public License as published by the Free Software |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
5 ## Foundation; either version 3 of the License, or (at your option) any later |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
6 ## version. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
7 ## |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
8 ## This program is distributed in the hope that it will be useful, but WITHOUT |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
9 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
10 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
11 ## details. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
12 ## |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
13 ## You should have received a copy of the GNU General Public License along with |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
14 ## this program; if not, see <http://www.gnu.org/licenses/>. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
15 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
16 ## -*- texinfo -*- |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
17 ## @deftypefn {Function File} pq_exec_params (@var{connection}, @var{command}) |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
18 ## @deftypefnx {Loadable Function} pq_exec_params (@var{connection}, @var{command}, @var{params}) |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
19 ## @deftypefnx {Loadable Function} pq_exec_params (@var{connection}, @var{command}, @var{settings}) |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
20 ## @deftypefnx {Loadable Function} pq_exec_params (@var{connection}, @var{command}, @var{params}, @var{settings}) |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
21 ## |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
22 ## Sends the string @var{command}, which must contain a single SQL |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
23 ## command, over the connection @var{connection}. Parameters in |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
24 ## @var{command} can be replaced by $1, $2, etc and their values given |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
25 ## in the one-dimensional cell-array @var{params}. Parameters of |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
26 ## composite type sent this way must have their type defined in the |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
27 ## database. For typeconversions, the package maintains a notion of |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
28 ## defined types, which should be refreshed with @code{pq_update_types} |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
29 ## if types are defined or dropped after establishing the connection, or |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
30 ## if the schema search path changes. @var{settings} is a structure of |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
31 ## settings, it can be created by @code{setdbopts}. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
32 ## |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
33 ## Settings currently understood by @code{pq_exec_params}: |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
34 ## |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
35 ## @table @code |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
36 ## @item param_types |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
37 ## One-dimensional cell-array with type specifications for parameters in |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
38 ## @var{params}. If present, must have the same length as @var{params}. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
39 ## Entries may be empty if no specification is necessary (see below). |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
40 ## Type specifications are strings corresponding to the entries returned |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
41 ## by @code{SELECT typname FROM pg_type WHERE typarray != 0 OR typtype = |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
42 ## 'c';}, optionally having @code{[]} appended (without space) to |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
43 ## indicate an array. Type specifications can be schema-qualified, |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
44 ## otherwise they refer to the visible type with that name. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
45 ## @item copy_in_path, copy_out_path |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
46 ## Path to files at the client side for @code{copy from stdin} and |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
47 ## @code{copy to stdout}, respectively. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
48 ## @item copy_in_from_variable |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
49 ## Logical scalar, default @code{false}. If @code{true}, @code{copy from |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
50 ## stdin} uses data from an Octave variable instead of from a file. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
51 ## @item copy_in_data |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
52 ## 2-dimensional cell-array with columns of suitable type (see below) -- |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
53 ## will be used instead of a file as data for @code{copy from stdin} if |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
54 ## @code{copy_in_from_variable} is @code{true}. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
55 ## @item copy_in_types |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
56 ## If some columns in @code{copy_in_data} need a type specification (see |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
57 ## below), @code{copy_in_types} has to be set to a cell-array with type |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
58 ## specifications, with an entry (possibly empty) for each column. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
59 ## @item copy_in_with_oids |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
60 ## If you want to copy in with oids when using data from an Octave |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
61 ## variable, the first column of the data must contain the OIDs and |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
62 ## @code{copy_in_with_oids} has to be set to @code{true} (default |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
63 ## @code{false}); @code{with oids} should be specified together with |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
64 ## @code{copy from stdin} in the command, otherwise Postgresql will |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
65 ## ignore the copied oids. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
66 ## @end table |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
67 ## |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
68 ## There is no way to @code{copy to stdout} into an Octave variable, but |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
69 ## a @code{select} command can be used for this purpose. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
70 ## |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
71 ## For queries (commands potentially returning data), the output will be |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
72 ## a structure with fields @code{data} (containing a cell array with the |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
73 ## data, columns correspond to returned database columns, rows |
11699 | 74 ## correspond to returned tuples), @code{columns} (containing the column |
75 ## headers), and @code{types} (a structure-vector with the postgresql | |
76 ## data types of the columns, subfields @code{name} (string with | |
77 ## typename), @code{is_array} (boolean), @code{is_composite} (boolean), | |
11706
95b91d8c9ee2
Make returned type information recursive over composite type elements.
i7tiol
parents:
11699
diff
changeset
|
78 ## @code{is_enum} (boolean), and @code{elements} (if @code{is_composite |
95b91d8c9ee2
Make returned type information recursive over composite type elements.
i7tiol
parents:
11699
diff
changeset
|
79 ## == true}, structure-vector of element types, containing fields |
95b91d8c9ee2
Make returned type information recursive over composite type elements.
i7tiol
parents:
11699
diff
changeset
|
80 ## corresponding to those of @code{types})). For copy commands nothing |
95b91d8c9ee2
Make returned type information recursive over composite type elements.
i7tiol
parents:
11699
diff
changeset
|
81 ## is returned. For other commands, the output will be the number of |
95b91d8c9ee2
Make returned type information recursive over composite type elements.
i7tiol
parents:
11699
diff
changeset
|
82 ## affected rows in the database. |
11551
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
83 ## |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
84 ## Mapping of currently implemented Postgresql types to Octave types |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
85 ## |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
86 ## The last column indicates whether specification of type (see above) |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
87 ## is necessary for conversion from Octave type to Postgresql type, i.e. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
88 ## if Postgresql type is not deduced from the type of the Octave |
11712 | 89 ## variable. As long as the Postgresql type is deduced correctly or is |
90 ## user-specified, it is often sufficent to provide an Octave type that | |
91 ## can be converted to the Octave type given in the table. | |
11551
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
92 ## |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
93 ## @multitable {Postgresql} {Octave type blah blah blah blah blah} {Spec.} |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
94 ## @headitem Postgresql @tab Octave @tab Spec. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
95 ## @item bool |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
96 ## @tab logical scalar |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
97 ## @tab no |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
98 ## @item oid |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
99 ## @tab uint32 scalar |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
100 ## @tab no |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
101 ## @item float8 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
102 ## @tab double scalar |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
103 ## @tab no |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
104 ## @item float4 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
105 ## @tab single scalar |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
106 ## @tab no |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
107 ## @item text |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
108 ## @tab string |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
109 ## @tab no |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
110 ## @item varchar |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
111 ## @tab string |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
112 ## @tab yes |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
113 ## @item bpchar |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
114 ## @tab string |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
115 ## @tab yes |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
116 ## @item name |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
117 ## @tab string of length < @code{NAMEDATALEN} (often 64) |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
118 ## @tab yes |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
119 ## @item bytea |
11709
4f95e5c4a57a
Don't restrict bytea representation to be one-dimensional anymore.
i7tiol
parents:
11708
diff
changeset
|
120 ## @tab array of uint8, one-dimensional if converted from postgresql data |
11551
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
121 ## @tab no |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
122 ## @item int2 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
123 ## @tab int16 scalar |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
124 ## @tab no |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
125 ## @item int4 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
126 ## @tab int32 scalar |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
127 ## @tab no |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
128 ## @item int8 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
129 ## @tab int64 scalar |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
130 ## @tab no |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
131 ## @item money |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
132 ## @tab int64 scalar, which is 100 times the currency value to enable |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
133 ## storing the 'small currency' (e.g. Cent) fraction in the last two |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
134 ## digits |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
135 ## @tab yes |
11661 | 136 ## @item timestamp |
11668
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
137 ## @tab 8-byte-time-value (see below), positive or negative difference |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
138 ## to 2000-01-01 00:00 |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
139 ## @tab yes |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
140 ## @item timestamptz |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
141 ## @tab as timestamp |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
142 ## @tab yes |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
143 ## @item time |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
144 ## @tab 8-byte-time-value (see below) |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
145 ## @tab yes |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
146 ## @item timetz |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
147 ## @tab 2-element cell array with 8-byte-time-value (see below, time of |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
148 ## day) and int32 scalar (time zone in seconds, negative east of UTC) |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
149 ## @tab yes |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
150 ## @item date |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
151 ## @tab int32 scalar, positive or negative difference to 2000-01-01 |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
152 ## @tab yes |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
153 ## @item interval |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
154 ## @tab 3-element cell array with 8-byte-time-value (see below), int32 |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
155 ## (days), and int32 (months) |
11661 | 156 ## @tab yes |
11697 | 157 ## @item point |
158 ## @tab geometric point data for one point (see below) | |
159 ## @tab no | |
160 ## @item lseg | |
161 ## @tab geometric point data for two points (see below) | |
162 ## @tab no | |
163 ## @item line (not yet implemented by postgresql-9.2.4) | |
164 ## @tab as lseg | |
165 ## @tab yes | |
166 ## @item box | |
167 ## @tab as lseg | |
168 ## @tab yes | |
11707 | 169 ## @item circle |
170 ## @tab real vector (but the restrictions for type uint8 as in geometric | |
171 ## element type apply, as explained below) with 3 elements, no. 1 and 2 | |
172 ## centre coordinates, no. 3 radius | |
11697 | 173 ## @tab no |
174 ## @item polygon | |
175 ## @tab geometric point data (see below) | |
176 ## @tab yes | |
177 ## @item path | |
178 ## @tab structure with fields @code{closed} (boolean, is path closed?) | |
179 ## and @code{path} (geometric point data, see below). | |
180 ## @tab yes | |
11708 | 181 ## @item inet |
182 ## @tab uint8 array of 4 or 5 elements for IPv4 or uint16 array of 8 or | |
183 ## 9 elements for IPv6. 5th or 9th element, respectively, contain number | |
184 ## of set bits in network mask, the default (if there are only 4 or 8 | |
185 ## elements, respectively) is all bits set. | |
186 ## @tab yes | |
187 ## @item cidr | |
188 ## @tab as inet | |
189 ## @tab yes | |
190 ## @item macaddr | |
191 ## @tab uint8 array of 6 elements | |
192 ## @tab yes | |
11710 | 193 ## @item bit |
194 ## @tab structure with fields @code{bitlen} (int32, number of valid | |
195 ## bits) and @code{bits} (uint8 array, 8 bits per entry, first entry | |
196 ## contains the leftmost bits, last entry may contain less than 8 bits) | |
197 ## @tab yes | |
198 ## @item varbit | |
199 ## @tab as bit | |
200 ## yes | |
11712 | 201 ## @item uuid |
202 ## @tab uint8 array of 16 elements | |
203 ## @tab yes | |
204 ## @item xml | |
205 ## @tab string | |
206 ## @tab yes | |
11551
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
207 ## @item any array |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
208 ## @tab Structure with fields @code{data} (holding a cell-array with |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
209 ## entries of a type corresponding to the Postgresql element type), |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
210 ## @code{ndims} (holding the number of dimensions of the corresponding |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
211 ## Postgresql array, since this can not be deduced from the dimensions |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
212 ## of the Octave cell-array in all cases), and optionally (but always |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
213 ## present in returned values) @code{lbounds} (a row vector of |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
214 ## enumeration bases for all dimensions, default is @code{ones (1, |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
215 ## ndims)}, see Postgresql documentation). Array elements may not |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
216 ## correspond to arrays in Postgresql (use additional dimensions for |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
217 ## this), but may correspond to composite types, which is allowed to |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
218 ## lead to arbitrarily deep nesting. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
219 ## @tab yes |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
220 ## @item any composite type |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
221 ## @tab One-dimensional cell-array with entries of types corresponding |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
222 ## to the respective Postgresql types. Entries may also correspond to an |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
223 ## array-type or composite type; this is allowed to lead to arbitrarily |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
224 ## deep nesting. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
225 ## @tab yes |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
226 ## @item any enum type |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
227 ## @tab string |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
228 ## @tab yes |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
229 ## @end multitable |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
230 ## |
11661 | 231 ## 8-byte-time-value: int64 scalar, representing microseconds, if server |
232 ## is configured for integer date/time; double scalar, representing | |
233 ## seconds, if server is configured for float date/time (deprecated). | |
234 ## There is no automatic conversion from an octave variable, an error is | |
235 ## thrown if the wrong of both types is supplied. One can use | |
236 ## @code{pq_conninfo} to query the respective server configuration. | |
237 ## | |
11707 | 238 ## geometric point data: any real array (but if of type uint8, the |
239 ## geometric type name must always be specified, for otherwise uint8 | |
240 ## would be considered as bytea) with even number of elements. Two | |
241 ## adjacent elements (adjacent if indexed with a single index) define a | |
242 ## pair of 2D point coordinates. In converting from postgresql data, | |
243 ## dimensions of Octave geometric point data will be chosen to be (2, | |
244 ## n_points) and elements will be of format double. | |
11697 | 245 ## |
11551
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
246 ## Octaves @code{NA} corresponds to a Postgresql NULL value (not |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
247 ## @code{NaN}, which is interpreted as a value of a float type!). |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
248 ## |
11661 | 249 ## @seealso {pq_update_types, pq_conninfo} |
11551
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
250 ## @end deftypefn |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
251 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
252 ## PKG_ADD: __all_db_opts__ ("pq_exec_params"); |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
253 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
254 function ret = pq_exec_params (conn, varargin) |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
255 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
256 ## This wrapper is necessary to work around calling PKG_ADD |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
257 ## instructions of each added path immediately, before all paths of a |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
258 ## package are added. In 'pkg install', m-function path is set before |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
259 ## oct-function path, and left set, so this would work here. But in |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
260 ## 'pkg build', if the package is not already installed, these paths |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
261 ## are temporarily and separately set. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
262 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
263 if ((nargs = nargin) == 0) |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
264 print_usage (); |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
265 endif |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
266 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
267 if (nargs == 1 && ischar (conn) && strcmp (conn, "defaults")) |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
268 |
12019
b3dfecfecbf4
* tk_octave/inst/tk_dialog.m, tk_octave/inst/tk_scale.m,
jwe
parents:
11712
diff
changeset
|
269 ret = setdbopts ("param_types", [], ... |
b3dfecfecbf4
* tk_octave/inst/tk_dialog.m, tk_octave/inst/tk_scale.m,
jwe
parents:
11712
diff
changeset
|
270 "copy_in_path", "", ... |
b3dfecfecbf4
* tk_octave/inst/tk_dialog.m, tk_octave/inst/tk_scale.m,
jwe
parents:
11712
diff
changeset
|
271 "copy_out_path", "", ... |
b3dfecfecbf4
* tk_octave/inst/tk_dialog.m, tk_octave/inst/tk_scale.m,
jwe
parents:
11712
diff
changeset
|
272 "copy_in_data", [], ... |
b3dfecfecbf4
* tk_octave/inst/tk_dialog.m, tk_octave/inst/tk_scale.m,
jwe
parents:
11712
diff
changeset
|
273 "copy_in_with_oids", false, ... |
b3dfecfecbf4
* tk_octave/inst/tk_dialog.m, tk_octave/inst/tk_scale.m,
jwe
parents:
11712
diff
changeset
|
274 "copy_in_types", [], ... |
11551
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
275 "copy_in_from_variable", false); |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
276 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
277 else |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
278 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
279 t_ret = __pq_exec_params__ (conn, varargin{:}); |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
280 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
281 if (! ischar (t_ret)) ## marker for a copy command |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
282 ret = t_ret; |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
283 endif |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
284 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
285 endif |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
286 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
287 endfunction |