[GENERAL] user defined function
I want to implement a UDF that can accept a parameter which is a tuple of any table, and returns the number of NULL attributes in this tuple. Different tables may have different schemas. How can I implement this function? Thanks. andrew
Re: [GENERAL] user defined function
Do you mean this function? Seems I cannot get much information from it.../** record_out - output routine for pseudo-type RECORD.*/Datumrecord_out(PG_FUNCTION_ARGS){ elog(ERROR, Cannot display a value of type %s, RECORD); PG_RETURN_VOID(); /* keep compiler quiet */}On 1/24/06, Tom Lane [EMAIL PROTECTED] wrote:Richard Huxton dev@archonet.com writes: Tom Lane wrote: You could do that in C, but none of the available PLs support it. How would you define the signature for the function? One parameter of type anyelement? Type RECORD would be a better choice --- ANYELEMENT allows scalar typeswhich is not what you want here.(You could probably still do it witha function declared that way, but it'd have to take extra steps to defend itself against being passed, say, an integer.)If you're looking for a coding model, stripping down record_out() tojust count nulls should get you there.regards, tom lane
Re: [GENERAL] user defined function
But I have to use 7.3 due to some limitations. Can I do it in 7.3? On 1/24/06, Tom Lane [EMAIL PROTECTED] wrote: Yl Zhou [EMAIL PROTECTED] writes: Do you mean this function? Seems I cannot get much information from it...That would appear to be Postgres 7.3 :-(You need a considerably newer version of Postgres if you want to do muchof anything useful with unspecified-type records. 8.0 has most of thatfunctionality but I think 8.1 added some things.regards, tom lane
Re: [GENERAL] user defined function
Can anyone tell me whether 7.3 supports unspecified record types or not? On 1/24/06, Tom Lane [EMAIL PROTECTED] wrote: Yl Zhou [EMAIL PROTECTED] writes: Do you mean this function? Seems I cannot get much information from it...That would appear to be Postgres 7.3 :-( You need a considerably newer version of Postgres if you want to do muchof anything useful with unspecified-type records.8.0 has most of thatfunctionality but I think 8.1 added some things.regards, tom lane
[GENERAL] looking for multi-language app example using postgresql
I tried but have very little progress on this. If any one know where to find an multi-language example (php prefered) using postgresql, please let me know. Thanks [EMAIL PROTECTED]
Re: [GENERAL] pgmonitor
i want to list non-system tables with psql and get the following error. any alternatives? Thanks. EPost-# \dt ERROR: invalid byte sequence for encoding UNICODE: 0xed my database used UNICODE as the encoding. and the OS is win2k pro wich simplified chinese as default language. ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
[GENERAL] multi-languages in a table
I'm migrating from mysql to postgresql. I've several (mysql)tables with multi-language columns: descript, descript_gb, descript_b5, descript_sp they store the record's description in English, SimplifiedChinese, TraditionalChinese andSpanish respectively. I don't know if this will work in postgresql: I need to query those columns (one language at a time). And I hope the contents in those columns can be displayed in web (one language at a time) easily. Any suggestions? Thanks
[GENERAL] cygwin and psql
I'm installing psql to my laptop where cygwin is installed. I got the warning for removing the cygwin\bin from the path and re-start the installer. It's not hard to remove cygwin from the path. Does qsql need to remove cygwin permanently? Thanks No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.1 - Release Date: 4/1/2005 ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
[GENERAL] test
please ignore -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.1 - Release Date: 4/1/2005 ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
[GENERAL] psql and mysql
Dear List, I'm new to Psql and very eager to learn the differences between these two RDBMS. Any help is greatly appreciated. Thanks -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.1 - Release Date: 4/1/2005 ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]