[GENERAL] vacuuming - doubt

2013-12-11 Thread Jayadevan M
Hi, Another theory question - PostgreSQL documentation says that - "There are two variants of VACUUM: standard VACUUM and VACUUM FULL. VACUUM FULL can reclaim more disk space " I created a table, inserted 1000 records and deleted them. The size after a vacuum and a vacuum full are given - select pg

Re: [GENERAL] Return setof values from C-function

2013-12-11 Thread Yuriy Rusinov
I have received an error The connection to the server was lost. Attempting reset: Failed This problem was solved using by C-strings instead of Datum such as FuncCallContext *funcctx; int call_cntr; int max_calls; AttInMetadata *attinmeta; unsigned long il; TupleDesc tupde

Re: [GENERAL] Question about optimizing access to a table.

2013-12-11 Thread Herouth Maoz
On 10/12/2013, at 20:55, Jeff Janes wrote: > > On Tue, Dec 10, 2013 at 8:23 AM, Herouth Maoz wrote: > > Hello. > > I have one particular table with very specialized use. I am sending messages > to some partner. The partner processes them asynchronously, and then returns > the status report

[GENERAL] build from source with MSVC

2013-12-11 Thread Philipp Kraus
Hello, I must build the pg library from sources under MSVC 2010 and later 2012. Under OSX & Linux I call the configure / make tools and I can build the lib well, but is there a project structure for building under MSVC? So how can I build the postgres library (shared / static version) under MSVC

Re: [GENERAL] Question about optimizing access to a table.

2013-12-11 Thread Herouth Maoz
On 10/12/2013, at 20:55, Kevin Grittner wrote: > Herouth Maoz wrote: > >> The problem starts when our partner has some glitch, under high >> load, and fails to send back a few hundred thousand reports. In >> that case, the table grows to a few hundred records, and they are >> not deleted until

Re: [GENERAL] Trigger Firing Order

2013-12-11 Thread Sameer Kumar
> > But with certain packaged products who create their own triggers, I won't >> have control over this. > I don't have a lot of sympathy for that argument. If the product is > capable of creating Postgres-compatible triggers at all, it should be > aware that the name is a significant property,

Re: [GENERAL] Case sensitivity

2013-12-11 Thread Dev Kumkar
Thanks John. Yes CITEXT would work, the only thing its needs DDL changes across and hence was looking for any such global database parameter setting while creating database. I have been looking at other discussions and doesn't look like anything of that coming up soon that makes database case inse

[GENERAL] Scheduled Events

2013-12-11 Thread Dev Kumkar
How to create scheduled events in postgres simillar to whats event in Sybase. Is there any method of doing so? Also am looking at PgAgent which can create jobs but is it similar like events in sybase. Please suggest. Regards...

[GENERAL] Convert table to view 9.1

2013-12-11 Thread salah jubeh
Hello Guys, ERROR:  could not convert table "b" to a view because it has triggers HINT:  In particular, the table cannot be involved in any foreign key relationships. ** Error ** ERROR: could not convert table "b" to a view because it has triggers SQL state: 55000 Hint: In parti

Re: [GENERAL] validate synatax

2013-12-11 Thread Szymon Guz
On 10 December 2013 22:57, Peter Kroon wrote: > >Why do you want to do that? > I want to validate the SQL syntax and preferably in the browser using some > kind of linter. > > >You can always run it inside transaction and rollback at the end. > Sounds dangerous and will make the server very activ

Re: [GENERAL] Convert table to view 9.1

2013-12-11 Thread Albe Laurenz
salah jubeh wrote: > ERROR: could not convert table "b" to a view because it has triggers > HINT: In particular, the table cannot be involved in any foreign key > relationships. > > ** Error ** > > ERROR: could not convert table "b" to a view because it has triggers > SQL stat

Re: [GENERAL] validate synatax

2013-12-11 Thread Michael Paquier
On Wed, Dec 11, 2013 at 9:11 PM, Szymon Guz wrote: > This would simply be as complicated as the database itself, and I'm sure > that if I had to implement such a validator, I would just finish with > embedding the query in a transaction rolled back at the end, and run it on > some test database. S

Re: [GENERAL] validate synatax

2013-12-11 Thread Jov
you can use the transition. eg: begin; creat table(...); catch error if the statement not validated. rollback; jov 在 2013-12-11 上午5:43,"Peter Kroon" 写道: > Hi, > > How can I validate any query on PostgreSQL without executing the sql. > I was able with EXPLAIN to find some errors. However this only

Re: [GENERAL] Convert table to view 9.1

2013-12-11 Thread salah jubeh
>> ERROR:  could not convert table "b" to a view because it has triggers >> HINT:  In particular, the table cannot be involved in any foreign key >> relationships. >> >> ** Error ** >> >> ERROR: could not convert table "b" to a view because it has triggers >> SQL state: 55000 >>

Re: [GENERAL] build from source with MSVC

2013-12-11 Thread Michael Paquier
On Wed, Dec 11, 2013 at 7:20 PM, Philipp Kraus wrote: > I must build the pg library from sources under MSVC 2010 and later 2012. > Under OSX & Linux I call the configure / make tools and I can build > the lib well, but is there a project structure for building under MSVC? All the tools and script

[GENERAL] Postgres Cluster - How Many Nodes?

2013-12-11 Thread Lee Nguyen
I'm trying to setup a postgres replicated cluster for the first time, and I'm not sure of the hardware setup we need. What we would like is to have synchronously replicated postgresql instances running in one data center which also asynchronously replicates to a remote data center (in case of a di

Re: [GENERAL] Convert table to view 9.1

2013-12-11 Thread Albe Laurenz
salah jubeh wrote: >> http://www.postgresql.org/docs/current/static/catalog-pg-class.html >> relhastriggers boolTrue if table has (or once had) triggers > >> This is what is queried when you try to convert the table into a view. >> So there is no way to convert your table to a view unless you

Re: [GENERAL] validate synatax

2013-12-11 Thread Peter Kroon
Perhaps creating a temporary table would be more efficient. Then the rollback isn't necessary. 2013/12/11 Jov > you can use the transition. > eg: > begin; > creat table(...); > catch error if the statement not validated. > rollback; > > jov > 在 2013-12-11 上午5:43,"Peter Kroon" 写道: > > Hi, >> >>

Re: [GENERAL] validate synatax

2013-12-11 Thread Szymon Guz
On 11 December 2013 15:35, Peter Kroon wrote: > Perhaps creating a temporary table would be more efficient. > Then the rollback isn't necessary. > > > Yep, but only if you're sure that you don't have queries which change other parts of the database, including calling procedures which could change

Re: [GENERAL] [ADMIN] Scheduled Events

2013-12-11 Thread Dev Kumkar
Resending... On Wed, Dec 11, 2013 at 8:29 PM, Dev Kumkar wrote: > Yes actually that's one alternate solution to use cron or windows > scheduled tasks. > > The intent is to call certain stored procedures at certain time intervals. > > > On Wed, Dec 11, 2013 at 7:24 PM, Payal Singh wrote: > >> Yo

Re: [GENERAL] Case sensitivity

2013-12-11 Thread Dev Kumkar
Can case-insensitive collation help here? On Wed, Dec 11, 2013 at 4:55 PM, Dev Kumkar wrote: > Thanks John. > > Yes CITEXT would work, the only thing its needs DDL changes across and > hence was looking for any such global database parameter setting while > creating database. I have been lookin

Re: [GENERAL] Case sensitivity

2013-12-11 Thread Andrew Sullivan
On Wed, Dec 11, 2013 at 04:55:07PM +0530, Dev Kumkar wrote: > creating database. I have been looking at other discussions and doesn't > look like anything of that coming up soon that makes database case > insensitive. You could build lower() indexes on any column you want to search CI and lower()

Re: [GENERAL] Convert table to view 9.1

2013-12-11 Thread salah jubeh
salah jubeh wrote: >>> http://www.postgresql.org/docs/current/static/catalog-pg-class.html >>> relhastriggers bool    True if table has (or once had) triggers >> >>> This is what is queried when you try to convert the table into a view. >>> So there is no way to convert your table to a view unles

Re: [GENERAL] Trigger Firing Order

2013-12-11 Thread Kevin Grittner
Sameer Kumar wrote: > If I have a trigger which add primary key to my inserted row > ("before trigger"). Now if I plan to create new set of triggers > for AUDITING or replication (where either I have no flexibility > of choosing a name or the trigger name has to follow a standard), > then I need

Re: [GENERAL] Convert table to view 9.1

2013-12-11 Thread Tom Lane
salah jubeh writes: > create table a (id int primary key); > create table b (id int primary key, a_id int references a (id)); > insert into  a values (1); > insert into  b values (1,1); > create table c AS SELECT * FROM b; > TRUNCATE b; > ALTER TABLE b DROP CONSTRAINT b_a_id_fkey; > ALTER TABLE

Re: [GENERAL] Trigger Firing Order

2013-12-11 Thread Sameer Kumar
That sounds like a nice suggestion. I guess it could get rid of most of the issues I forsee. I should follow that for my cases too. I guess we can live without an ORDER clause. Thanks everyone for helping.

Re: [GENERAL] Case sensitivity

2013-12-11 Thread Dev Kumkar
Actually for searches lower will work. But the other important aspect is 'inserts' which would result 2 rows if the values are 'A' and 'a'. Intent here to have it case insensitive. If CITEXT it will update the same row and works. CITEXT is an alternative but was wondering if there is any other alt

Re: [GENERAL] Question about optimizing access to a table.

2013-12-11 Thread Kevin Grittner
Herouth Maoz wrote: > On 10/12/2013, at 20:55, Kevin Grittner wrote: >> First, make sure that you are on the latest minor release of >> whatever major release you are running.  There were some serious >> problems with autovacuum's table truncation when a table was >> used as a queue and size fluc

Re: [GENERAL] Question about optimizing access to a table.

2013-12-11 Thread Jeff Janes
On Wed, Dec 11, 2013 at 1:49 AM, Herouth Maoz wrote: > > On 10/12/2013, at 20:55, Jeff Janes wrote: > > > On Tue, Dec 10, 2013 at 8:23 AM, Herouth Maoz wrote: > >> >> Hello. >> >> I have one particular table with very specialized use. I am sending >> messages to some partner. The partner processe

Re: [GENERAL] Convert table to view 9.1

2013-12-11 Thread salah jubeh
Hello Tom, >Patient: Doctor, it hurts when I do this. >Doctor: So, don't do that. >Why would you think this is a good thing to do?  Why not just rename >table b to c, and then create the view as b? >(For context, it's not even considered a supported operation to >manually create _RETURN rules lik

Re: [GENERAL] vacuuming - doubt

2013-12-11 Thread Scott Marlowe
On Wed, Dec 11, 2013 at 1:08 AM, Jayadevan M wrote: > Hi, > Another theory question - > PostgreSQL documentation says that - > "There are two variants of VACUUM: standard VACUUM and VACUUM FULL. VACUUM > FULL can reclaim more disk space " > I created a table, inserted 1000 records and deleted them

Re: postgresql.org inconsistent (Re: [GENERAL] PG replication across DataCenters)

2013-12-11 Thread Wolfgang Keller
> >> postgresql-xc is not postgresql, its a fork. > > > It would at least merit being mentioned in the doc, just like other > > "forks" or whatever you may call it, as long as they're open-source. > > You seem to not realize how many forks of Postgres there are. I had mentioned just one. And th

Re: postgresql.org inconsistent (Re: [GENERAL] PG replication across DataCenters)

2013-12-11 Thread Sameer Kumar
To be honest your request/demand expectation is quite unfair. have you seen cross link on Suse and Red Hat and Ubuntu and SE Linux and Debian and... (well I would need a google search for adding more here) By far I guess PostgreSQL community documentation is the one of the most organized doc store

Re: [Postgres-xc-general] [GENERAL] "Tuple not found error" during Index creation

2013-12-11 Thread Sandeep Gupta
Hi Mason, Thank you so much for taking the time. We are using pgxc 1.1. This was the stable release. Let me give it a try with commits from previous versions. May take some time. I will get back to you with an update. -Sandeep On Wed, Dec 11, 2013 at 8:55 AM, Mason Sharp wrote: > > > > On T

Re: [Postgres-xc-general] [GENERAL] "Tuple not found error" during Index creation

2013-12-11 Thread 鈴木 幸市
We made changes in internal snapshot handling to solve another problem around last December to January. It will be very helpful if you try commits before and after this period. This period’s change could be most suspect. Best; --- Koichi Suzuki 2013/12/12 9:19、Sandeep Gupta mailto:gupta.san

Re: postgresql.org inconsistent (Re: [GENERAL] PG replication across DataCenters)

2013-12-11 Thread Michael Paquier
On Thu, Dec 12, 2013 at 3:19 AM, Wolfgang Keller wrote: >> >> postgresql-xc is not postgresql, its a fork. >> >> > It would at least merit being mentioned in the doc, just like other >> > "forks" or whatever you may call it, as long as they're open-source. >> >> You seem to not realize how many fo

[GENERAL] Npgsql - Where can I find Npgsql.NpgsqlServices

2013-12-11 Thread Mike Christensen
It seems I need NpgsqlServices to use Npgsql with EF6, however I can't figure out where you get this thing! I've tried installing it through NuGet: PM> Install-Package Npgsql -pre Installing 'Npgsql 2.0.14.1'. Successfully installed 'Npgsql 2.0.14.1'. Adding 'Npgsql 2.0.14.1' to EFTest. Successfu

[GENERAL] Is it possible that session lock is not released

2013-12-11 Thread T
Hi, I just found that ShutdownPostgres() only releases USER_LOCKMETHOD locks, so why not release DEFAULT_LOCKMETHOD locks? Check if this is possible: We are doing a CREATE INDEX CONCURRENTLY, and codes runs to LockRelationIdForSession(&heaprelid, ShareUpdateExclusiveLock); PopAct

Re: [GENERAL] vacuuming - doubt

2013-12-11 Thread Jayadevan
Scott Marlowe-2 wrote > 30 second vacuum lesson: Thank you. -- View this message in context: http://postgresql.1045698.n5.nabble.com/vacuuming-doubt-tp5782828p5783057.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list (pgsql-g

Re: postgresql.org inconsistent (Re: [GENERAL] PG replication across DataCenters)

2013-12-11 Thread Chris Travers
Postgres-XC isn't PostgreSQL. Entirely different product. > > Anyone can add pages to the wiki, and there's lots of information > there about things that aren't postgresql, Postgres-XC is just > one of those. > I think "entirely different product" is not really accurate. It isn't just a fork, but

Re: [GENERAL] Is it possible that session lock is not released

2013-12-11 Thread Tom Lane
T writes: > Now transaction goes to default state, then this backend is killed or some > FATAL error happens, > AbortOutOfAnyTransaction() in ShutdownPostgres() will do nothing since > transaction is in default > state, and session lock on heaprelid is still held after ShutdownPostgres(), > so

Re: [GENERAL] Case sensitivity

2013-12-11 Thread Dev Kumkar
On Wed, Dec 11, 2013 at 9:47 PM, Dev Kumkar wrote: > Actually for searches lower will work. > But the other important aspect is 'inserts' which would result 2 rows if > the values are 'A' and 'a'. Intent here to have it case insensitive. > > If CITEXT it will update the same row and works. > CITE

Re: [GENERAL] Case sensitivity

2013-12-11 Thread Dev Kumkar
+ hackers On Thu, Dec 12, 2013 at 12:34 PM, Dev Kumkar wrote: > On Wed, Dec 11, 2013 at 9:47 PM, Dev Kumkar wrote: > >> Actually for searches lower will work. >> But the other important aspect is 'inserts' which would result 2 rows if >> the values are 'A' and 'a'. Intent here to have it case in