2012/3/5 Tom Lane :
> Pavel Stehule writes:
>> Hello
>> I found a plpgsql bug:
>
>> create or replace function fx()
>> returns void as $$
>> declare a int; b int;
>> begin
>> select 10,20 into a;
>> end;
>> $$ language plpgsql;
>
>> this is bug, or minimally potential source of strange behave.
>
Pavel Stehule writes:
> Hello
> I found a plpgsql bug:
> create or replace function fx()
> returns void as $$
> declare a int; b int;
> begin
> select 10,20 into a;
> end;
> $$ language plpgsql;
> this is bug, or minimally potential source of strange behave.
AFAICS this is intentional --- see
Hello
I found a plpgsql bug:
create or replace function fx()
returns void as $$
declare a int; b int;
begin
select 10,20 into a;
end;
$$ language plpgsql;
this is bug, or minimally potential source of strange behave.
Regards
Pavel Stehule
--
Sent via pgsql-bugs mailing list (pgsql-bugs@pos
ERROR: syntax error at or near "("
LINE 15:(row_main_table.subtype).flag := FALSE; -- cannot set
^
** Ошибка **
ERROR: syntax error at or near "("
SQL state: 42601
Характеристика:321
2008/12/10 Pavel Stehule <[EMAIL PROTECTED]>:
> Hello
>
> 2008/12/10 Ole
Hello
2008/12/10 Oleg Serov <[EMAIL PROTECTED]>:
> SQL:
> CREATE TABLE second_type (
>flag BOOLEAN
> );
> CREATE TABLE main_type (
>subtype second_type
> );
> CREATE OR REPLACE FUNCTION "bug_in_tabletypes" () RETURNS pg_catalog.void AS
> $body$
> DECLARE
>row_main_table mai
SQL:
CREATE TABLE second_type (
flag BOOLEAN
);
CREATE TABLE main_type (
subtype second_type
);
CREATE OR REPLACE FUNCTION "bug_in_tabletypes" () RETURNS pg_catalog.void AS
$body$
DECLARE
row_main_table main_type%rowtype;
BEGIN
row_main_table.subtype := NULL; -- all
Kris Jurka <[EMAIL PROTECTED]> writes:
> eKol in #postgresql reported a problem with a plpgsql function crashing
> the server. I tested the attached against 8.2cvs as of this morning
> and got this stacktrace:
> #0 plpgsql_xact_cb (event=XACT_EVENT_COMMIT, arg=0x0) at pl_exec.c:4521
I believe
Kris Jurka wrote:
>
> eKol in #postgresql reported a problem with a plpgsql function crashing
> the server. I tested the attached against 8.2cvs as of this morning
> and got this stacktrace:
Interesting. 8.1 also crashes. 8.0 instead gives this output:
psql:/home/alvherre/funcs.sql:86: ERRO
eKol in #postgresql reported a problem with a plpgsql function crashing
the server. I tested the attached against 8.2cvs as of this morning
and got this stacktrace:
#0 plpgsql_xact_cb (event=XACT_EVENT_COMMIT, arg=0x0) at pl_exec.c:4521
#1 0x0046f43d in CallXactCallbacks (event=XAC
On Thu, 2005-12-15 at 11:09 -0800, Jim Klo wrote:
> I’m having a similar problem:
>
> ERROR: relation with OID 7121526 does not exist
> CONTEXT: SQL statement "SELECT * INTO temp tmp_resourcequeue from
> resourcequeue where timeblockid in (select timeblockid from tmp_timeblock)"
> PL/pgSQL f
>Folks,> >I'd swear somebody committed a fix for the issue with temp tables inside >plpgsql functions, like, months ago. Yet I still get: >ERROR: relation with OID 16607 does not exist>CONTEXT: SQL statement "INSERT INTO tmp_runs ( run_id, batch, machine ) >VALUES ( NEXTVAL('runs_run_id_se
Josh Berkus writes:
> I'd swear somebody committed a fix for the issue with temp tables inside
> plpgsql functions, like, months ago.
Nope.
regards, tom lane
---(end of broadcast)---
TIP 5: don't forget to increase your fr
Folks,
I'd swear somebody committed a fix for the issue with temp tables inside
plpgsql functions, like, months ago. Yet I still get:
ERROR: relation with OID 16607 does not exist
CONTEXT: SQL statement "INSERT INTO tmp_runs ( run_id, batch, machine )
VALUES ( NEXTVAL('runs_run_id_seq'), $1
hello,we have a postgres in windows and linux operating systems, then the problemis in plpgsql functions, which is i created a function with exceptionhandling in postgres 8.0.1 (windows operating system) which handle theexceptions very well, but i created the same function in (postgres8.0.1)linux o
Neil Conway <[EMAIL PROTECTED]> writes:
>> (BTW, another thing this example exposes is that we don't issue warnings
>> about trivially-dead-code, such as statements in a basic block that
>> follow a RETURN. This would probably be also worth doing.)
> Attached is a patch that implements this. Spe
Neil Conway wrote:
(BTW, another thing this example exposes is that we don't issue warnings
about trivially-dead-code, such as statements in a basic block that
follow a RETURN. This would probably be also worth doing.)
Attached is a patch that implements this. Specifically, if there are any
stat
Neil Conway <[EMAIL PROTECTED]> writes:
> Tom Lane wrote:
>> Yeah, this has been on my to-do list for awhile...
> Ah, ok. Is this something you want to handle, or should I take a look?
Well, it's not *high* on my to-do list; feel free to take a look.
>> One question here is whether Oracle's PL/S
Tom Lane wrote:
Yeah, this has been on my to-do list for awhile...
Ah, ok. Is this something you want to handle, or should I take a look?
One question here is whether Oracle's PL/SQL has a
precedent, and if so which way does it point?
I did some limited testing of this, and it appears that PL/SQL's
Neil Conway <[EMAIL PROTECTED]> writes:
> ... One way to fix this would be to reimplement EXECUTE to
> be essentially `eval': it would take an arbitrary string and execute it
> as a PL/pgSQL statement. That would fix the FOUND problem, and also give
> us EXECUTE INTO in one fell swoop.
Yeah, this
On Fri, 2004-10-01 at 13:39, Tom Lane wrote:
> Possibly not. Can EXECUTE determine how the executed statement would
> have set the flag?
At the moment, EXECUTE just feeds the string it finds to spi_execute().
We could probably hack it to figure out how to modify FOUND, but I think
it would be ugl
Neil Conway <[EMAIL PROTECTED]> writes:
> On Fri, 2004-10-01 at 02:26, Tom Lane wrote:
>> EXECUTE does not set the FOUND flag.
> Is there a good reason for this behavior?
Possibly not. Can EXECUTE determine how the executed statement would
have set the flag? Should we assume that the function d
On Fri, 2004-10-01 at 02:26, Tom Lane wrote:
> EXECUTE does not set the FOUND flag.
Is there a good reason for this behavior?
-Neil
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs
=?koi8-r?B?68/O09TBztTJzg==?= <[EMAIL PROTECTED]> writes:
> sql := 'insert into tbl' || suffix::text || ' values (1,1)';
> EXECUTE sql;
> IF NOT FOUND THEN
> RAISE NOTICE 'NOT INSERTED';
> END IF;
EXECUTE does not set the FOUND flag. See
http://developer.postgresql.org/docs/postgres/plpgsql-sta
Hello,
FreeBSD, I386, Postgres 8.0.0 beta2
Trying issuing such a plpgsql function:
Create function test_fun (suffix char(4)) returns integer as $$
DECLARE
sql text;
BEGIN
sql := 'insert into tbl' || suffix::text || ' values (1,1)';
EXECUTE sql;
IF NOT FOUND THEN
RAISE NOTICE 'NOT INSERTED';
END I
Tom Lane wrote:
> [EMAIL PROTECTED] writes:
>
>>I found a bug in the behaviour of plpgsql error handling system
>>while trying to handle foreign key violation exception.
>
>
> This is not a bug in the exception system.
>
> The problem is that FK constraints are enforced by triggers that do not
> fi
[EMAIL PROTECTED] writes:
> I found a bug in the behaviour of plpgsql error handling system
> while trying to handle foreign key violation exception.
This is not a bug in the exception system.
The problem is that FK constraints are enforced by triggers that do not
fire until the end of the outer
On Sun, 5 Sep 2004 [EMAIL PROTECTED] wrote:
> I found a bug in the behaviour of plpgsql error handling system
> while trying to handle foreign key violation exception.
>
> When this error occured, control doesn't jump to exception handling block.
> It moves to the next statement instead. When con
Hello.
I found a bug in the behaviour of plpgsql error handling system
while trying to handle foreign key violation exception.
When this error occured, control doesn't jump to exception handling block.
It moves to the next statement instead. When control leaves the
function exception is occured.
On Tue, 17 Feb 2004, Tom Lane wrote:
> Pavel Stehule <[EMAIL PROTECTED]> writes:
> > When I declare variable with same name as field of table, then I
> > have a problem with insert cmd in plpgsql procedure.
>
> Don't do that.
>
> > Is it plpgsql error or my bug?
>
> You could argue it eith
Pavel Stehule <[EMAIL PROTECTED]> writes:
> When I declare variable with same name as field of table, then I
> have a problem with insert cmd in plpgsql procedure.
Don't do that.
> Is it plpgsql error or my bug?
You could argue it either way, perhaps, but it's unlikely to get
changed. In
Hello
When I declare variable with same name as field of table, then I
have a problem with insert cmd in plpgsql procedure. I can't use this name
of columns list in insert cmd; I get syntax error.
When I use equal names in SELECT cmd, I didn't get error msg, but stored
prodedure don't
Hi,
I want to concatenate a it counter to a string in a loop in plpgsql.
DECLARE
counter integer := 1;
IdSet char : = 'UniqueId'
IdForEachRun varchar;
BEGIN
IdForEachRun := IdSet || counter;(PROBLEM HERE)
--Or IdForEachRun := IdSet + counter;(PROBLEM HERE)
While condition LOOP
Insert into Table
Convert "counter" into a VARCHAR and coincatinate that to IdSet using
th || operator.
You cannot concatinate data of differing TYPEs.
Rick
Puneet Paul wrote:
Hi,
I want to concatenate a it counter to a string in a
loop in plpgsql.
DECLARE
counter integer := 1;
IdSet char : = 'UniqueId'
IdForE
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
> I get error "missing ".." at end of SQL expression"
...
> Can someone help please
The problems appear to be in your declare block:
> curTrackList char(15) ALIAS for $1;
> sliceFile varchar ALIAS for $2;
> lmfpLimit integer ALIAS for $3
Y
Puneet Paul <[EMAIL PROTECTED]> writes:
> DECLARE
> curTrackList char(15) ALIAS for $1;
> sliceFile varchar ALIAS for $2;
> lmfpLimit integer ALIAS for $3
> mTrackDet RECORD;
If that's an accurate copy of your function, then the problem is likely
the lack of a semicolon on
I should play with your code, but I'm lazy.
1) lmfpLimit integer ALIAS for $3
is missing the trailing ";"
lmfpLimit integer ALIAS for $3;
2) VARCHAR variables need a length
curId varchar;
should be
curId varchar(100);
3) I have not seen this style of declaration, where the argum
Hi,
I want to concatenate a it counter to a string in a
loop in plpgsql.
DECLARE
counter integer := 1;
IdSet char : = 'UniqueId'
IdForEachRun varchar;
BEGIN
IdForEachRun := IdSet || counter;(PROBLEM HERE)
--Or IdForEachRun := IdSet + counter;(PROBLEM HERE)
While condition LOOP
Insert into Table
Hi All,
I am compiling a function that uses the For Query
loopEnd Loop.
I get error "missing ".." at end of SQL expression"
I have read following Note: The PL/pgSQL parser
presently distinguishes the two kinds of FOR loops
(integer or query result) by checking whether the
target variable men
Marcel Gsteiger wrote:
> I created a plpgsql function declaring and then using a cursor.
> After opening and using this cursor, I forgot to close it. Now
> when the function terminates, this cursor remains open. Then,
> when I call the function again with other parameters, the OPEN
> CURSOR compl
Hi,
Please find enclosed my description of what I think is probably a bug
in plpgsql.
Keep up the good work, this is a wonderful product.
Best regards
Marcel Gsteiger
Milprog AG
3001 Berne
Switzerland
Freundliche Grüsse
Milprog AG
Marcel Gsteiger
bug.template
Description: Binary data
BEGIN:VC
Hello,
I think that there is a bug in plPGSQL - or maybe I don't know something
about this language. Try to create this function
Ok., this is the function created in plPGSQL:
CREATE FUNCTION "public"."test" (text, text) RETURNS text AS'
BEGIN
IF $1 THEN
RETURN $1;
ELSE
RETURN $2;
E
see attachment
--
Christian Zagrodnick
gocept gmbh & co. kg - schalaunische strasse 6 - 06366 koethen/anhalt
fon. +49 3496 3099114
fax. +49 3496 3099118
mob. +49 173 9078826
mail [EMAIL PROTECTED]
If PostgreSQL failed to compile on your computer or you found a bug that
is likely to be speci
see attachment
--
Christian Zagrodnick
gocept gmbh & co. kg - schalaunische strasse 6 - 06366 koethen/anhalt
fon. +49 3496 3099114
fax. +49 3496 3099118
mob. +49 173 9078826
mail [EMAIL PROTECTED]
If PostgreSQL failed to compile on your computer or you found a bug that
is likely to be speci
Angus Lees <[EMAIL PROTECTED]> writes:
> from a quick look at plpgsql/src/gram.y, the decl_dtypename rule
> only allows type modifiers (decl_attypmod) on CHAR, VARCHAR or BPCHAR.
This is fixed in 7.2.
regards, tom lane
---(end of broadcast)---
PL/pgSQL docs say "PL/pgSQL variables can have any SQL datatype".
but when i try:
CREATE FUNCTION foo() RETURNS NUMERIC(5,2) AS '
DECLARE
bar NUMERIC(5,2);
BEGIN
bar := 123.45;
return bar;
END;
' LANGUAGE 'plpgsql';
then "select foo()" gives:
NOTICE: plpgsql: ERROR dur
On Tue, 29 Jan 2002, Nagasubramanya L wrote:
> I have even tried
> CREATE LANGUAGE 'plpgsql'
>
> But I am not able to set it. What is that I should do to set up this language
>support.
Use the shell script createlang
createlang plpgsql
should add it to the database in question.
hello sir,
I have written a function. The language used
is sql. I am not getting error if I assign an alias to a variable or if I try to
declare any of the variable.
I could figure out that I require support if
plpgsql, but I am not able to get the suppor of this language. I have
tried
Szima Gabor writes:
> Table-OID are cached and not flushed after DROP TABLE?
Something like that, but what are you expecting?
--
Peter Eisentraut [EMAIL PROTECTED] http://funkturm.homeip.net/~peter
---(end of broadcast)---
TIP 2: you can ge
Hello!
-
> createdb test
CREATE DATABASE
> createlang plpgsql test
> psql test
Welcome to psql, the PostgreSQL interactive terminal.
create function testcnt () returns int4 as '
declare
rp int4;
begin
select count(*) into rp from test
Tom Lane wrote:
>
> "Tim Dunnington" <[EMAIL PROTECTED]> writes:
> > If you create a function with a table as the argument, and later alter that
> > table and add a new column, the function fails saying "incorrect number of
> > attributes for table _tablename_" Dropping and readding the function
"Tim Dunnington" <[EMAIL PROTECTED]> writes:
> If you create a function with a table as the argument, and later alter that
> table and add a new column, the function fails saying "incorrect number of
> attributes for table _tablename_" Dropping and readding the function does
> not fix this pro
NOTE: Please retract similar, earlier entry (hit send by mistake :-)
Synopsis:
If you create a function with a table as the argument, and later alter that
table and add a new column, the function fails saying "incorrect number of
attributes for table _tablename_" Dropping and readding the f
52 matches
Mail list logo