[SQL] Capacity planning.
Hi, Any way to get transaction count from the postgres daemon or any log? Also where can I find docs that can help me make a capacity plan for max 100,000 clients making around 200 transactions a day each. -- Regards. David Harel, == Home office +972 77 7657645 Cellular: +972 54 4534502 Snail Mail: Amuka D.N Merom Hagalil 13802 Israel Email: harel...@ergolight-sw.com
[SQL] plperlu user function.
Greetings, I am trying to write a user function on the server to retrive image files. Currently I wrote the following: CREATE OR REPLACE FUNCTION perl_getfile(text) RETURNS OID AS $BODY$ my $tmpfile = shift; open my $IFHAND, '<', $tmpfile or elog(ERROR, qq{could not open the file "$tmpfile": $!}); binmode $IFHAND; my $result = ''; while(my $buffer = <$IFHAND>) { $result .= $buffer; } return $result; $BODY$ LANGUAGE 'plperlu'; on the client I do (PHP sniplet): $result = pg_query($dbcnx, "SELECT perl_getfile('/home/harel/Misc/At_work.jpg')"); and I get an error: Warning: pg_query() [function.pg-query <http://localhost/mysqlImage1/function.pg-query>]: Query failed: ERROR: invalid input syntax for type oid: "ÿØÿà" in /home/harel/Prj/php/testImages/mysqlImage1/image.php Any recommendation how to do it right? -- Regards. David Harel, == Home office +972 77 7657645 Cellular: +972 54 4534502 Snail Mail: Amuka D.N Merom Hagalil 13802 Israel Email: harel...@ergolight-sw.com
[SQL] user function and bind
Hi, I need an example how to write user function with columns binding and how to use it on PHP -- Thanks. David Harel, == Home office +972 77 7657645 Cellular: +972 54 4534502 Snail Mail: Amuka D.N Merom Hagalil 13802 Israel Email: harel...@ergolight-sw.com
[SQL] User function that returns a set of rows.
Hi, I'm struggling to write what seed at the time a simple function like: "CREATE FUNCTION foo() RETURNS IDONO as $$ select * from tbl; return (whatever that will give the *); $$ up till now I got this far: CREATE OR REPLACE FUNCTION select_business_types () RETURNS SETOF RECORD AS $body$ DECLARE rec RECORD; -- fields business_type_id business_type_name BEGIN FOR rec IN SELECT * FROM sv_bo_business_types LOOP RETURN NEXT rec; END LOOP; RETURN; END; $body$ LANGUAGE 'plpgsql'; When I tried it from the shell I got a nasty error message about that I am not in an environment to receive a set ??? (can't see it now. Office restrictions). Any idea? -- Regards. David Harel, == Home office +972 77 7657645 Cellular: +972 54 4534502 Snail Mail: Amuka D.N Merom Hagalil 13802 Israel Email: harel...@ergolight-sw.com
[SQL] backup and document views and user functions
Hi, I am looking for an easy way to backup views and functions. I want to store them in our version control system. Using pgAdmin I can access them one at a time. I am looking for a better reporting mechanism. psql shell command for such report will be just fine. Sorry for the lame question. I didn't find any clues on the web .(typically, I fail to phrase the right keywords) -- Thanks. David Harel, == Home office +972 77 7657645 Cellular: +972 54 4534502 Snail Mail: Amuka D.N Merom Hagalil 13802 Israel Email: harel...@ergolight-sw.com
[SQL] pgadmin debugger
Greetings, I use Ubuntu 10.04. I have postgresql version 8.4.8 installed also I have pgadmin version 1.10.2. I can't find debugger_plugin.so which is needed to debug pgplsql using pgadmin: http://www.postgresonline.com/journal/archives/214-Using-PgAdmin-PLPgSQL-Debugger.html Any idea? -- Thanks. David Harel, == Home office +972 77 7657645 Cellular: +972 54 4534502 eMail: harel...@gmail.com Snail Mail: Amuka D.N Merom Hagalil 13802 Israel -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
Re: [SQL] pgadmin debugger
On Sat, 2011-08-13 at 12:56 -0700, Adrian Klaver wrote: > On Saturday, August 13, 2011 12:39:44 pm David Harel wrote: > > Greetings, > > > > I use Ubuntu 10.04. I have postgresql version 8.4.8 installed also I > > have pgadmin version 1.10.2. I can't find debugger_plugin.so which is > > needed to debug pgplsql using pgadmin: > > http://www.postgresonline.com/journal/archives/214-Using-PgAdmin-PLPgSQL-De > > bugger.html > > > > Any idea? > > http://www.enterprisedb.com/docs/en/8.4/pgadmin/debugger.html Trying to compile (no configure script found) the thing I get: pldebugger # make Makefile:42: ../../src/Makefile.global: No such file or directory Makefile:43: /contrib/contrib-global.mk: No such file or directory make: *** No rule to make target `/contrib/contrib-global.mk'. Stop. -- Thanks. David Harel, == Home office +972 77 7657645 Cellular: +972 54 4534502 eMail: harel...@gmail.com Snail Mail: Amuka D.N Merom Hagalil 13802 Israel -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
Re: [SQL] pgadmin debugger
On Sun, 2011-08-14 at 11:07 -0700, Adrian Klaver wrote: > On Sunday, August 14, 2011 10:15:43 am David Harel wrote: > > On Sat, 2011-08-13 at 12:56 -0700, Adrian Klaver wrote: > > > On Saturday, August 13, 2011 12:39:44 pm David Harel wrote: > > > > Greetings, > > > > > > > > I use Ubuntu 10.04. I have postgresql version 8.4.8 installed also I > > > > have pgadmin version 1.10.2. I can't find debugger_plugin.so which is > > > > needed to debug pgplsql using pgadmin: > > > > http://www.postgresonline.com/journal/archives/214-Using-PgAdmin-PLPgSQ > > > > L-De bugger.html > > > > > > > > Any idea? > > > > > > http://www.enterprisedb.com/docs/en/8.4/pgadmin/debugger.html > > > > Trying to compile (no configure script found) the thing I get: > > pldebugger # make > > Makefile:42: ../../src/Makefile.global: No such file or directory > > Makefile:43: /contrib/contrib-global.mk: No such file or directory > > make: *** No rule to make target `/contrib/contrib-global.mk'. Stop. > > Looking at README.pldebugger indicates you need the development code for > Postgres. Is your Postgres installation from the Ubuntu packages or did you > compile it yourself? > I installed form Ubuntu package. I am currently trying to install postgresql-server-dev-8.4.8-0ubuntu0.10.04 package. Will that suffice? -- Thanks. David Harel, == Home office +972 77 7657645 Cellular: +972 54 4534502 eMail: harel...@gmail.com Snail Mail: Amuka D.N Merom Hagalil 13802 Israel -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
Re: [SQL] pgadmin debugger
On Mon, 2011-08-15 at 06:49 -0700, Adrian Klaver wrote: > On Sunday, August 14, 2011 11:33:13 am David Harel wrote: > > On Sun, 2011-08-14 at 11:07 -0700, Adrian Klaver wrote: > > > On Sunday, August 14, 2011 10:15:43 am David Harel wrote: > > > > On Sat, 2011-08-13 at 12:56 -0700, Adrian Klaver wrote: > > > > > On Saturday, August 13, 2011 12:39:44 pm David Harel wrote: > > > > > > Greetings, > > > > > > > > > > > > I use Ubuntu 10.04. I have postgresql version 8.4.8 installed also > > > > > > I have pgadmin version 1.10.2. I can't find debugger_plugin.so > > > > > > which is needed to debug pgplsql using pgadmin: > > > > > > http://www.postgresonline.com/journal/archives/214-Using-PgAdmin-PL > > > > > > PgSQ L-De bugger.html > > > > > > > > > > > > Any idea? > > > > > > > > > > http://www.enterprisedb.com/docs/en/8.4/pgadmin/debugger.html > > > > > > > > Trying to compile (no configure script found) the thing I get: > > > > pldebugger # make > > > > Makefile:42: ../../src/Makefile.global: No such file or directory > > > > Makefile:43: /contrib/contrib-global.mk: No such file or directory > > > > make: *** No rule to make target `/contrib/contrib-global.mk'. Stop. > > > > > > Looking at README.pldebugger indicates you need the development code for > > > Postgres. Is your Postgres installation from the Ubuntu packages or did > > > you compile it yourself? > > > > I installed form Ubuntu package. I am currently trying to install > > postgresql-server-dev-8.4.8-0ubuntu0.10.04 package. > > Will that suffice? > > Probably would not hurt to install the contrib package also. I generally > install from source, so I am wandering into relatively unknown territory > here:) > Thanks, -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql