ber 2009 19:16
To: Gordon Ross
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] PL/SQL & unset custom variable
Gordon Ross writes:
> Sorry, no joy :-(
> grails=> SELECT current_setting('phone.id');
> ERROR: unrecognized configuration parameter "phone.id"
Gordon Ross writes:
> Sorry, no joy :-(
> grails=> SELECT current_setting('phone.id');
> ERROR: unrecognized configuration parameter "phone.id"
> grails=> SELECT coalesce(current_setting('phone.id'),'SYSTEM');
> ERROR: unrecognized configuration parameter "phone.id"
You could use a SELECT fro
On 02/09/2009 15:39, "Andreas Kretschmer" wrote:
> Gordon Ross wrote:
>> Is there a way to either test if the custom variable is set, or to specify a
>> global default for the custom variable ?
>
> I think, you can use COALESCE(your_variable, default_value) to solve
> that problem. Try it, it is
Gordon Ross wrote:
> (I'm using Postgres 8.3)
>
> I have a trigger that references a custom variable. Most of the time this
> custom variable is set, and I have no problems.
>
> However, in certain corner cases the custom variable is not set and the
> trigger fails.
>
> Is there a way to eithe
(I'm using Postgres 8.3)
I have a trigger that references a custom variable. Most of the time this
custom variable is set, and I have no problems.
However, in certain corner cases the custom variable is not set and the
trigger fails.
Is there a way to either test if the custom variable is set, o
On Sat, Jun 20, 2009 at 4:01 PM, Pavel Stehule wrote:
>> *) misc:
>> *) never declare a function to return void
>
> ??? why - when we have not procedures ?
The main reason is that functions returning void can not be used with
binary protocol.
merlin
--
Sent via pgsql-general mailing list (pgsq
On Tuesday 16 June 2009 03:16:19 gvimrc wrote:
> I'm fairly new to PostgreSQL and completely new to using pl/pgsql though
> I've used MySQL's procedural language a little. I heard pl/pgsql is similar
> to Oracle's pl/sql so would it be possible, given that pl/pgsql literature
> is a bit thin on the
Hi
it is funny, so I found similar rules for developing plpgsql :)
>
> *) style:
> I suggest prefixing all local variables, including inputs to and
> outputs from functions. I prefix my variables with an underscore. If
> you neglect to do this you will end up having name clashes with your
> tab
On Sat, Jun 20, 2009 at 1:54 AM, Gurjeet Singh wrote:
> On Sat, Jun 20, 2009 at 10:52 AM, Jasen Betts wrote:
>>
>> On 2009-06-16, gvimrc wrote:
>> > I'm fairly new to PostgreSQL and completely new to using pl/pgsql
>> > though I've used MySQL's procedural language a little.
>> > I heard pl/pgsql
On Sat, Jun 20, 2009 at 10:52 AM, Jasen Betts wrote:
> On 2009-06-16, gvimrc wrote:
> > I'm fairly new to PostgreSQL and completely new to using pl/pgsql
> > though I've used MySQL's procedural language a little.
> > I heard pl/pgsql is similar to Oracle's pl/sql so would it be possible,
> > giv
On 2009-06-16, gvimrc wrote:
> I'm fairly new to PostgreSQL and completely new to using pl/pgsql
> though I've used MySQL's procedural language a little.
> I heard pl/pgsql is similar to Oracle's pl/sql so would it be possible,
> given that pl/pgsql literature is a bit thin on the ground, to use
Hello
documentation is very good
http://www.postgresql.org/docs/8.3/static/plpgsql.html
and some articles: http://www.postgres.cz/index.php/PL/pgSQL_%28en%29
regards
Pavel Stehule
2009/6/16 gvimrc :
> I'm fairly new to PostgreSQL and completely new to using pl/pgsql though
> I've used MySQL's p
I'm fairly new to PostgreSQL and completely new to using pl/pgsql though I've
used MySQL's procedural language a little. I heard pl/pgsql is similar to
Oracle's pl/sql so would it be possible, given that pl/pgsql literature is a
bit thin on the ground, to use books on pl/sql for developing pl/p
On 10/9/06, Michael Fuhr <[EMAIL PROTECTED]> wrote:
On Sun, Oct 08, 2006 at 05:49:11PM +0200, Jean-Gerard Pailloncy wrote:
> I try EXECUTE f || ' ( ' || p || ' );' INTO res
> But is does not work too.
> There is no function to convert double precision[] to text.
You could use the types' input an
Hi,
you may try;
execute 'select ' ||
f || '(' || p || ')' into res;
Merlin Moncure wrote, On 09.10.2006 16:35:
On 10/8/06, Jean-Gerard Pailloncy <[EMAIL PROTECTED]>
wrote:
I want to create a function in PL/SQL as
CREATE OR REPLACE FUNCTION "f_do" (text, double precision[]) RETURNS
On Sun, Oct 08, 2006 at 05:49:11PM +0200, Jean-Gerard Pailloncy wrote:
> I try EXECUTE f || ' ( ' || p || ' );' INTO res
> But is does not work too.
> There is no function to convert double precision[] to text.
You could use the types' input and output functions or perhaps
array_to_string().
stmt
On 10/8/06, Jean-Gerard Pailloncy <[EMAIL PROTECTED]> wrote:
I want to create a function in PL/SQL as
CREATE OR REPLACE FUNCTION "f_do" (text, double precision[]) RETURNS
double precision AS '
DECLARE
f text := $1;
p double precision[] := $2;
res double precision;
BEGIN
SELECT
On Sun, Oct 08, 2006 at 05:49:11PM +0200, Jean-Gerard Pailloncy wrote:
> I want to create a function in PL/SQL as
> CREATE OR REPLACE FUNCTION "f_do" (text, double precision[]) RETURNS
> double precision AS '
> DECLARE
> f text := $1;
> p double precision[] := $2;
> res double precisi
I want to create a function in PL/SQL as
CREATE OR REPLACE FUNCTION "f_do" (text, double precision[]) RETURNS
double precision AS '
DECLARE
f text := $1;
p double precision[] := $2;
res double precision;
BEGIN
SELECT f(p) into res;
RETURN res;
END;' LANGUAGE "plpgsql"
STABLE
Hi,
I would to know if there is some libraries with general algorithm for
Optimum search.
Exemple: I have some function
res := error_estimate(x real, y real, z real, t real)
I wrote a function that
set of res := iterate(nb_iteration, start_x real, step_x real,
that return a
res := ROW(b
I need to convert hundreds of Oracle stored procs across several
developing databases. I'm focusing on scripting as much of this as
possible, and I'm currently stuck on converting PL/SQL's NO_DATA_FOUND
behavior. What approaches have other people used? I'm targeting
PostgreSQL 8.1.
The problem
Shaun Clements wrote:
Hi
Hate to ask, but it isnt obvious to me from the documentation.
How do I perform a query in pgplsql, to check it a table exists of a
particular name.
Thanks in advance
Kind Regards,
Shaun Clements
-- A list of tables:
SELECT schemaname, tablename FROM pg_tables;
-- Returns t
Title: RE: [GENERAL] pl sql to check if table of table_name exists
Hi
Sim
Thanks for your input.
Kind Regards,Shaun
Clements
-Original
Message-From: Sim Zacks
[mailto:[EMAIL PROTECTED]Sent: 10 March 2005 02:47 PMTo:
pgsql-general@postgresql.orgSubject: Re: [GENERAL] pl sql
Title: RE: [GENERAL] pl sql to check if table of table_name exists
I'm glad to hear you got it working.
In explanation to my response:
the pg_class internal table lists all the
relationships in the database.
relkind='r' means that the relation you are looking
for is a tabl
Title: RE: [GENERAL] pl sql to check if table of table_name exists
Hi
Sim
Thanks for your response. I had it working from a
previous post by Adam Tomjack.
-- A list of tables:
SELECT schemaname, tablename FROM pg_tables;
-- Returns true if a table exists:
SELECT count(*)>0 FROM pg_tab
Title: RE: [GENERAL] pl sql to check if table of table_name exists
i mean
select * from pg_class where relkind='r' and
relname=your_tablename
"Sim Zacks" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
select your_tablename from pg
Title: RE: [GENERAL] pl sql to check if table of table_name exists
select your_tablename from pg_class where
relkind='r'
"Shaun Clements" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]...
Hi
Hate to ask, but it isnt obvious to me from the
Shaun Clements wrote:
Hi
Hate to ask, but it isnt obvious to me from the documentation.
How do I perform a query in pgplsql, to check it a table exists of a
particular name.
Check the manual. There are two ways to d othis. You could query the
data catalogs directly (something like count(*) fro
Title: RE: [GENERAL] pl sql to check if table of table_name exists
Much appreciated.
Thanks
Kind Regards,
Shaun Clements
-Original Message-
From: Adam Tomjack [mailto:[EMAIL PROTECTED]]
Sent: 10 March 2005 11:04 AM
To: Shaun Clements
Cc: postgresql
Subject: Re: [GENERAL] pl sql to
Title: RE: [GENERAL] pl sql to check if table of table_name exists
Hi
Hate to ask, but it isnt obvious to me from the documentation.
How do I perform a query in pgplsql, to check it a table exists of a particular name.
Thanks in advance
Kind Regards,
Shaun Clements
> In fact the problem seems to come from the "INSERT INTO". I delete
> everything from the function and only keep the "INSERT INTO" and get the
> same problem.
Given that this is supposed to be a trigger function, what's
your 'create trigger' statement look like?
Part of the problem may be
On Wed, 21 Apr 2004, Froggy / Froggy Corp. wrote:
> In fact the problem seems to come from the "INSERT INTO". I delete
> everything from the function and only keep the "INSERT INTO" and get the
> same problem.
A function like:
create function fz1() returns void as '
begin
INSERT INTO cate
Hello,
In fact the problem seems to come from the "INSERT INTO". I delete
everything from the function and only keep the "INSERT INTO" and get the
same problem.
Thx in advance for answers,
regards,
Stephan Szabo wrote:
>
> On Tue, 20 Apr 2004, Froggy / Froggy Corp. wrote:
>
> > I
Hello everyone,
I try to see if i can make a recursive function with a trigger set on
INSERT and doing an insert under my trigger function.
So i wrote a test function :
CREATE OR REPLACE FUNCTION testfunc() RETURNS SETOF RECORD AS '
DECLARE
use_t RECORD;
BEGIN
When would pl/sql be of any real benifit to boost performance?
Or is it really only usefull for seperating code.
e.g. would it be of a better performance using pl/sql instead of
creating a view.
so rather then queiring multiple tables we create a view or use pl/sql.
-
35 matches
Mail list logo