Re: [GENERAL] PostgreSQL 9.2.4 + CentOS 6.5 64 bit - segfault error in initdb

2014-06-06 Thread Bhushan Pathak
My locale is set to en_US.UTF-8, that's what the service script is using. If I try to start the server with pg_ctl command, it does start - ./pg_ctl start -D /var/lib/pgsql/data -l /tmp/logfile server starting What would this mean? The service script does not work but manually issuing pg_ctl com

[GENERAL] Postgress Doubts

2014-06-06 Thread Ravi Kiran
Hello, I am Ravikiran, pursuing my third year BITS Pilani, India, I am doing my thesis in postgress technology, The project is about implementing new join algorithms in postgres, Since I am new to postgress, could you help me in which part of source code of postgres should be looking in postgress

Re: [GENERAL] Postgress Doubts

2014-06-06 Thread Atri Sharma
On Fri, Jun 6, 2014 at 4:22 PM, Ravi Kiran wrote: > Hello, I am Ravikiran, pursuing my third year BITS Pilani, India, I am > doing my thesis in postgress technology, > > The project is about implementing new join algorithms in postgres, Since I > am new to postgress, could you help me in which pa

Re: [GENERAL] Optimizer issue -- bad query plan?

2014-06-06 Thread Moshe Jacobson
On Thu, Jun 5, 2014 at 7:19 PM, Tom Lane wrote: We need to see the actual view definition and calling query, > not a simplified "equivalent" query. > The simple query has the same performance issues as the view. What help would it be to see the view? I can provide any other information you want,

[GENERAL] interpret bytea output as text / double encode()

2014-06-06 Thread Stefan Froehlich
In one of my databases, I have mistakenly double encoded bytea values (i.e. the content is literally '\x202020...' which would have to be decoded once more to get the actually desired content). But how to get to the content? This: # select encode(column, 'escape') gives me the once-only encoded

[GENERAL] Trigger to convert UNIX time to timestamp without time zone.

2014-06-06 Thread Alberto Olivares
Hello, I want to insert data into a column "timestamp without time zone" data type. The problem is I am receiving the data in UNIX time. How can I create a trigger to transform the time from UNIX to timestamp without time zone every time a new record is inserted into my database? Thank you in ad

Re: [GENERAL] interpret bytea output as text / double encode()

2014-06-06 Thread Rob Sargent
Sent from my iPhone > On Jun 6, 2014, at 7:00 AM, Stefan Froehlich > wrote: > > In one of my databases, I have mistakenly double encoded bytea > values (i.e. the content is literally '\x202020...' which would have > to be decoded once more to get the actually desired content). > > But how to

Re: [GENERAL] Trigger to convert UNIX time to timestamp without time zone.

2014-06-06 Thread Adrian Klaver
On 06/06/2014 06:19 AM, Alberto Olivares wrote: Hello, I want to insert data into a column "timestamp without time zone" data type. The problem is I am receiving the data in UNIX time. How can I create a trigger to transform the time from UNIX to timestamp without time zone every time a new rec

Re: [GENERAL] interpret bytea output as text / double encode()

2014-06-06 Thread Stefan Froehlich
> > # select encode(encode(column, 'escape'), 'escape') > Any chance you can encode() into temp table then encode() the result. Don't think so, PostgreSQL will recognize the temp column either as text or as bytea and then refuse either the insert or the encode() because of a type mismatch. An

Re: [GENERAL] Trigger to convert UNIX time to timestamp without time zone.

2014-06-06 Thread Andrew Sullivan
On Fri, Jun 06, 2014 at 02:19:50PM +0100, Alberto Olivares wrote: > How can I create a trigger to transform the time from UNIX to timestamp > without time zone every time a new record is inserted into my database? This is in the manual, section 9.8: to_timestamp(double precision) It's always a li

Re: [GENERAL] PostgreSQL 9.2.4 + CentOS 6.5 64 bit - segfault error in initdb

2014-06-06 Thread Adrian Klaver
On 06/06/2014 12:29 AM, Bhushan Pathak wrote: My locale is set to en_US.UTF-8, that's what the service script is using. If I try to start the server with pg_ctl command, it does start - ./pg_ctl start -D /var/lib/pgsql/data -l /tmp/logfile server starting What would this mean? The service scr

Re: [GENERAL] PostgreSQL 9.2.4 + CentOS 6.5 64 bit - segfault error in initdb

2014-06-06 Thread Adrian Klaver
On 06/06/2014 12:29 AM, Bhushan Pathak wrote: My locale is set to en_US.UTF-8, that's what the service script is using. If I try to start the server with pg_ctl command, it does start - ./pg_ctl start -D /var/lib/pgsql/data -l /tmp/logfile server starting What would this mean? The service scr

Re: [GENERAL] Postgresql service stopped automatically after restart

2014-06-06 Thread Adrian Klaver
On 06/04/2014 10:31 PM, Kalai R wrote: Thank You for your suggestions. In silent installation we use the following code in vb.net to install postgres xinststr =" --mode unattended --superaccount --superpassword--serviceaccount --servicepassword--serverport --unat

[GENERAL] How to select rows for which column has empty array ?

2014-06-06 Thread Arup Rakshit
I have a below table : yelloday_development=# select id,workplace_ids,team_ids  from reporting_groups ;                                                                                                                                                                                       id | work

Re: [GENERAL] interpret bytea output as text / double encode()

2014-06-06 Thread Tom Lane
Stefan Froehlich writes: > ... Casting the result does not work either: > # select encode(encode(column, 'escape')::bytea, 'escape') > because the cast reverts the effect of the first encode(), so the result > does not change. Since there's no explicitly defined cast from text to bytea accordin

Re: [GENERAL] PostgreSQL 9.2.4 + CentOS 6.5 64 bit - segfault error in initdb

2014-06-06 Thread Tom Lane
Bhushan Pathak writes: >>> Stopping postgresql service: [ OK ] >>> Starting postgresql service: [FAILED] >>> >>> pgstartup log has the same line - >>> Segmentation fault (core dumped) >>> >>> Where is this core dump file generated? How

Re: [GENERAL] interpret bytea output as text / double encode()

2014-06-06 Thread Stefan Froehlich
On Fri, Jun 06, 2014 at 10:30:56AM -0400, Tom Lane wrote: > It's possible that what you are looking for is a binary-equivalent > cast from text to bytea, which you could create like this: > # create cast (text as bytea) without function; Hm. No, actually it does not help. But playing around with

Re: [GENERAL] How to select rows for which column has empty array ?

2014-06-06 Thread David G Johnston
Arup Rakshit wrote > I have a below table : > > yelloday_development=# select id,workplace_ids,team_ids  from > reporting_groups ;                                                         >                                                                           >                                  

[GENERAL] Problem with locales on Linux with 9.3.4

2014-06-06 Thread hubert depesz lubaczewski
Hi, I'm running Pg 9.3.4 on Ubuntu Linux 12.04/Precise. Pg is installed from PGDG repo (http://apt.postgresql.org/pub/repos/apt/). It somehow got database created in locale that it can't now open: $ psql psql: FATAL: database locale is incompatible with operating system DETAIL: The database was

Re: [GENERAL] How to select rows for which column has empty array ?

2014-06-06 Thread Bosco Rama
On 06/06/14 07:30, Arup Rakshit wrote: > > How would I select rows which has empty array for the field "team_ids" ? The shortest way is to test against an empty array constant: select id from reporting_groups where team_ids = '{}'; Or you can test using array_length(). Or you test against an

Re: [GENERAL] bytea Issue - Reg

2014-06-06 Thread sramay
Sir, The base table is having bytea and having records around 32 lakhs shows size of 300 mb. bytea field has attached documents size is not shown in the base table. The message on Tomcat is --begin text -- 4 Jun, 2014 3:29:07 PM org.apache.catalina.core.StandardWrapperValve invoke INFO: WARN [

[GENERAL] Trigger function permissions

2014-06-06 Thread Keith Fiske
Just want to make sure I'm understanding the permissions needed for trigger functions as well as making sure this is what the developers intended before I go assuming things will always work this way. Also as a sanity check for myself that I'm not missing something obvious. I have an extension (ht

Re: [GENERAL] bytea Issue - Reg

2014-06-06 Thread Alan Hodgson
On Wednesday, June 04, 2014 10:49:18 PM sramay wrote: > relation "public.file_attachments" does not exist .. is almost certainly not a size problem. What does your PostgreSQL log say? I suspect your app is connecting to the wrong database. -- Sent via pgsql-general mailing list (pgsql-general@

Re: [GENERAL] Problem with locales on Linux with 9.3.4

2014-06-06 Thread Adrian Klaver
On 06/06/2014 09:05 AM, hubert depesz lubaczewski wrote: Hi, I'm running Pg 9.3.4 on Ubuntu Linux 12.04/Precise. Pg is installed from PGDG repo (http://apt.postgresql.org/pub/repos/apt/). It somehow got database created in locale that it can't now open: $ psql psql: FATAL: database locale is i

Re: [GENERAL] bytea Issue - Reg

2014-06-06 Thread Adrian Klaver
On 06/04/2014 10:49 PM, sramay wrote: Sir, The base table is having bytea and having records around 32 lakhs shows size of 300 mb. bytea field has attached documents size is not shown in the base table. The message on Tomcat is --begin text -- 4 Jun, 2014 3:29:07 PM org.apache.catalina.core.

Re: [GENERAL] Problem with locales on Linux with 9.3.4

2014-06-06 Thread hubert depesz lubaczewski
locale-gen just regenerates the locale - which I have. It's just that PostgreSQL doesn't see it. When I run locale-gen, it just shows that all locales (listed by locale -a) are "up to date". depesz On Fri, Jun 6, 2014 at 10:04 PM, Adrian Klaver wrote: > On 06/06/2014 09:05 AM, hubert depesz lu

Re: [GENERAL] Problem with locales on Linux with 9.3.4

2014-06-06 Thread Adrian Klaver
On 06/06/2014 04:36 PM, hubert depesz lubaczewski wrote: locale-gen just regenerates the locale - which I have. It's just that PostgreSQL doesn't see it. When I run locale-gen, it just shows that all locales (listed by locale -a) are "up to date". Did you do 'dpkg-reconfigure locales' after the

Re: [GENERAL] Problem with locales on Linux with 9.3.4

2014-06-06 Thread Adrian Klaver
On 06/06/2014 04:36 PM, hubert depesz lubaczewski wrote: locale-gen just regenerates the locale - which I have. It's just that PostgreSQL doesn't see it. When I run locale-gen, it just shows that all locales (listed by locale -a) are "up to date". On further reading another way would be to use