Thread: error messages

error messages

From
PJourdan
Date:
I have found some errors in my pgsql error file:
FATAL 1: Database :"template0" is not currently accepting connections
ERROR: Relation 'visits'does not have attribute 'path'
ERROR: Bad boolean external representation '<font color=red><b>YES></b></font>'
ERROR: Relation "mustdie" does not exist
NOTICE: Adding missing FROM-caluse entry for table "customer"
ERROR: No such atribute or function 'pcustomer_id'

I would like to understand what these statements mean so I can trace and
correct problems in the database.

I do not understand what is the use of the "template0" - is it the base
"model" for newly created databases? I was under the impression that that
was template1...
sorry for my ignorance, but I have to start somewhere... :-)
Philip Jourdan


Re: error messages

From
"P. Jourdan"
Date:
At 09:31 AM 5/2/2002 -0700, Josh Berkus wrote:
>Phillip,
>
> > I have found some errors in my pgsql error file:
> > FATAL 1: Database :"template0" is not currently accepting connections
>
>This means that some part of your PHP script attempted to log in to
>Template0 (which is kept closed, for emergency restores) or use it as a
>database template instead of Template1.

I found that this seems to be caused by pgAdmin2 when I access my FreeBSD
machine from my W2kPro. The pgAdmin2 window shows the template0 as a
database X'ed out in red. When I run it and immediately check the log - bingo!


> > ERROR: Relation 'visits'does not have attribute 'path'
>
>Somewhere in your script is a reference to the "path" field of the
>table "visits", which does not exist.  Alternately, it's possible that
>"path" does exist, but it is a reserved word and needs to be quoted.

I found the code that refers to this and it seems to be missing columns in
the table. I added the columns with datatype TEXT (for path and referer - I
hope it's correct). I will now see what happens. :-)


> > ERROR: Bad boolean external representation '<font
> > color=red><b>YES></b></font>'
>
>You tried to assign the value  ''<font color=red><b>YES></b></font>' to
>a BOOLEAN variable.  That's bad HTML/PHP.

Well, I didn't - someone else did something and poor little me (real
NOVICE) is trying to fix it:
The code that is generating the message is all within the php delimiters
(entire file) and appears several times as follows:

if($r1==0 || $r2==0) {
if($archived=='Y') {
$archived="<font color=red><b>YES</b></font>";
}
;;;
select wares.ware_id,wares.name,category.name,unit_size,
qty_per_shipping_unit,supplier.name,sku,
case when wares.archived='t' then '<font color=red><b>YES</b></font>' else
wares.archived end as archived,
trademark.name
from wares,category,wares_category,supplier_wares,supplier,trademark
where wares.ware_id=wares_category.ware_id and
category.category_id=wares_category.category_id and
wares.ware_id=supplier_wares.ware_id and
supplier_wares.supplier_id=supplier.supplier_id and
wares.trademark_id=trademark.trademark_id";

I do not understand what is wrong? (This apparently worked fine in the
original online web site.)


> > ERROR: Relation "mustdie" does not exist
>
>There is no table "mustdie", yet you persist in asking for it.  What
>kind of user are you, anyway?  ;-)

Please, don't shoot me, yet... :-(
I did find that the table does not exist - I just have to find out what it
should contain... and then re-create it.


> > NOTICE: Adding missing FROM-caluse entry for table "customer"
>
>You referenced a field from "customer" in your query, but did not
>include customer in your FROM clause.  This frequently has unexpected
>results.  Fix the query.

I'll do my best.  :-)


> > ERROR: No such atribute or function 'pcustomer_id'
>
>Same as several above.
>
> > I would like to understand what these statements mean so I can trace
> > and correct problems in the database.
>
>One bit o' help.  Stop Postgresql.  Go to the postgressql.conf file,
>and turn "quote queries" on in the logging options.  This will allow
>you to see the queries that generate the error in the log.  You will
>want to turn this option back off before going live, though, or your
>logs will get huge ...

OK, & thanks

Philip


Re: error messages

From
"Josh Berkus"
Date:
Phillip,

> I have found some errors in my pgsql error file:
> FATAL 1: Database :"template0" is not currently accepting connections

This means that some part of your PHP script attempted to log in to
Template0 (which is kept closed, for emergency restores) or use it as a
database template instead of Template1.

> ERROR: Relation 'visits'does not have attribute 'path'

Somewhere in your script is a reference to the "path" field of the
table "visits", which does not exist.  Alternately, it's possible that
"path" does exist, but it is a reserved word and needs to be quoted.

> ERROR: Bad boolean external representation '<font
> color=red><b>YES></b></font>'

You tried to assign the value  ''<font color=red><b>YES></b></font>' to
a BOOLEAN variable.  That's bad HTML/PHP.

> ERROR: Relation "mustdie" does not exist

There is no table "mustdie", yet you persist in asking for it.  What
kind of user are you, anyway?  ;-)

> NOTICE: Adding missing FROM-caluse entry for table "customer"

You referenced a field from "customer" in your query, but did not
include customer in your FROM clause.  This frequently has unexpected
results.  Fix the query.

> ERROR: No such atribute or function 'pcustomer_id'

Same as several above.

> I would like to understand what these statements mean so I can trace
> and correct problems in the database.

One bit o' help.  Stop Postgresql.  Go to the postgressql.conf file,
and turn "quote queries" on in the logging options.  This will allow
you to see the queries that generate the error in the log.  You will
want to turn this option back off before going live, though, or your
logs will get huge ...

-Josh

Re: error messages

From
"P. Jourdan"
Date:
At 09:31 AM 5/2/2002 -0700, Josh Berkus wrote:

> > ERROR: Bad boolean external representation '<font
> > color=red><b>YES></b></font>'
>
>You tried to assign the value  ''<font color=red><b>YES></b></font>' to
>a BOOLEAN variable.  That's bad HTML/PHP.

I am not responsible (for this)! But I did remove the formatting and now it
seems to work fine. I wish I knew what the idea was behind the formatting....

Thanks. :-)
Philip Jourdan