Re: [GENERAL] Can't start postgresql server

2014-06-24 Thread Michael Paquier
On Wed, Jun 25, 2014 at 5:37 AM, ChoonSoo Park wrote: > 30022 & 30023 are symbolic links under data/pg_tblspc folder. Their target > directories are lost somehow. Does it cause this problem? I tried to delete > those 2 symbolic links but postgresql still can't start up. > Just wonder what is caus

Re: [GENERAL] Getting "cache lookup failed for aggregate" error

2014-06-24 Thread Patrick Krecker
On Tue, Jun 24, 2014 at 4:25 PM, Tom Lane wrote: > Patrick Krecker writes: > > Hello everyone -- We received a strange error today on our production > write > > master. During a routine maintenance script, we got the following error: > > > "ERROR: cache lookup failed for aggregate 5953992" > >

Re: [GENERAL] Re: Error When Trying to Use Npgsql to COPY into a PostgreSQL Database

2014-06-24 Thread Adrian Klaver
On 06/24/2014 01:37 PM, Altec103 wrote: Adrian, I actually figured it out. It was a really silly mistake - basically I was testing something earlier and edited my ODBC connection string. I was actually connecting to the wrong database and it was an empty database, so ODBCDataReader was trying to

Re: [GENERAL] Getting "cache lookup failed for aggregate" error

2014-06-24 Thread Tom Lane
Patrick Krecker writes: > Hello everyone -- We received a strange error today on our production write > master. During a routine maintenance script, we got the following error: > "ERROR: cache lookup failed for aggregate 5953992" > I think I found the culprit. We have a cron script that (among

Re: [GENERAL] Re: Error When Trying to Use Npgsql to COPY into a PostgreSQL Database

2014-06-24 Thread Adrian Klaver
On 06/24/2014 01:37 PM, Altec103 wrote: Adrian, I actually figured it out. It was a really silly mistake - basically I was testing something earlier and edited my ODBC connection string. I was actually connecting to the wrong database and it was an empty database, so ODBCDataReader was trying to

[GENERAL] Getting "cache lookup failed for aggregate" error

2014-06-24 Thread Patrick Krecker
Hello everyone -- We received a strange error today on our production write master. During a routine maintenance script, we got the following error: "ERROR: cache lookup failed for aggregate 5953992" I think I found the culprit. We have a cron script that (among other things) recreates the aggre

Re: [GENERAL] JSON Indexes

2014-06-24 Thread Vik Fearing
On 06/24/2014 10:15 PM, CS_DBA wrote: > I added a PK constraint on the id column and created this json index: > > create index mytest_json_col_idx on mytest ((task->'name')); > > However the planner never uses the index... > > > EXPLAIN SELECT (mytest.task->>'name') as name, > > COUNT((mytest.

Re: [GENERAL] JSON Indexes

2014-06-24 Thread Merlin Moncure
On Tue, Jun 24, 2014 at 3:15 PM, CS_DBA wrote: > Hi All; > > We're struggling to get the planner to use a json index. > > I have this table : > > Table "public.mytest" > > Column | Type| Modifiers > > +---+---

Re: [GENERAL] Re: Error When Trying to Use Npgsql to COPY into a PostgreSQL Database

2014-06-24 Thread Adrian Klaver
On 06/24/2014 01:37 PM, Altec103 wrote: Adrian, I actually figured it out. It was a really silly mistake - basically I was testing something earlier and edited my ODBC connection string. I was actually connecting to the wrong database and it was an empty database, so ODBCDataReader was trying to

[GENERAL] Re: Error When Trying to Use Npgsql to COPY into a PostgreSQL Database

2014-06-24 Thread Altec103
Adrian, I actually figured it out. It was a really silly mistake - basically I was testing something earlier and edited my ODBC connection string. I was actually connecting to the wrong database and it was an empty database, so ODBCDataReader was trying to pull data from an empty table. Anyways, th

[GENERAL] Can't start postgresql server

2014-06-24 Thread ChoonSoo Park
Hi, >From the pg_log folder, I can locate the following errors: LOG: database system was interrupted while in recovery at log time 2014-06-06 22:35:38 UTC HINT: If this has occurred more than once some data might be corrupted and you might need to choose an earlier recovery target. LOG: could

Re: [GENERAL] Error When Trying to Use Npgsql to COPY into a PostgreSQL Database

2014-06-24 Thread Adrian Klaver
On 06/24/2014 10:47 AM, Altec103 wrote: I am currently in the process of using an ODBC Connection and a Npgsql Connection to transfer a database from a Sybase/Advantage platform to a PostgreSQL platform using C# and the .NET framework. Below is the code I have come up with to transfer the data i

[GENERAL] JSON Indexes

2014-06-24 Thread CS_DBA
Hi All; We're struggling to get the planner to use a json index. I have this table : Table "public.mytest" Column | Type| Modifiers +---+- id | bigint| no

[GENERAL] Error When Trying to Use Npgsql to COPY into a PostgreSQL Database

2014-06-24 Thread Altec103
I am currently in the process of using an ODBC Connection and a Npgsql Connection to transfer a database from a Sybase/Advantage platform to a PostgreSQL platform using C# and the .NET framework. Below is the code I have come up with to transfer the data itself... NpgsqlCommand copyCommand = n

Re: [GENERAL] Weird error when setting up streaming replication

2014-06-24 Thread pgdude
I get the same "weird" errors (WAL file is from different database system) too with Ubuntu and Postgresql 9.3 when setting up a slave using rsync. 1. I installed postgresql on the slave (which automatically does the initdb): sudo apt-get install postgresql-9.3 2. Modified my postgresql.conf fi

Re: [GENERAL] if row has property X, find all rows that has property X

2014-06-24 Thread Merlin Moncure
On Tue, Jun 24, 2014 at 8:40 AM, David G Johnston wrote: > Дмитрий Голубь wrote >> For example I have table addresses and usually I want 2 things: >> 1. Find id of bad addresses. >> 2. Check if this address is good or bad. >> >> For this I write two plpgsql functions >> 1. find_all_bad_addresses >

Re: [GENERAL] if row has property X, find all rows that has property X

2014-06-24 Thread David G Johnston
Дмитрий Голубь wrote > For example I have table addresses and usually I want 2 things: > 1. Find id of bad addresses. > 2. Check if this address is good or bad. > > For this I write two plpgsql functions > 1. find_all_bad_addresses > 2. is_bad_address(id) > > These functions will duplicate logic

[GENERAL] if row has property X, find all rows that has property X

2014-06-24 Thread Дмитрий Голубь
For example I have table addresses and usually I want 2 things: 1. Find id of bad addresses. 2. Check if this address is good or bad. For this I write two plpgsql functions 1. find_all_bad_addresses 2. is_bad_address(id) These functions will duplicate logic of each other. How to not repeat myself