Mercurial > forge
annotate main/database/inst/pq_exec_params.m @ 11708:efca9c2a8a7e octave-forge
Added converters for network types.
author | i7tiol |
---|---|
date | Sat, 18 May 2013 10:22:06 +0000 |
parents | b8949643063c |
children | 4f95e5c4a57a |
rev | line source |
---|---|
11551
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
1 ## Copyright (C) 2013 Olaf Till <i7tiol@t-online.de> |
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 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
89 ## variable. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
90 ## |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
91 ## @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
|
92 ## @headitem Postgresql @tab Octave @tab Spec. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
93 ## @item bool |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
94 ## @tab logical scalar |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
95 ## @tab no |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
96 ## @item oid |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
97 ## @tab uint32 scalar |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
98 ## @tab no |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
99 ## @item float8 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
100 ## @tab double scalar |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
101 ## @tab no |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
102 ## @item float4 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
103 ## @tab single scalar |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
104 ## @tab no |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
105 ## @item text |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
106 ## @tab string |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
107 ## @tab no |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
108 ## @item varchar |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
109 ## @tab string |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
110 ## @tab yes |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
111 ## @item bpchar |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
112 ## @tab string |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
113 ## @tab yes |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
114 ## @item name |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
115 ## @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
|
116 ## @tab yes |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
117 ## @item bytea |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
118 ## @tab one-dimensional array of uint8 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
119 ## @tab no |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
120 ## @item int2 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
121 ## @tab int16 scalar |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
122 ## @tab no |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
123 ## @item int4 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
124 ## @tab int32 scalar |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
125 ## @tab no |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
126 ## @item int8 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
127 ## @tab int64 scalar |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
128 ## @tab no |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
129 ## @item money |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
130 ## @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
|
131 ## 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
|
132 ## digits |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
133 ## @tab yes |
11661 | 134 ## @item timestamp |
11668
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
135 ## @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
|
136 ## to 2000-01-01 00:00 |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
137 ## @tab yes |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
138 ## @item timestamptz |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
139 ## @tab as timestamp |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
140 ## @tab yes |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
141 ## @item time |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
142 ## @tab 8-byte-time-value (see below) |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
143 ## @tab yes |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
144 ## @item timetz |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
145 ## @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
|
146 ## 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
|
147 ## @tab yes |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
148 ## @item date |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
149 ## @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
|
150 ## @tab yes |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
151 ## @item interval |
abd563353849
Added remaining date/time converters (time, timetz, date, interval).
i7tiol
parents:
11661
diff
changeset
|
152 ## @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
|
153 ## (days), and int32 (months) |
11661 | 154 ## @tab yes |
11697 | 155 ## @item point |
156 ## @tab geometric point data for one point (see below) | |
157 ## @tab no | |
158 ## @item lseg | |
159 ## @tab geometric point data for two points (see below) | |
160 ## @tab no | |
161 ## @item line (not yet implemented by postgresql-9.2.4) | |
162 ## @tab as lseg | |
163 ## @tab yes | |
164 ## @item box | |
165 ## @tab as lseg | |
166 ## @tab yes | |
11707 | 167 ## @item circle |
168 ## @tab real vector (but the restrictions for type uint8 as in geometric | |
169 ## element type apply, as explained below) with 3 elements, no. 1 and 2 | |
170 ## centre coordinates, no. 3 radius | |
11697 | 171 ## @tab no |
172 ## @item polygon | |
173 ## @tab geometric point data (see below) | |
174 ## @tab yes | |
175 ## @item path | |
176 ## @tab structure with fields @code{closed} (boolean, is path closed?) | |
177 ## and @code{path} (geometric point data, see below). | |
178 ## @tab yes | |
11708 | 179 ## @item inet |
180 ## @tab uint8 array of 4 or 5 elements for IPv4 or uint16 array of 8 or | |
181 ## 9 elements for IPv6. 5th or 9th element, respectively, contain number | |
182 ## of set bits in network mask, the default (if there are only 4 or 8 | |
183 ## elements, respectively) is all bits set. | |
184 ## @tab yes | |
185 ## @item cidr | |
186 ## @tab as inet | |
187 ## @tab yes | |
188 ## @item macaddr | |
189 ## @tab uint8 array of 6 elements | |
190 ## @tab yes | |
11551
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
191 ## @item any array |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
192 ## @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
|
193 ## 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
|
194 ## @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
|
195 ## 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
|
196 ## 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
|
197 ## 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
|
198 ## 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
|
199 ## 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
|
200 ## 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
|
201 ## 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
|
202 ## lead to arbitrarily deep nesting. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
203 ## @tab yes |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
204 ## @item any composite type |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
205 ## @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
|
206 ## 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
|
207 ## 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
|
208 ## deep nesting. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
209 ## @tab yes |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
210 ## @item any enum type |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
211 ## @tab string |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
212 ## @tab yes |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
213 ## @end multitable |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
214 ## |
11661 | 215 ## 8-byte-time-value: int64 scalar, representing microseconds, if server |
216 ## is configured for integer date/time; double scalar, representing | |
217 ## seconds, if server is configured for float date/time (deprecated). | |
218 ## There is no automatic conversion from an octave variable, an error is | |
219 ## thrown if the wrong of both types is supplied. One can use | |
220 ## @code{pq_conninfo} to query the respective server configuration. | |
221 ## | |
11707 | 222 ## geometric point data: any real array (but if of type uint8, the |
223 ## geometric type name must always be specified, for otherwise uint8 | |
224 ## would be considered as bytea) with even number of elements. Two | |
225 ## adjacent elements (adjacent if indexed with a single index) define a | |
226 ## pair of 2D point coordinates. In converting from postgresql data, | |
227 ## dimensions of Octave geometric point data will be chosen to be (2, | |
228 ## n_points) and elements will be of format double. | |
11697 | 229 ## |
11551
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
230 ## 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
|
231 ## @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
|
232 ## |
11661 | 233 ## @seealso {pq_update_types, pq_conninfo} |
11551
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
234 ## @end deftypefn |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
235 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
236 ## 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
|
237 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
238 function ret = pq_exec_params (conn, varargin) |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
239 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
240 ## 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
|
241 ## 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
|
242 ## 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
|
243 ## 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
|
244 ## '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
|
245 ## are temporarily and separately set. |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
246 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
247 if ((nargs = nargin) == 0) |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
248 print_usage (); |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
249 endif |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
250 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
251 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
|
252 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
253 ret = setdbopts ("param_types", [], \ |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
254 "copy_in_path", "", \ |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
255 "copy_out_path", "", \ |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
256 "copy_in_data", [], \ |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
257 "copy_in_with_oids", false, \ |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
258 "copy_in_types", [], \ |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
259 "copy_in_from_variable", false); |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
260 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
261 else |
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 t_ret = __pq_exec_params__ (conn, varargin{:}); |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
264 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
265 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
|
266 ret = t_ret; |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
267 endif |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
268 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
269 endif |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
270 |
7c0dae992c31
Work around path problem in package initialization. Fixes part of bug #38491.
i7tiol
parents:
diff
changeset
|
271 endfunction |