[GENERAL] Question about PARTIAL DATE type/s

2012-10-07 Thread r d
Hi, I have text fields which contains dates in the format 'MM' (four positions for the year, two for the month). These fields are contained in text files which I load into the DB. When I convert this field to a date using to_date("PARTIAL_DATE_FIELD",'MM'); -- (a cast won't recog

Re: [GENERAL] Question about PARTIAL DATE type/s

2012-10-07 Thread Daniele Varrazzo
On Sun, Oct 7, 2012 at 12:28 PM, r d wrote: > Hi, > > I have text fields which contains dates in the format 'MM' (four > positions for the year, two for the month). > These fields are contained in text files which I load into the DB. > > When I convert this field to a date using > > to

[GENERAL] [Mac OS X Mountain Lion] FATAL: could not create shared memory segment: Cannot allocate memory

2012-10-07 Thread Yvon Thoraval
I've just installed PostgreSQL, using brew, on Mac OS Mountain Lion. The server doesn't start and the log file shows : $ cat /usr/local/var/postgres/server.log FATAL: could not create shared memory segment: Cannot allocate memory DETAIL: Failed system call was shmget(key=5432002, size=3809280, 0

Re: [GENERAL] Question about PARTIAL DATE type/s

2012-10-07 Thread Tom Lane
Daniele Varrazzo writes: > Note: it exploits to_date() parsing '200013' as '2001-01', which is > reasonable but haven't found documented and don't know how much > reliable. Writing a safer "one month later" function is left as > exercise. Consider adding '1 month'::interval to the month start dat

Re: [GENERAL] Help with query timeout

2012-10-07 Thread Edson Richter
Em 07/10/2012 02:46, Andreas Kretschmer escreveu: Edson Richter wrote: Dear friends, I'm using Java 1.6 with Jdbc 4 driver with PostgreSQL 9.1.5 on Windows 64 and Linux 64. Trying to use setQueryTimeout(int), I get the following stack trace: Internal Exception: org.postgresql.util.PSQLExcepti

Re: [GENERAL] Question about PARTIAL DATE type/s

2012-10-07 Thread Daniele Varrazzo
On Sun, Oct 7, 2012 at 3:03 PM, Tom Lane wrote: > Daniele Varrazzo writes: >> Note: it exploits to_date() parsing '200013' as '2001-01', which is >> reasonable but haven't found documented and don't know how much >> reliable. Writing a safer "one month later" function is left as >> exercise. > >

Re: [GENERAL] 'full_page_writes=off' , VACUUM and crashing streaming slaves...

2012-10-07 Thread Tom Lane
Sean Chittenden writes: >> If you've got the postmaster logs from this episode, it would be useful >> to see what complaints got logged. > The first crash scenario: > Oct 5 15:00:24 db01 postgres[75852]: [6449-2] javafail@dbcluster 75852 0: > STATEMENT: SELECT /* query */ FROM tbl AS this_ WH

Re: [GENERAL] [Mac OS X Mountain Lion] FATAL: could not create shared memory segment: Cannot allocate memory

2012-10-07 Thread John R Pierce
On 10/07/12 6:30 AM, Yvon Thoraval wrote: What is the workaround ? exactly what the error says to do, increase SHMMAX and SHMMAL in your kernel configuration. on differnet unix-like systems you do this differently (/etc/system on vintage Solaris, /etc/sysctl.conf on most Linux distros, et

Re: [GENERAL] [Mac OS X Mountain Lion] FATAL: could not create shared memory segment: Cannot allocate memory

2012-10-07 Thread Scott Marlowe
On Sun, Oct 7, 2012 at 7:30 AM, Yvon Thoraval wrote: > > I've just installed PostgreSQL, using brew, on Mac OS Mountain Lion. > The server doesn't start and the log file shows : > > $ cat /usr/local/var/postgres/server.log > FATAL: could not create shared memory segment: Cannot allocate memory >

Re: [GENERAL] [Mac OS X Mountain Lion] FATAL: could not create shared memory segment: Cannot allocate memory

2012-10-07 Thread Yvon Thoraval
2012/10/7 Scott Marlowe > http://www.postgresql.org/docs/9.2/static/kernel-resources.html OK, fine thanks to both. I've found a page dealing with that prob : Fixing the postgresql initdb fatal shared memory error on Leopard

Re: [GENERAL] [PL/PGSQL] column name substitution in PG8.4

2012-10-07 Thread Vincent Veyron
Le mercredi 03 octobre 2012 à 22:15 -0500, Merlin Moncure a écrit : > Really though, upgrading the database makes the most sense IMO. 8.4 > indicates that your customer is probably sticking with the rhel stock > packaging Could be Debian Stable too... -- Vincent Veyron http://marica.fr/ Ges

Re: [GENERAL] Question about PARTIAL DATE type/s

2012-10-07 Thread r d
I suspected that this would be the answer. Thank you lots for your kind help, Daniele & Tom [?] On 7 October 2012 16:46, Daniele Varrazzo wrote: > On Sun, Oct 7, 2012 at 3:03 PM, Tom Lane wrote: > > Daniele Varrazzo writes: > >> Note: it exploits to_date() parsing '200013' as '2001-01', which

Re: [GENERAL] [Mac OS X Mountain Lion] FATAL: could not create shared memory segment: Cannot allocate memory

2012-10-07 Thread Scott Marlowe
On Sun, Oct 7, 2012 at 1:59 PM, Yvon Thoraval wrote: > > > 2012/10/7 Scott Marlowe >> >> http://www.postgresql.org/docs/9.2/static/kernel-resources.html > > OK, fine thanks to both. > > I've found a page dealing with that prob : > Fixing the postgresql initdb fatal shared memory error on Leopard

Re: [GENERAL] function return value inside a trigger function

2012-10-07 Thread joao tiago a. m. viegas
sorry for the late update thank you all, I found the cause, that specific sentence was correct, it was in another sentence of the same function, I think it was late at night and I was tired. thank you anyway best regards jtv On 27 September 2012 02:26, Tom Lane wrote: > joao viegas writes:

Re: [GENERAL] 'full_page_writes=off' , VACUUM and crashing streaming slaves...

2012-10-07 Thread Sean Chittenden
> So that explains the crashes, but it doesn't (directly) explain why you > had data corruption. The first crash message: Oct 5 15:00:21 db01 postgres[75852]: [6406-1] failjava@dbcluster 75852 0: ERROR: could not seek to end of file "base/16387/18770": Too many open files in system Oct 5 15:

Re: [GENERAL] [Mac OS X Mountain Lion] FATAL: could not create shared memory segment: Cannot allocate memory

2012-10-07 Thread Yvon Thoraval
2012/10/7 Scott Marlowe > 'd have posted more, but > > 1: I know just enough about MacOS to be dangerous and > 2: MacOS is known for changing how shared memory works from one minor > patch to another so.. > 3: Any page on making work will be dependent on the exact MacOS > version you are running.

[GENERAL] postgres 9.1 pgsql_tmp directory location of specific database?

2012-10-07 Thread shehab adean sherif
where should be the location of pgsql_tmp directory of specific database i've searched in /var/lib/postgresql/9.1/main/base/database OID and i didn't find it, should i create it by my self? -- Shehab

Re: [Pgbouncer-general] [GENERAL] Again, problem with pgbouncer

2012-10-07 Thread Wolf Schwurack
Sorry but you are showing two different paths Your first email showed this path /var/log/pgbouncer.log And now you are stating this, which would be correct /var/log/pgbouncer/pgbouncer.log Wolf -Original Message- From: Phoenix Kiula [mailto:phoenix.ki...@gmail.com] Sent: Friday, Octo

[GENERAL] server process (PID 1304) was terminated by exception 0xC0000142

2012-10-07 Thread Haiming Zhang
Hi all, I am Haiming, a software engineer. One of our product is depending on PostgreSQL. I am facing a problem that it somehow always gave me an error " server process (PID 1304) was terminated by exception 0xC142." or " No buffer space available (maximum connections reached?): connect".

Re: [GENERAL] server process (PID 1304) was terminated by exception 0xC0000142

2012-10-07 Thread gelin yan
On Mon, Oct 8, 2012 at 9:02 AM, Haiming Zhang wrote: > Hi all, > > ** ** > > I am Haiming, a software engineer. > > ** ** > > One of our product is depending on PostgreSQL. I am facing a problem that > it somehow always gave me an error " server process (PID 1304) was > terminated by exce

Re: [GENERAL] server process (PID 1304) was terminated by exception 0xC0000142

2012-10-07 Thread Scott Marlowe
On Sun, Oct 7, 2012 at 9:27 PM, gelin yan wrote: > > > On Mon, Oct 8, 2012 at 9:02 AM, Haiming Zhang > wrote: >> >> Hi all, >> >> >> >> I am Haiming, a software engineer. >> >> >> >> One of our product is depending on PostgreSQL. I am facing a problem that >> it somehow always gave me an error "