Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
array
Commits
2d87c04c76b2
Commit
8bf3d876
authored
Apr 08, 2013
by
Vincent Michel
Browse files
[schema] Add some Postgres functions
parent
43e2135ec62f
Changes
2
Hide whitespace changes
Inline
Side-by-side
schema/_regroc.postgres.sql
0 → 100644
View file @
2d87c04c
/* -*- sql -*-
postgres specific registered procedures,
require the plpgsql language installed
add the VALUE function to be able to query the postgres arrays
in RQL query, example below:
Any X WHERE X is TimeSerie, X serie S HAVING VALUE(S, 10)>3
*/
CREATE
OR
REPLACE
FUNCTION
VALUE
(
ar1
integer
[],
indice
integer
)
RETURNS
float
AS
$$
BEGIN
return
ar1
[
indice
];
END
;
$$
LANGUAGE
plpgsql
;
\ No newline at end of file
site_cubicweb.py
0 → 100644
View file @
2d87c04c
## from cubicweb.schema import CONSTRAINTS
## from cubes.postgis.schema import params
## CONSTRAINTS.update((v.__name__, v) for v in params.values())
from
logilab.database
import
FunctionDescr
from
rql.utils
import
register_function
class
VALUE
(
FunctionDescr
):
minargs
=
2
maxargs
=
2
supported_backends
=
(
'postgres'
,)
rtype
=
'Float'
register_function
(
VALUE
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment