pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedUser defined functions through ODBC
2+ messages / 1 participants
[nested] [flat]
* User defined functions through ODBC
@ 1999-06-29 20:00 Hostmaster - Internet au Virtuel Inc. <hostmaster@virtuel.qc.ca>
0 siblings, 0 replies; 2+ messages in thread
From: Hostmaster - Internet au Virtuel Inc. @ 1999-06-29 20:00 UTC (permalink / raw)
To: pgsql-sql
Hi
I'm running PostgreSQL v6.4.2 on Red Hat Linux 6.0. I use it on a Windows NT
server 4.0 with service pack 5 through ODBC calls; the ODBC driver is the
one from Insight Distributions System, v6.40.00.06. The IP address of the NT
machine is specified as "trust" in pg_hba.conf.
I've been playing a bit with PL/pgSQL ... I find it quite usefull. But I
have one problem: The functions I create seem to be accessible only from
within the psql utility. When I try to run a query from the network, I get
an ODBC error stating that the function doesn't exist. Queries not involving
user-defined functions run fine.
Here is one of these functions:
create function plan_text(int2) returns text as '
begin
if $1 is null then
return ''10 hrs'';
end if;
if $1 <= 10 then
return ''10 hrs'';
end if;
if $1 <= 30 then
return ''30 hrs'';
end if;
if $1 <= 60 then
return ''60 hrs'';
end if;
return ''Illimité'';
end;
' language 'plpgsql';
So this query works from within psql:
SELECT hist_id, client_id, month, plan_text(plan) FROM history WHERE
client_id = 3;
But not through a network ODBC call. What am I missing? I created the user
"sql", and everything in this database is owned and operated with this uid.
I tried creating the function as the "postgres" superuser; I tried to
authenticate differently, but I get nothing.
If I use pgAdmin 6.4.3 beta, and have it list the functions, "plan_text"
appears in the list, but the query fails. Anyone has an idea?
Thanks,
Nicolas Cadou
^ permalink raw reply [nested|flat] 2+ messages in thread
* User defined functions through ODBC
@ 1999-06-30 17:07 Hostmaster - Internet au Virtuel Inc. <hostmaster@virtuel.qc.ca>
0 siblings, 0 replies; 2+ messages in thread
From: Hostmaster - Internet au Virtuel Inc. @ 1999-06-30 17:07 UTC (permalink / raw)
To: pgsql-sql
Hi
I'm running PostgreSQL v6.4.2 on Red Hat Linux 6.0. I use it on a Windows NT
server 4.0 with service pack 5 through ODBC calls; the ODBC driver is the
one from Insight Distributions System, v6.40.00.06. The IP address of the NT
machine is specified as "trust" in pg_hba.conf.
I've been playing a bit with PL/pgSQL ... I find it quite usefull. But I
have one problem: The functions I create seem to be accessible only from
within the psql utility. When I try to run a query from the network, I get
an ODBC error stating that the function doesn't exist. Queries not involving
user-defined functions run fine.
Here is one of these functions:
create function plan_text(int2) returns text as '
begin
if $1 is null then
return ''10 hrs'';
end if;
if $1 <= 10 then
return ''10 hrs'';
end if;
if $1 <= 30 then
return ''30 hrs'';
end if;
if $1 <= 60 then
return ''60 hrs'';
end if;
return ''Illimité'';
end;
' language 'plpgsql';
So this query works from within psql:
SELECT hist_id, client_id, month, plan_text(plan) FROM history WHERE
client_id = 3;
But not through a network ODBC call. What am I missing? I created the user
"sql", and everything in this database is owned and operated with this uid.
I tried creating the function as the "postgres" superuser; I tried to
authenticate differently, but I get nothing.
If I use pgAdmin 6.4.3 beta, and have it list the functions, "plan_text"
appears in the list, but the query fails. Anyone has an idea?
Thanks,
Nicolas Cadou
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1999-06-30 17:07 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-06-29 20:00 User defined functions through ODBC Hostmaster - Internet au Virtuel Inc. <hostmaster@virtuel.qc.ca>
1999-06-30 17:07 User defined functions through ODBC Hostmaster - Internet au Virtuel Inc. <hostmaster@virtuel.qc.ca>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox