Unix Technical Forum

Relation missing?

This is a discussion on Relation missing? within the pgsql Novice forums, part of the PostgreSQL category; --> I got an error SELECT ERecord(100, 3492,'2008-05-13 10:25:57', 1, 0); gave me (translating into english) ERROR: relation with OID ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-16-2008, 01:43 PM
A B
 
Posts: n/a
Default Relation missing?

I got an error

SELECT ERecord(100, 3492,'2008-05-13 10:25:57', 1, 0);

gave me (translating into english)

ERROR: relation with OID 31330 doesn't exist
CONTEXT: SQL-statement: "INSERT INTO eLog (customer,shop,event,time)
VALUES ( $1 , $2 , $3 , $4 )"
PL/pgSQL function "erecord" line 5 at SQL statement

ERecord is a function written in PL/pgSQL... so what can this mean?

--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-16-2008, 01:43 PM
A. Kretschmer
 
Posts: n/a
Default Re: Relation missing?

am Tue, dem 13.05.2008, um 15:08:51 +0200 mailte A B folgendes:
> I got an error
>
> SELECT ERecord(100, 3492,'2008-05-13 10:25:57', 1, 0);
>
> gave me (translating into english)
>
> ERROR: relation with OID 31330 doesn't exist
> CONTEXT: SQL-statement: "INSERT INTO eLog (customer,shop,event,time)
> VALUES ( $1 , $2 , $3 , $4 )"
> PL/pgSQL function "erecord" line 5 at SQL statement
>
> ERecord is a function written in PL/pgSQL... so what can this mean?


Wild gues: within this function you create this table and you don't use
EXECUTE for that. When you start a new session, the first time yout
function works fine, but the second call fails. Right?

PG caches the plan and the OID's for objects, because this fact it fails
the second time. To prevent this, use EXECUTE for all DDL-commands.


Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-16-2008, 01:43 PM
A B
 
Posts: n/a
Default Re: Relation missing?

In this function I create no table, I just do insert into various
already existing tables.
It is not a prepared statement, but a function I created, so I'm not
sure if EXECUTE is what I should use.
This function has successfully run many times before, over several days.

Excuse my ignorance, but what is DDL commands? Is that like creating tables?


2008/5/13 A. Kretschmer <andreas.kretschmer@schollglas.com>:
> am Tue, dem 13.05.2008, um 15:08:51 +0200 mailte A B folgendes:
>
>
> > I got an error
> >
> > SELECT ERecord(100, 3492,'2008-05-13 10:25:57', 1, 0);
> >
> > gave me (translating into english)
> >
> > ERROR: relation with OID 31330 doesn't exist
> > CONTEXT: SQL-statement: "INSERT INTO eLog (customer,shop,event,time)
> > VALUES ( $1 , $2 , $3 , $4 )"
> > PL/pgSQL function "erecord" line 5 at SQL statement
> >
> > ERecord is a function written in PL/pgSQL... so what can this mean?

>
> Wild gues: within this function you create this table and you don't use
> EXECUTE for that. When you start a new session, the first time yout
> function works fine, but the second call fails. Right?
>
> PG caches the plan and the OID's for objects, because this fact it fails
> the second time. To prevent this, use EXECUTE for all DDL-commands.
>
>
> Andreas
> --
> Andreas Kretschmer
> Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
> GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
>
> --
> Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice
>


--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-16-2008, 01:43 PM
A. Kretschmer
 
Posts: n/a
Default Re: Relation missing?

am Tue, dem 13.05.2008, um 15:43:52 +0200 mailte A B folgendes:
> In this function I create no table, I just do insert into various
> already existing tables.


Okay, sorry.


> It is not a prepared statement, but a function I created, so I'm not
> sure if EXECUTE is what I should use.
> This function has successfully run many times before, over several days.
>
> Excuse my ignorance, but what is DDL commands? Is that like creating tables?


Right, Data Definition Language.



Regards, Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-16-2008, 01:43 PM
Bruce Hyatt
 
Posts: n/a
Default Re: Relation missing?

DDL = Data Definition Language

I.e.; CREATE, ALTER and DROP statements.

Bruce

--- A B <gentosaker@gmail.com> wrote:

> In this function I create no table, I just do insert into
> various
> already existing tables.
> It is not a prepared statement, but a function I created, so
> I'm not
> sure if EXECUTE is what I should use.
> This function has successfully run many times before, over
> several days.
>
> Excuse my ignorance, but what is DDL commands? Is that like
> creating tables?
>
>
> 2008/5/13 A. Kretschmer <andreas.kretschmer@schollglas.com>:
> > am Tue, dem 13.05.2008, um 15:08:51 +0200 mailte A B

> folgendes:
> >
> >
> > > I got an error
> > >
> > > SELECT ERecord(100, 3492,'2008-05-13 10:25:57', 1, 0);
> > >
> > > gave me (translating into english)
> > >
> > > ERROR: relation with OID 31330 doesn't exist
> > > CONTEXT: SQL-statement: "INSERT INTO eLog

> (customer,shop,event,time)
> > > VALUES ( $1 , $2 , $3 , $4 )"
> > > PL/pgSQL function "erecord" line 5 at SQL statement
> > >
> > > ERecord is a function written in PL/pgSQL... so what can

> this mean?
> >
> > Wild gues: within this function you create this table and

> you don't use
> > EXECUTE for that. When you start a new session, the first

> time yout
> > function works fine, but the second call fails. Right?
> >
> > PG caches the plan and the OID's for objects, because this

> fact it fails
> > the second time. To prevent this, use EXECUTE for all

> DDL-commands.
> >
> >
> > Andreas
> > --
> > Andreas Kretschmer
> > Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr:

> -> Header)
> > GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA

> http://wwwkeys.de.pgp.net
> >
> > --
> > Sent via pgsql-novice mailing list

> (pgsql-novice@postgresql.org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgsql-novice
> >

>
> --
> Sent via pgsql-novice mailing list
> (pgsql-novice@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice
>






--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:08 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com