]> granicus.if.org Git - postgresql/commit
From: Anton de Wet <adw@obsidian.co.za>
authorMarc G. Fournier <scrappy@hub.org>
Wed, 2 Apr 1997 18:16:49 +0000 (18:16 +0000)
committerMarc G. Fournier <scrappy@hub.org>
Wed, 2 Apr 1997 18:16:49 +0000 (18:16 +0000)
commit17b5bd33e415404734d9f904615a54814b80900b
tree51161f06e88f0bb61816c42b1f77cd1528513fbd
parent5b1311acfbd6b84dbb84975240914214c51fcb48
From: Anton de Wet <adw@obsidian.co.za>
Subject: [HACKERS] Small patch to pgtclCmds.c

Hi I have made the following small change to the extensions I made to
pgtclCmds.c quite a while ago.

At the moment there is a -assignbyidx option to pg_result assigning the
returned tuples to an array by using the 1st field of the select statement
as the key to the array.
eg "select name,age from vitalstatistics" will result in an array with

myarray(peter) = 32
myarray(paul)  = 45

Often I need to have a pseudo-multi dimentional
array eg. "select name,age from vitalstatistics where occupation='plummer'

I would like to be able to generate an array
newarray(peter,overpaid) = 32

So to add a arbitrary string to the key value I have extended

  pg_result $res -assignbyidx $arrayname

to have an optional argument

  pg_result $res -assignbyidx $arrayname $appendstr

So that that string is appended to the key value.
src/interfaces/libpgtcl/pgtclCmds.c