From:
Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To:
Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc:
Petr Jelínek <pjmodos(at)pjmodos(dot)net>, Greg Smith <greg(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Subject:
Re: review: CHECK FUNCTION statement
Date:
2012-02-29 18:53:03
Message-ID:
1330540994-sup-4309@alvh.no-ip.org (view raw or flat )
Thread:
2011-11-26 08:51:17 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-11-29 12:17:01 from "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
2011-11-29 14:21:55 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-11-29 17:15:26 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-11-29 17:37:24 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-11-29 18:38:28 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2011-11-29 19:37:15 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-11-29 19:38:06 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-11-30 15:23:16 from "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
2011-11-30 15:53:42 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-11-30 16:03:59 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-11-30 16:13:58 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-11-30 16:09:13 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2011-11-30 16:14:25 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-11-30 16:19:05 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-11-30 16:39:13 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-11-30 16:58:46 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-11-30 18:21:54 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-11-30 18:30:03 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-12-02 10:14:17 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2011-12-02 15:05:15 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-12-02 18:45:16 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-12-02 10:52:19 from "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
2011-12-02 20:33:00 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-12-02 20:47:02 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-12-03 11:02:13 from "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
2011-12-07 07:23:32 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-12-07 14:46:14 from "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
2011-12-07 15:17:59 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-12-07 15:30:50 from "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
2011-12-08 14:07:07 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-12-08 15:34:10 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-12-09 11:27:36 from "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
2011-12-09 14:35:12 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-12-09 16:02:19 from "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
2011-12-09 17:08:30 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-12-12 15:49:18 from "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
2011-12-12 15:55:35 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-12-13 10:01:27 from "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
2011-12-13 12:59:51 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-12-13 15:37:30 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-12-13 16:55:40 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-12-14 06:33:03 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-12-14 15:30:02 from "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
2011-12-14 20:52:08 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-12-15 09:38:55 from "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
2011-12-15 11:36:24 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-12-15 13:04:37 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-12-16 13:49:43 from "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
2011-12-16 18:49:48 from Greg Smith <greg(at)2ndQuadrant(dot)com>
2011-12-17 21:00:56 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-12-19 14:56:25 from Greg Smith <greg(at)2ndQuadrant(dot)com>
2011-12-19 15:47:25 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-01-01 12:01:08 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-01-03 11:08:37 from "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
2012-01-04 14:27:08 from "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
2012-01-29 13:20:00 from Petr Jelínek <pjmodos(at)pjmodos(dot)net>
2012-02-28 16:48:35 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-28 19:30:58 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-02-28 19:42:22 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-28 20:41:13 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-02-28 20:44:02 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-28 21:27:51 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-02-29 13:37:48 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-02-29 18:53:03 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-02-29 20:25:30 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-03-01 19:46:43 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-02 02:44:59 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-02 08:30:01 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-03-02 08:29:26 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-03-02 14:46:27 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-02 15:07:41 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-03-03 01:24:46 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-03 05:25:52 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-03-03 05:45:06 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-03-03 06:01:45 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-03 06:03:25 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-03-03 19:54:19 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-03 20:56:23 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-03 23:13:04 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-04 19:33:08 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-03-05 02:54:36 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-05 13:49:01 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-03-05 16:02:50 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-03-05 18:11:41 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-06 06:43:06 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-03-06 13:21:28 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-03-06 14:12:57 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-03-06 21:52:21 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-03-07 05:35:06 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-03-07 15:55:12 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-03-03 13:26:04 from Petr Jelínek <pjmodos(at)pjmodos(dot)net>
2012-03-03 19:42:47 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2011-12-17 20:37:36 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-12-17 21:25:02 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-11-30 16:06:02 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2011-11-30 18:34:07 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2012-08-17 01:08:00 from Bruce Momjian <bruce(at)momjian(dot)us>
2012-08-17 03:51:35 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Lists:
pgsql-hackers
I think the way we're passing down the options to the checker is a bit
of a mess. The way it is formulated, it seems to me that we'd need to
add support code in the core CheckFunction for each option we might want
to accept in the PL-specific checkers -- including what type of value
the option receives. As an example, right now we have all but one
option taking a string argument (judging from usage of defGetString());
however, option fatal_errors takes a boolean value, and it converts to
string "on" or "off" which is supposed to be passed down to the checker.
This doesn't seem very future-proof.
(Also, the patch seems to be passing the fatal_errors value twice: first
in the options array, where it is ignored by the plpgsql checker, and a
second time as a separate boolean option. This needs a cleanup).
I don't see any good way to pass down generic options in a generic way.
Maybe we can just state that all option values are going to be passed as
strings -- is that good enough? The other option would be to pass them
using something like pg_node_tree, but then it wouldn't be possible to
call the checker directly instead of through CHECK FUNCTION, which I
think was a requirement. And it'd be a stronger argument against usage
of SPI to call the checker function from CHECK FUNCTION, but that's an
unsolved problem.
--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
In response to
Responses
pgsql-hackers by date
Next :From: Robert HaasDate: 2012-02-29 19:02:42
Subject : Re: Parameterized-path cost comparisons need some work
Previous :From : Tom LaneDate : 2012-02-29 18:40:05
Subject : Re: Parameterized-path cost comparisons need some work