Re: [GENERAL] #include

2010-12-26 Thread Elliot Chance
Heres an interesting hack I just thought of that works: extern "C" { #include #include #define using _using #define typeid _typeid #define typename _typename #include #undef using #undef typeid #undef typename #ifd

[GENERAL] C functions with COMMIT/ROLLBACK?

2010-12-26 Thread Elliot Chance
Hi everyone, Is is possible to add handlers so that a C function is fired when a transaction is committed or rolled back, for example (pseudo code): BEGIN; CALL my_function(1); CALL my_function(2); CALL my_function(3); ROLLACK; my_function() Create "my_file.txt.tmp" Write some information t

Re: [GENERAL] Compress data sent to client

2010-12-26 Thread zeljko
pasman pasmaƄski wrote: > Hello. Is postgresql able to compress data sent to the client? > No. You can use ssh tunnel (with ssh compression enabled) under linux, but same thing can be applied via putty under windows. zeljko -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)

[GENERAL] why update is slower on my pc?

2010-12-26 Thread sunpeng
I use my laptop to execute the following sql, it's: mydb=# update _mcir_2597431_clusterid2 set clusterid = 3; UPDATE 104770 Time: 8666.447 ms and on my pc: mydb=# update _mcir_2597431_clusterid2 set clusterid = 3; UPDATE 104770 Time: 27171.203 ms First I wondered whether the write speed on pc is

[GENERAL] SQL queries inside a C function?

2010-12-26 Thread Elliot Chance
Hi everyone, How do I get the active connection handle from inside a C function linked as a PL/pgSQL function, like: Datum pg_do_something(PG_FUNCTION_ARGS) { PGconn *conn = ? // now do some SELECTs / INSERTs PG_RETURN_INT32(result); } Thanks, Elliot -- Sent via pgsql-general mailing

Re: [GENERAL] SQL queries inside a C function?

2010-12-26 Thread Pavel Stehule
Hello you can use a SPI interface http://www.postgresql.org/docs/9.0/interactive/spi.html regards Pavel Stehule 2010/12/26 Elliot Chance : > Hi everyone, > > How do I get the active connection handle from inside a C function linked as > a PL/pgSQL function, like: > > Datum pg_do_something(PG_

Re: [GENERAL] why update is slower on my pc?

2010-12-26 Thread Satoshi Nagayasu
On 2010/12/26, at 21:35, sunpeng wrote: > so the writing speed on disk of pc is much faster than laptop, why the update > sql command is much slower than my laptop? what's the reason causing such > decrease? Are those PostgreSQL versions and/or configurations completely same? How about shared_b

Re: [GENERAL] why update is slower on my pc?

2010-12-26 Thread Scott Marlowe
On Sun, Dec 26, 2010 at 5:35 AM, sunpeng wrote: > I use my laptop to execute the following sql, it's: > mydb=# update _mcir_2597431_clusterid2 set clusterid = 3; > UPDATE 104770 > Time: 8666.447 ms > > and on my pc: > mydb=# update _mcir_2597431_clusterid2 set clusterid = 3; > UPDATE 104770 > Time

[GENERAL] Standard schemas for common features?

2010-12-26 Thread gvim
I'm putting together a database for a web project which has a lot of HR components which I imagine are fairly standardised so, to avoid re-inventing the wheel, is there a source of standard, downloadable schemas for common projects? gvim -- Sent via pgsql-general mailing list (pgsql-general@p

[GENERAL] 2 versions of an entity worth distinct table?

2010-12-26 Thread gvim
If a table representing contact details can have 2 but no more than 2 email addresses is it really worth factoring-out email addresses to a separate table. Technically it's a 1-to-many relationship so should be done this way but what is the general practice out there in such "max. 2" situations

[GENERAL] Postgresql 9 connection problem

2010-12-26 Thread AI Rumman
I have very strange problem with my application, upon occasions I get following error when connecting to postgres. This happens without any pattern, often happens when I run some extensive tests in my application. Unable to connect to PostgreSQL server: server closed the connection unexpectedly Th