The last part got scrambled, should read like this:
(...)
Use it like this:
SELECT * FROM foo WHERE foo_id > myval();
Or, for the case at hand, an example in sql:
CREATE FUNCTION my_colors()
RETURNS text[] AS
$$ SELECT ARRAY['red','green','blue'] $$
LANGUAGE 'sql' IMMUTABLE;
Use it like thi
On Jul 30, 10:53 pm, [EMAIL PROTECTED] ("Richard Broersma")
wrote:
> On Wed, Jul 30, 2008 at 1:16 PM, EXT-Rothermel, Peter M
> <[EMAIL PROTECTED]> wrote:
> > Is there any means like (#define or DECLARE ) where I can write SQL like
(...)
> CREATE VIEW primary_colors_foos AS
> SELECT * FROM foo
>
On Wed, Jul 30, 2008 at 1:16 PM, EXT-Rothermel, Peter M
<[EMAIL PROTECTED]> wrote:
> Is there any means like (#define or DECLARE ) where I can write SQL like
> this:
> CREATE VIEW primary_colors_foos AS
> SELECT * from foo WHERE ( color = FOO_COLOR_RED OR color =
> FOO_COLOR_BLUE OR color = FOO_
Let's say I have a table foo with a column color where the color column
is defined as an integer but in my application space is an enumeration:
Table "public.foo"
Column |Type | Modifiers
---+-