Skip site navigation (1) Skip section navigation (2)

array syntax in pg_execute call

From: "G(dot) J(dot) Walsh" <gjwalsh(at)dscdirectionalservices(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: array syntax in pg_execute call
Date: 2008-03-13 00:23:46
Message-ID: 1205367826.6905.18.camel@www.dscdirectionalservices.com (view raw or flat)
Thread:
Lists: pgsql-novice
I have a complex php form which initializes rows in 4 tables. In each
case I have employed prepared statements. In the first 3 everything
works beautifully with as many as 45 columns involved. 

The 4th table (badtest) is driving me around the bend. Simplified, the
schema would be:

testcode CHAR[10] not null primary key
testrank SMALLINT[]
testraw SMALLINT[]

And the script is:

$query = "INSERT INTO badtest(testcode,testrank,testraw) VALUES($1,$2,
$3)";
$result = pg_prepare($pg,"initbadtest",$query) or die('as usual');
pg_execute($pg,"initbadtest",array(testcode,'{0,0,0,0,0,0}','{0,0,0,0,0,0}));

The only difference is the presence of arrays. 

Inclusion of this script stops the firm from being diplayed, but there
are no logged items either for the system errorlog or postgresql
itself. 

So 'die' does its job, so to speak, but what am I doing wrong here? The
documentation for 8.3 section 14 mentions this array syntax is similar
to 'C'. Yes, it is, but that is small comfort. I also tried the
ARRAY[0.0.0.0.0.0] style but the same problem - no display. Remove the
code and the script 'does it thing'.

Has to be simple, but I can no longer see for looking.

George

Responses

pgsql-novice by date

Next:From: Vyacheslav KalininDate: 2008-03-13 01:34:20
Subject: Re: array syntax in pg_execute call
Previous:From: Tom LaneDate: 2008-03-12 21:12:15
Subject: Re: little bug in 8.3?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group