public inbox for [email protected]
help / color / mirror / Atom feedRe: SELECT'ing a function call
2+ messages / 2 participants
[nested] [flat]
* Re: SELECT'ing a function call
@ 1970-01-01 00:00 omid omoomi <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: omid omoomi @ 1970-01-01 00:00 UTC (permalink / raw)
To: [email protected]; pgsql-general
Command: create rule
Description: define a new rule
Syntax:
CREATE RULE rule_name AS ON
{ SELECT | UPDATE | DELETE | INSERT }
TO object [WHERE qual]
DO [INSTEAD] [action|NOTHING|[actions]];
HTH
Omid
>From: "Jared H. Hudson" <[email protected]>
>To: <[email protected]>
>Subject: [GENERAL] SELECT'ing a function call
>Date: Fri, 6 Jul 2001 12:25:21 -0500
>
>
>I would like to be able to define a table with 1 column containing user
>names,
>and the next column being a dynamically generating function that returns a
>user's quota.
>
>I think I see how to create the shared object, and the SQL function. But,
>how
>do I create a table that uses a function for a column based on the value of
>another
>column.
>
>For example, I tried:
>
>CREATE TABLE test (
> num1 INTEGER,
> num2 INTEGER DEFAULT add_one('num1')
>);
>
>But that said that pg_atoi doesn't understand num1 -- so apprenting atoi is
>interpreting
>num1 as a string, so I tried ...DEFAULT add_one(num1) which gave a
>different
>error.
>
>Is this even possible? To have a "trigger" based on a select statement. I
>looked at the SQL
>TRIGGER command and it seems to only work for INSERT, UPDATE and DELETE. I
>need a "trigger"
>for SELECT's.
>
>Thanks,
>Jared H.
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
>http://www.postgresql.org/users-lounge/docs/faq.html
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
^ permalink raw reply [nested|flat] 2+ messages in thread
* SELECT'ing a function call
@ 2001-07-06 17:25 Jared H. Hudson <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Jared H. Hudson @ 2001-07-06 17:25 UTC (permalink / raw)
To: pgsql-general
I would like to be able to define a table with 1 column containing user
names,
and the next column being a dynamically generating function that returns a
user's quota.
I think I see how to create the shared object, and the SQL function. But,
how
do I create a table that uses a function for a column based on the value of
another
column.
For example, I tried:
CREATE TABLE test (
num1 INTEGER,
num2 INTEGER DEFAULT add_one('num1')
);
But that said that pg_atoi doesn't understand num1 -- so apprenting atoi is
interpreting
num1 as a string, so I tried ...DEFAULT add_one(num1) which gave a different
error.
Is this even possible? To have a "trigger" based on a select statement. I
looked at the SQL
TRIGGER command and it seems to only work for INSERT, UPDATE and DELETE. I
need a "trigger"
for SELECT's.
Thanks,
Jared H.
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-07-06 17:25 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1970-01-01 00:00 Re: SELECT'ing a function call omid omoomi <[email protected]>
2001-07-06 17:25 SELECT'ing a function call Jared H. Hudson <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox