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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12720
52ca082757c2 Update copyright notices.
i7tiol
parents: 12019
diff changeset
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
dafee4563c36 Return information on column types.
i7tiol
parents: 11697
diff changeset
74 ## correspond to returned tuples), @code{columns} (containing the column
dafee4563c36 Return information on column types.
i7tiol
parents: 11697
diff changeset
75 ## headers), and @code{types} (a structure-vector with the postgresql
dafee4563c36 Return information on column types.
i7tiol
parents: 11697
diff changeset
76 ## data types of the columns, subfields @code{name} (string with
dafee4563c36 Return information on column types.
i7tiol
parents: 11697
diff changeset
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
f4c52c68f744 Added converters for types uuid and xml.
i7tiol
parents: 11710
diff changeset
89 ## variable. As long as the Postgresql type is deduced correctly or is
f4c52c68f744 Added converters for types uuid and xml.
i7tiol
parents: 11710
diff changeset
90 ## user-specified, it is often sufficent to provide an Octave type that
f4c52c68f744 Added converters for types uuid and xml.
i7tiol
parents: 11710
diff changeset
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
1b4e81051b66 Add converter for timestamp.
i7tiol
parents: 11551
diff changeset
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
1b4e81051b66 Add converter for timestamp.
i7tiol
parents: 11551
diff changeset
156 ## @tab yes
11697
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
157 ## @item point
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
158 ## @tab geometric point data for one point (see below)
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
159 ## @tab no
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
160 ## @item lseg
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
161 ## @tab geometric point data for two points (see below)
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
162 ## @tab no
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
163 ## @item line (not yet implemented by postgresql-9.2.4)
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
164 ## @tab as lseg
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
165 ## @tab yes
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
166 ## @item box
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
167 ## @tab as lseg
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
168 ## @tab yes
11707
b8949643063c Correction in geometric point type documentation.
i7tiol
parents: 11706
diff changeset
169 ## @item circle
b8949643063c Correction in geometric point type documentation.
i7tiol
parents: 11706
diff changeset
170 ## @tab real vector (but the restrictions for type uint8 as in geometric
b8949643063c Correction in geometric point type documentation.
i7tiol
parents: 11706
diff changeset
171 ## element type apply, as explained below) with 3 elements, no. 1 and 2
b8949643063c Correction in geometric point type documentation.
i7tiol
parents: 11706
diff changeset
172 ## centre coordinates, no. 3 radius
11697
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
173 ## @tab no
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
174 ## @item polygon
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
175 ## @tab geometric point data (see below)
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
176 ## @tab yes
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
177 ## @item path
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
178 ## @tab structure with fields @code{closed} (boolean, is path closed?)
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
179 ## and @code{path} (geometric point data, see below).
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
180 ## @tab yes
11708
efca9c2a8a7e Added converters for network types.
i7tiol
parents: 11707
diff changeset
181 ## @item inet
efca9c2a8a7e Added converters for network types.
i7tiol
parents: 11707
diff changeset
182 ## @tab uint8 array of 4 or 5 elements for IPv4 or uint16 array of 8 or
efca9c2a8a7e Added converters for network types.
i7tiol
parents: 11707
diff changeset
183 ## 9 elements for IPv6. 5th or 9th element, respectively, contain number
efca9c2a8a7e Added converters for network types.
i7tiol
parents: 11707
diff changeset
184 ## of set bits in network mask, the default (if there are only 4 or 8
efca9c2a8a7e Added converters for network types.
i7tiol
parents: 11707
diff changeset
185 ## elements, respectively) is all bits set.
efca9c2a8a7e Added converters for network types.
i7tiol
parents: 11707
diff changeset
186 ## @tab yes
efca9c2a8a7e Added converters for network types.
i7tiol
parents: 11707
diff changeset
187 ## @item cidr
efca9c2a8a7e Added converters for network types.
i7tiol
parents: 11707
diff changeset
188 ## @tab as inet
efca9c2a8a7e Added converters for network types.
i7tiol
parents: 11707
diff changeset
189 ## @tab yes
efca9c2a8a7e Added converters for network types.
i7tiol
parents: 11707
diff changeset
190 ## @item macaddr
efca9c2a8a7e Added converters for network types.
i7tiol
parents: 11707
diff changeset
191 ## @tab uint8 array of 6 elements
efca9c2a8a7e Added converters for network types.
i7tiol
parents: 11707
diff changeset
192 ## @tab yes
11710
4f5471a9bce6 Added converters for bit string types.
i7tiol
parents: 11709
diff changeset
193 ## @item bit
4f5471a9bce6 Added converters for bit string types.
i7tiol
parents: 11709
diff changeset
194 ## @tab structure with fields @code{bitlen} (int32, number of valid
4f5471a9bce6 Added converters for bit string types.
i7tiol
parents: 11709
diff changeset
195 ## bits) and @code{bits} (uint8 array, 8 bits per entry, first entry
4f5471a9bce6 Added converters for bit string types.
i7tiol
parents: 11709
diff changeset
196 ## contains the leftmost bits, last entry may contain less than 8 bits)
4f5471a9bce6 Added converters for bit string types.
i7tiol
parents: 11709
diff changeset
197 ## @tab yes
4f5471a9bce6 Added converters for bit string types.
i7tiol
parents: 11709
diff changeset
198 ## @item varbit
4f5471a9bce6 Added converters for bit string types.
i7tiol
parents: 11709
diff changeset
199 ## @tab as bit
4f5471a9bce6 Added converters for bit string types.
i7tiol
parents: 11709
diff changeset
200 ## yes
11712
f4c52c68f744 Added converters for types uuid and xml.
i7tiol
parents: 11710
diff changeset
201 ## @item uuid
f4c52c68f744 Added converters for types uuid and xml.
i7tiol
parents: 11710
diff changeset
202 ## @tab uint8 array of 16 elements
f4c52c68f744 Added converters for types uuid and xml.
i7tiol
parents: 11710
diff changeset
203 ## @tab yes
f4c52c68f744 Added converters for types uuid and xml.
i7tiol
parents: 11710
diff changeset
204 ## @item xml
f4c52c68f744 Added converters for types uuid and xml.
i7tiol
parents: 11710
diff changeset
205 ## @tab string
f4c52c68f744 Added converters for types uuid and xml.
i7tiol
parents: 11710
diff changeset
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
1b4e81051b66 Add converter for timestamp.
i7tiol
parents: 11551
diff changeset
231 ## 8-byte-time-value: int64 scalar, representing microseconds, if server
1b4e81051b66 Add converter for timestamp.
i7tiol
parents: 11551
diff changeset
232 ## is configured for integer date/time; double scalar, representing
1b4e81051b66 Add converter for timestamp.
i7tiol
parents: 11551
diff changeset
233 ## seconds, if server is configured for float date/time (deprecated).
1b4e81051b66 Add converter for timestamp.
i7tiol
parents: 11551
diff changeset
234 ## There is no automatic conversion from an octave variable, an error is
1b4e81051b66 Add converter for timestamp.
i7tiol
parents: 11551
diff changeset
235 ## thrown if the wrong of both types is supplied. One can use
1b4e81051b66 Add converter for timestamp.
i7tiol
parents: 11551
diff changeset
236 ## @code{pq_conninfo} to query the respective server configuration.
1b4e81051b66 Add converter for timestamp.
i7tiol
parents: 11551
diff changeset
237 ##
11707
b8949643063c Correction in geometric point type documentation.
i7tiol
parents: 11706
diff changeset
238 ## geometric point data: any real array (but if of type uint8, the
b8949643063c Correction in geometric point type documentation.
i7tiol
parents: 11706
diff changeset
239 ## geometric type name must always be specified, for otherwise uint8
b8949643063c Correction in geometric point type documentation.
i7tiol
parents: 11706
diff changeset
240 ## would be considered as bytea) with even number of elements. Two
b8949643063c Correction in geometric point type documentation.
i7tiol
parents: 11706
diff changeset
241 ## adjacent elements (adjacent if indexed with a single index) define a
b8949643063c Correction in geometric point type documentation.
i7tiol
parents: 11706
diff changeset
242 ## pair of 2D point coordinates. In converting from postgresql data,
b8949643063c Correction in geometric point type documentation.
i7tiol
parents: 11706
diff changeset
243 ## dimensions of Octave geometric point data will be chosen to be (2,
b8949643063c Correction in geometric point type documentation.
i7tiol
parents: 11706
diff changeset
244 ## n_points) and elements will be of format double.
11697
9e624fa135a1 Added converters for geometric types.
i7tiol
parents: 11668
diff changeset
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
1b4e81051b66 Add converter for timestamp.
i7tiol
parents: 11551
diff changeset
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