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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-novice by date

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