Re: [GENERAL] Fwd: lots of errors from fmgr.h when I try to write a C UDF

2014-01-31 Thread Anh Pham
Hi, I actually included 'postgres.h' However I found out that when I stopped the server, the code then compiled successfully. It's weird On Fri, Jan 31, 2014 at 10:53 PM, Ian Lawrence Barwick wrote: > 2014-02-01 Anh Pham : > > Hi, > > I had Postgres 9.3 setup and run successfully in Eclipse (Ma

Re: [GENERAL] Fwd: lots of errors from fmgr.h when I try to write a C UDF

2014-01-31 Thread Ian Lawrence Barwick
2014-02-01 Anh Pham : > Hi, > I had Postgres 9.3 setup and run successfully in Eclipse (MacOSX) > I am trying to write a C user-defined function: > > #include > ... > #ifdef PG_MODULE_MAGIC > PG_MODULE_MAGIC; > #endif > ... > > However, when I tried to compile the code: > gcc -fpic -c ... > It gav

[GENERAL] Fwd: lots of errors from fmgr.h when I try to write a C UDF

2014-01-31 Thread Anh Pham
Hi, I had Postgres 9.3 setup and run successfully in Eclipse (MacOSX) I am trying to write a C user-defined function: *#include * *...* *#ifdef PG_MODULE_MAGIC* *PG_MODULE_MAGIC;* *#endif* ... However, when I tried to compile the code: *gcc -fpic -c* ... It gave me a lot of errors and warnings fr

Re: [HACKERS] [GENERAL] Insert result does not match record count

2014-01-31 Thread Bruce Momjian
On Sat, Feb 1, 2014 at 02:25:16AM +0100, Vik Fearing wrote: > > OK, thanks for the feedback. I understand now. The contents of the > > string will potentially have a larger integer, but the byte length of > > the string in the wire protocol doesn't change. > > > > Let's wait for Vik to reply and

Re: [HACKERS] [GENERAL] Insert result does not match record count

2014-01-31 Thread Vik Fearing
On 01/31/2014 10:56 PM, Bruce Momjian wrote: > On Fri, Jan 31, 2014 at 04:38:21PM -0500, Tom Lane wrote: >> Bruce Momjian writes: >>> On Fri, Jan 31, 2014 at 06:34:27PM +0100, Vik Fearing wrote: Unfortunately, I gave up on it as being over my head when I noticed I was changing the protoc

Re: [GENERAL] pg_basebackup on standby node failed

2014-01-31 Thread Michael Paquier
On Sat, Feb 1, 2014 at 7:07 AM, Ying He wrote: > hi, All, > > I intend to do a basebackup on a hot standby node. I followed the > instructions on > http://www.postgresql.org/docs/9.2/static/app-pgbasebackup.html to turn > full_page_writes on at master and other settings on standby. > > When I try

[GENERAL] pg_basebackup on standby node failed

2014-01-31 Thread Ying He
hi, All, I intend to do a basebackup on a hot standby node. I followed  the instructions on http://www.postgresql.org/docs/9.2/static/app-pgbasebackup.html to turn full_page_writes on at master and other settings on standby. When I try to select pg_start_backup('backuplabel'); on the standby in

Re: [HACKERS] [GENERAL] Insert result does not match record count

2014-01-31 Thread Bruce Momjian
On Fri, Jan 31, 2014 at 04:38:21PM -0500, Tom Lane wrote: > Bruce Momjian writes: > > On Fri, Jan 31, 2014 at 06:34:27PM +0100, Vik Fearing wrote: > >> Unfortunately, I gave up on it as being over my head when I noticed I > >> was changing the protocol itself. I should have notified the list so >

Re: [HACKERS] [GENERAL] Insert result does not match record count

2014-01-31 Thread Tom Lane
Bruce Momjian writes: > On Fri, Jan 31, 2014 at 06:34:27PM +0100, Vik Fearing wrote: >> Unfortunately, I gave up on it as being over my head when I noticed I >> was changing the protocol itself. I should have notified the list so >> someone else could have taken over. > OK, so that brings up a g

Re: [GENERAL] Info

2014-01-31 Thread Raymond O'Donnell
On 31/01/2014 19:30, Gary Rodríguez Ramírez wrote: > Hi, I don’t want receive emails from mailing list users to my inbox > because is lot. Please helpme, thank you! You just unsubscribe instructions are in the footer of every email sent from the list. Ray. -- Raymond O'Donnell :: Galway ::

[GENERAL] Info

2014-01-31 Thread Gary Rodríguez Ramírez
Hi, I don’t want receive emails from mailing list users to my inbox because is lot. Please helpme, thank you! --- Este mensaje no contiene virus ni malware porque la protección de avast! Antivirus está activa. http://www.avast.com <>

Re: [GENERAL] postgres FDW cost estimation options unrecognized in 9.3-beta1

2014-01-31 Thread Bruce Momjian
On Fri, Jul 26, 2013 at 06:28:05PM -0400, Tom Lane wrote: > Our documentation appears not to disclose this fine point, but a look > at the SQL-MED standard says it's operating per spec. The standard also > says that ADD is an error if the option is already defined, which is a > bit more defensible

Re: [HACKERS] [GENERAL] Insert result does not match record count

2014-01-31 Thread Bruce Momjian
On Fri, Jan 31, 2014 at 06:34:27PM +0100, Vik Fearing wrote: > >> Application code that relies on the values already has problems though > >> since the returned values are pretty bogus now. Including the fact that > >> it can return 0 as the number of modified rows which is checked for more > >> fr

Re: [GENERAL] Large objects and savepoints - Snapshot reference leak

2014-01-31 Thread Alvaro Herrera
Andreas Lubensky wrote: > Hi, > > I'm trying to read/write large objects via libpq. I encapsulated the > operations in a transaction but I wanted to put a savepoint before doing > any operations, so I can do a rollback in case anything fails without > breaking the current transaction. Now, when st

Re: [HACKERS] [GENERAL] Insert result does not match record count

2014-01-31 Thread Vik Fearing
On 01/31/2014 06:19 PM, Bruce Momjian wrote: > On Wed, Jul 24, 2013 at 08:08:32PM +0200, Andres Freund wrote: >> On 2013-07-24 13:48:23 -0400, Tom Lane wrote: >>> Vik Fearing writes: Also worth mentioning is bug #7766. http://www.postgresql.org/message-id/e1tlli5-0007tr...@wrigleys.postg

Re: [HACKERS] [GENERAL] Insert result does not match record count

2014-01-31 Thread Bruce Momjian
On Wed, Jul 24, 2013 at 08:08:32PM +0200, Andres Freund wrote: > On 2013-07-24 13:48:23 -0400, Tom Lane wrote: > > Vik Fearing writes: > > > Also worth mentioning is bug #7766. > > > http://www.postgresql.org/message-id/e1tlli5-0007tr...@wrigleys.postgresql.org > > > > Yeah, did you read that who

Re: [GENERAL] Large objects and savepoints - Snapshot reference leak

2014-01-31 Thread Pavel Stehule
Hello This bug was fixed few months by Heikki Regards Pavel Dne 31.1.2014 17:35 "Andreas Lubensky" napsal(a): > Hi, > > I'm trying to read/write large objects via libpq. I encapsulated the > operations in a transaction but I wanted to put a savepoint before doing > any operations, so I can do

[GENERAL] Large objects and savepoints - Snapshot reference leak

2014-01-31 Thread Andreas Lubensky
Hi, I'm trying to read/write large objects via libpq. I encapsulated the operations in a transaction but I wanted to put a savepoint before doing any operations, so I can do a rollback in case anything fails without breaking the current transaction. Now, when sth. actually fails and the transactio

Re: [GENERAL] Temporary table already exists

2014-01-31 Thread Albe Laurenz
mephysto wrote: > Is it possible that it is read-uncommitted transaction isolation level? No; there is no such thing in PostgreSQL. The lowest isolation level is READ COMMITTED. Yours, Laurenz Albe -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your s

[GENERAL] postgres cache vs ZFS cache

2014-01-31 Thread Vick Khera
I'm looking at some performance tuning for a server running FreeBSD and the DB on top of ZFS. I keep reading the recommendation to turn off the primary data cache in ZFS since postgres does its own caching. The recommendations also say to set effective_cache_size to a significant amount of the RAM

Re: [GENERAL] Temporary table already exists

2014-01-31 Thread Adrian Klaver
On 01/31/2014 06:49 AM, mephysto wrote: Dmitriy Igrishin wrote 2014-01-31 Albe Laurenz < laurenz.albe@.gv You could try to set log_statement to "all" and see what SQL actually gets sent to the database. You could also include "EXECUTE 'DROP TABLE deck_types';" in your function. I wou

Re: [GENERAL] Temporary table already exists

2014-01-31 Thread mephysto
Dmitriy Igrishin wrote > 2014-01-31 Albe Laurenz < > laurenz.albe@.gv > >: > >> mephysto wrote: >> > Hi Albe, this is code of my stored function: >> > CREATE OR REPLACE FUNCTION :FUNCTION_SCHEMA.get_deck_types >> [...] >> > BEGIN >> [...] >> > CREATE LOCAL TEMPORARY T

Re: [GENERAL] windows binaries for FDW implementations?

2014-01-31 Thread Albe Laurenz
Chris Curvey wrote: > Is there a trove of Windows installers for FDWs? I'd like to try a > proof-of-concept with the > ODBC_FDW. > > In the meantime, I'll try to go figure out how to go about building from > source on windows, but if I > can avoid that learning curve for my POC, that would be g

[GENERAL] windows binaries for FDW implementations?

2014-01-31 Thread Chris Curvey
Is there a trove of Windows installers for FDWs? I'd like to try a proof-of-concept with the ODBC_FDW. In the meantime, I'll try to go figure out how to go about building from source on windows, but if I can avoid that learning curve for my POC, that would be great. -Chris -- I asked the Inter

Re: [GENERAL] Temporary table already exists

2014-01-31 Thread Dmitriy Igrishin
2014-01-31 Albe Laurenz : > mephysto wrote: > > Hi Albe, this is code of my stored function: > > CREATE OR REPLACE FUNCTION :FUNCTION_SCHEMA.get_deck_types > [...] > > BEGIN > [...] > > CREATE LOCAL TEMPORARY TABLE deck_types > > ON COMMIT DROP > >

Re: [GENERAL] Temporary table already exists

2014-01-31 Thread mephysto
Thank you Felix, but I would to create temporary table from stored procedure, non from application code. Thanks again. Meph -- View this message in context: http://postgresql.1045698.n5.nabble.com/Temporary-table-already-exists-tp5789852p5789877.html Sent from the PostgreSQL - general mailing

Re: [GENERAL] Temporary table already exists

2014-01-31 Thread Felix Kunde
I had a similar problem once. The pool is reusing connections and the temporary tables are still there. Now I always create new temporary tables with a unique name like this:   tmpTableId = "TMP" + Math.abs(generateUUID().hashCode()); if (tmpTableId.length() > 15)     tmpTableId = tmpTableId.su

Re: [GENERAL] Temporary table already exists

2014-01-31 Thread Albe Laurenz
mephysto wrote: > Hi Albe, this is code of my stored function: > CREATE OR REPLACE FUNCTION :FUNCTION_SCHEMA.get_deck_types [...] > BEGIN [...] > CREATE LOCAL TEMPORARY TABLE deck_types > ON COMMIT DROP > AS > SELECT > stored_fu

Re: [GENERAL] Grep'ing for a string in all functions in a schema?

2014-01-31 Thread hubert depesz lubaczewski
On Thu, Jan 30, 2014 at 12:52:35PM -0800, bricklen wrote: > > Since Postgres does not consider a table as a dependency of a function if > > that table is referenced in the function (probably a good reason), I often > > find myself in a position of asking "is this table/sequence/index > > referenced

Re: [GENERAL] Temporary table already exists

2014-01-31 Thread mephysto
Hi Albe,this is code of my stored function:ConnectionPool reuse connections, of course, but how you can see from my code, the temporary table deck_types are already defined with ON COMMIT DROP clause, so I think that my work is not in transaction. Am I true?If so, how can I put my code in transacti

Re: [GENERAL] Temporary table already exists

2014-01-31 Thread Albe Laurenz
mephysto wrote: > in my database I'm using several stored_functions that take advantage of > temporary table. The application that is connected to Postgres is a Java Web > Application in a Glassfish Application Server: it is connected by a JDBC > Connection Pool provided by Glassfish with this sett

Re: [GENERAL] Reindexing and tablespaces

2014-01-31 Thread alexandros_e
You were right. I just reindexed the DB and I saw no real changes in drive storage (those tablespaces are on separate hard disk volumes). Thanks -- View this message in context: http://postgresql.1045698.n5.nabble.com/Reindexing-and-tablespaces-tp5789827p5789853.html Sent from the PostgreSQL -

[GENERAL] Temporary table already exists

2014-01-31 Thread mephysto
Hi there, in my database I'm using several stored_functions that take advantage of temporary table. The application that is connected to Postgres is a Java Web Application in a Glassfish Application Server: it is connected by a JDBC Connection Pool provided by Glassfish with this settings: Resourc