Tag Info

New answers tagged

2

You wrote "case closed", but I'll reopen. There is just too much gone wrong ... Database design and test setting CREATE TABLE patient ( patient_id int PRIMARY KEY , site_held_at int NOT NULL ); CREATE TABLE messageq ( messageq_id varchar PRIMARY KEY -- varchar ?! , patient_id int NOT NULL REFERENCES patient , message_body varchar NOT NULL ...


5

I think this is because you only ever return the first row from the query's result. The select ... into ... will only retrieve one row and the query select * from result returns only that single record: You also don't need a PL/pgSQL function, a plain SQL function will work just fine: CREATE OR REPLACE FUNCTION getMessageFromSites(ids TEXT) RETURNS ...


1

UDFs in interpreted languages are pretty much always slower than UDFs written in C or built-in functions, all other things being the same. Each language binding has different code to connect PostgreSQL to the language, with different degrees of optimisation, different ways of passing some data types, etc. So variation certainly exists. It shouldn't be huge. ...


3

this is pretty hard to tell. it really depends on what you are doing. for example: PL/pgSQL is wonderful if you got large SQL statements in it - it really goes crazy if you got all kinds of branching, substring management and all that. you really got to test from case to case.



Top 50 recent answers are included