Like that
rski=> select i, (ARRAY[11,22,33])[i] from
generate_series(1,array_upper(ARRAY[11,22,33],1)) i;
i | array
---+-------
1 | 11
2 | 22
3 | 33
(3 rows)
If you know the dimension of a table you can replace array_upper with it.
I've installed postgres v. 8.2.4 with plperl support (--with-perl option with configure).
But when I try to create plperl languge (createlang plperl) i've got an error
createlang: language installation failed: ERROR: could not load library "/usr/ocal/pgsql/lib/plperl.so"...
U mean how to do it with pl function?
All information about database u can find in information_schema tables and views. With an IF statement and NOT FOUND 'constant' u can check if specified table contains given column. (see more on postgresql.org)
When u use triggers u have can use two additionals tables OLD and NEW inside functions. Maybe try to modify them. If u use after i think u should modify NEW and then return NEW.
The database cluster is the place where u'r tables, views etc lies (I gues u didn't use tablespaces). So u can try just copy hole cluster (environment variable PGDATA show u the cluster's path), but I don't now if it works (I didn't try it). The best way to move database is to backup it...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.