Re: Are globally defined constants possible at all ?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Gregory Seidman <gss+pg(at)cs(dot)brown(dot)edu>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Are globally defined constants possible at all ?
Date: 2002-06-09 18:42:34
Message-ID: 20020609113917.I59672-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> 3. create a function for each type and use it in your queries
>
> CREATE FUNCTION EnumTypeSoftware() RETURNS int AS 'SELECT 1' LANGUAGE SQL
> with (isstrict);
>
> CREATE FUNCTION EnumTypeHardware() RETURNS int AS 'SELECT 2' LANGUAGE SQL
> with (isstrict);

As a side note I didn't see mentioned, you might want to define those as
iscachable (and I'm not sure isstrict buys you anything for a function
with no args) to allow index scans to be used when you do col=func()
where clauses.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-06-09 20:35:40 Re: sort_mem sizing (Non-linear Performance)
Previous Message Gunther Schadow 2002-06-09 18:07:30 Re: Are globally defined constants possible at all ?