[GENERAL] Junk date getting uploaded into date field

2013-11-05 Thread bsreejithin
We have a csv file which we upload into postgres DB. If there are some errors, like a data mismatch with the database table columns, postgres should raise and error and upload should fail. What is happening now is that, in case we get some junk date in the upload file, postgres does

Re: [GENERAL] Junk date getting uploaded into date field

2013-11-05 Thread John R Pierce
On 11/5/2013 1:04 AM, bsreejithin wrote: A wrong date like ,say, 33-Oct-2013 gets converted as 2-Nov-2013 when the data is loaded into a date field. No error raised.Data gets uploaded! um. postgresql won't do that conversion postgres=# select '33-Oct-2013'::date; ERROR: date/time field

[GENERAL] Keepalive doubt.

2013-11-05 Thread Francisco Olarte
Hello everybody: I've found three server configuration parameters, tcp_keepalives_{idle,interval,count} which control keepalive behaviour. I know them, I know which my system defaults are, and I know their default values, and I suppose in my systems ( linux ) they correspond to setsockopt's of

Re: [GENERAL] Junk date getting uploaded into date field

2013-11-05 Thread Thomas Kellerer
bsreejithin, 05.11.2013 10:04: We have a csv file which we upload into postgres DB. If there are some errors, like a data mismatch with the database table columns, postgres should raise and error and upload should fail. What is happening now is that, in case we get some junk date in the

Re: [GENERAL] Keepalive doubt.

2013-11-05 Thread Scott Marlowe
On Tue, Nov 5, 2013 at 2:29 AM, Francisco Olarte fola...@peoplecall.com wrote: Hello everybody: I've found three server configuration parameters, tcp_keepalives_{idle,interval,count} which control keepalive behaviour. I know them, I know which my system defaults are, and I know their default

Re: [GENERAL] WITH RECURSIVE doesn't work properly for me

2013-11-05 Thread Albe Laurenz
Jing Fan wrote: I use following command to get a shortest-path query: with recursive paths( src_id, dest_id, dist) as( select n1,n2,1 from nodes union select src_id, dest_id, min(dist) from ( select paths.src_id as src_id, nodes.n2 as dest_id,

Re: [GENERAL] Junk date getting uploaded into date field

2013-11-05 Thread bsreejithin
Not able to post the attached details as a comment in the reply box, so attaching it as an image file : http://postgresql.1045698.n5.nabble.com/file/n5776987/Untitled.png -- View this message in context:

Re: [GENERAL] Junk date getting uploaded into date field

2013-11-05 Thread Thomas Kellerer
bsreejithin, 05.11.2013 13:14: Not able to post the attached details as a comment in the reply box, so attaching it as an image file : http://postgresql.1045698.n5.nabble.com/file/n5776987/Untitled.png It would have much easier if you had simply used copy paste to post a text version of

Re: [GENERAL] Junk date getting uploaded into date field

2013-11-05 Thread bsreejithin
I am not using any mail client.I was directly trying to post the content I attached.Got a connection reset by peer error on submit.Thought some issue with the browser - so tried with firefox, chrome as well, in addition to IE - got the same error there also. Any way, that's not the issue. I am

Re: [GENERAL] Junk date getting uploaded into date field

2013-11-05 Thread Edson Richter
Em 05/11/2013 10:36, Thomas Kellerer escreveu: bsreejithin, 05.11.2013 13:14: Not able to post the attached details as a comment in the reply box, so attaching it as an image file : http://postgresql.1045698.n5.nabble.com/file/n5776987/Untitled.png It would have much easier if you had simply

Re: [GENERAL] Junk date getting uploaded into date field

2013-11-05 Thread Albe Laurenz
Thomas Kellerer wrote: bsreejithin, 05.11.2013 13:14: Not able to post the attached details as a comment in the reply box, so attaching it as an image file : http://postgresql.1045698.n5.nabble.com/file/n5776987/Untitled.png It would have much easier if you had simply used copy paste to

Re: [GENERAL] Junk date getting uploaded into date field

2013-11-05 Thread Reid Thompson
On Tue, 2013-11-05 at 04:14 -0800, bsreejithin wrote: Not able to post the attached details as a comment in the reply box, so attaching it as an image file : http://postgresql.1045698.n5.nabble.com/file/n5776987/Untitled.png -- View this message in context:

Re: [GENERAL] WITH RECURSIVE doesn't work properly for me

2013-11-05 Thread Jing Fan
I have two group operations. One is inside the CTE ( union select src_id, dest_id, min(dist) ), another is outside the CTE. Do you mean that even the grouping inside the CTE will be calculated only after the CTE has been calculated? Thank you very much:)

Re: [GENERAL] Curious question about physical files to store database

2013-11-05 Thread Patrick Dung
On Monday, November 4, 2013 10:09 PM, Albe Laurenz laurenz.a...@wien.gv.at wrote: Patrick Dung wrote: As I have seen, some database created or pre-allocate large physical files on the file system to as the backend of the database tablespace. For Postgresql, I have observed that it

Re: [GENERAL] Junk date getting uploaded into date field

2013-11-05 Thread Tom Lane
Albe Laurenz laurenz.a...@wien.gv.at writes: There is a comment in utils/adt/formatting.c: * This function does very little error checking, e.g. * to_timestamp('20096040','MMDD') works So at least this is not by accident. No, it isn't. This is in fact the traditional behavior of Unix

Re: [GENERAL] Curious question about physical files to store database

2013-11-05 Thread Albe Laurenz
Patrick Dung wrote: I have seen some databases product that allocate small number of large files. Please correct me if I am wrong: MSSQL (one file is the data and another file for the transaction log) MySQL with InnoDB Oracle DB2 I don't know enough about DB2 and MSSQL, but you are

Re: [GENERAL] WITH RECURSIVE doesn't work properly for me

2013-11-05 Thread Albe Laurenz
Jing Fan wrote: I have two group operations. One is inside the CTE ( union select src_id, dest_id, min(dist) ), another is outside the CTE. Do you mean that even the grouping inside the CTE will be calculated only after the CTE has been calculated? I

Re: [GENERAL] Junk date getting uploaded into date field

2013-11-05 Thread Tom Lane
bsreejithin bsreejit...@gmail.com writes: I am not sure why : select to_date('33-OCT-2013', 'dd-mon-') is returning 2013-11-02. For cases like the issue I am facing, where we need to raise an error saying the data is wrong, DB manipulating the data is not proper. Then don't use

Re: [GENERAL] WITH RECURSIVE doesn't work properly for me

2013-11-05 Thread Jing Fan
Why the one inside does not do anything? It won't be executed? Best, Jing On Tue, Nov 5, 2013 at 8:52 AM, Albe Laurenz laurenz.a...@wien.gv.atwrote: Jing Fan wrote: I have two group operations. One is inside the CTE ( union select src_id, dest_id,

Re: [GENERAL] Junk date getting uploaded into date field

2013-11-05 Thread Michael Nolan
On 11/5/13, bsreejithin bsreejit...@gmail.com wrote: I am not sure why : select to_date('33-OCT-2013', 'dd-mon-') is returning 2013-11-02. For cases like the issue I am facing, where we need to raise an error saying the data is wrong, DB manipulating the data is not proper. Try using

Re: [GENERAL] Curious question about physical files to store database

2013-11-05 Thread Edson Richter
Em 05/11/2013 12:51, Albe Laurenz escreveu: Patrick Dung wrote: I have seen some databases product that allocate small number of large files. Please correct me if I am wrong: MSSQL (one file is the data and another file for the transaction log) MySQL with InnoDB Oracle DB2 I don't know

Re: [GENERAL] WITH RECURSIVE doesn't work properly for me

2013-11-05 Thread Albe Laurenz
Jing Fan wrote: Why the one inside does not do anything? It won't be executed? It is executed. It might filter out the occasional row, but if you look at the example I gave you, you'll see that it won't do anything to keep it from recursing. Yours, Laurenz Albe -- Sent via pgsql-general

Re: [GENERAL] json datatype and table bloat?

2013-11-05 Thread Merlin Moncure
On Mon, Nov 4, 2013 at 8:31 PM, ajeli...@gmail.com ajeli...@gmail.com wrote: Along the lines of the equality operator; I have ran into issues trying to pivot a table/result set with a json type due what seemed to be no equality operator. For the curious, and also use-case considerations for

Re: [GENERAL] GSSAPI server side on Linux, SSPI client side on Windows

2013-11-05 Thread Christian Ullrich
* Stephen Frost wrote: * Brian Crowell (br...@fluggo.com) wrote: However, the eventual goal was to connect to this same server from a .NET app running on Windows, and here I've run into a snag. The Npgsql library does not support GSSAPIā€”it only supports SSPI, which is

Re: [GENERAL] GSSAPI server side on Linux, SSPI client side on Windows

2013-11-05 Thread Stephen Frost
* Christian Ullrich (ch...@chrullrich.net) wrote: I tried to fix it using the reverse of they one-line fix that worked in both JDBC and libpq. There, the problem was that they only supported GSSAPI and had no clue about SSPI (except libpq on Windows). The fix was to basically declare GSSAPI

Re: [GENERAL] GSSAPI server side on Linux, SSPI client side on Windows

2013-11-05 Thread Christian Ullrich
* Stephen Frost wrote: * Christian Ullrich (ch...@chrullrich.net) wrote: I tried to fix it using the reverse of they one-line fix that worked in both JDBC and libpq. There, the problem was that they only supported GSSAPI and had no clue about SSPI (except libpq on Windows). The fix was to

Re: [GENERAL] WITH RECURSIVE doesn't work properly for me

2013-11-05 Thread Jing Fan
If the grouping inside CTE is executed, I don't think it would generate result like src_id | dest_id | dist +-+-- 3384 |6236 |1 3384 |1739 |2 3384 |6236 |3 3384 |1739 |4 3384 |6236 |5 3384 |1739 |6 3384 |

Re: [GENERAL] GSSAPI server side on Linux, SSPI client side on Windows

2013-11-05 Thread Francisco Figueiredo Jr.
On Tue, Nov 5, 2013 at 2:35 PM, Christian Ullrich ch...@chrullrich.netwrote: * Stephen Frost wrote: * Brian Crowell (br...@fluggo.com) wrote: However, the eventual goal was to connect to this same server from a .NET app running on Windows, and here I've run into a snag. The Npgsql library

Re: [GENERAL] Junk date getting uploaded into date field

2013-11-05 Thread Steve Crawford
On 11/05/2013 05:29 AM, Albe Laurenz wrote: Thomas Kellerer wrote: bsreejithin, 05.11.2013 13:14: Not able to post the attached details as a comment in the reply box, so attaching it as an image file : http://postgresql.1045698.n5.nabble.com/file/n5776987/Untitled.png It would have much

Re: [GENERAL] GSSAPI server side on Linux, SSPI client side on Windows

2013-11-05 Thread Christian Ullrich
* Francisco Figueiredo Jr. wrote: On Tue, Nov 5, 2013 at 2:35 PM, Christian Ullrich ch...@chrullrich.net mailto:ch...@chrullrich.net wrote: * Stephen Frost wrote: * Brian Crowell (br...@fluggo.com mailto:br...@fluggo.com) wrote: However, the eventual goal was to

Re: [GENERAL] GSSAPI server side on Linux, SSPI client side on Windows

2013-11-05 Thread Christian Ullrich
* Christian Ullrich wrote: Nov 1 10:31:50 infra1 postgres[25277]: [7-1] FATAL: accepting GSS security context failed Nov 1 10:31:50 infra1 postgres[25277]: [7-2] DETAIL: An unsupported mechanism was requested: Unknown error Nov 1 10:39:31 infra1 postgres[25587]: [7-1] FATAL: accepting GSS

[GENERAL] Clone database using rsync?

2013-11-05 Thread sparikh
I need to clone production database to development server ? What is the best and simplest way to achieve that? Both my production and development postgres versions are same. Will copy over data folder using rsync work? Thanks in advance. -- View this message in context:

[GENERAL] pg_start_backup('label',true) why do I need 2nd parameter?

2013-11-05 Thread AI Rumman
Hi all, A few days back, I faced a problem where I *pg_start_backup('label') *was hang in the server forever. I stopped the process and then used *pg_start_backup('label',true) *and it worked. Now I am trying to investigate why I need to use true as second parameter and read the doc There is an

Re: [GENERAL] Clone database using rsync?

2013-11-05 Thread Jeff Janes
On Tue, Nov 5, 2013 at 3:11 PM, sparikh spar...@ecotality.com wrote: I need to clone production database to development server ? What is the best and simplest way to achieve that? Both my production and development postgres versions are same. Will copy over data folder using rsync work?

Re: [GENERAL] Clone database using rsync?

2013-11-05 Thread John R Pierce
On 11/5/2013 3:11 PM, sparikh wrote: I need to clone production database to development server ? What is the best and simplest way to achieve that? Both my production and development postgres versions are same. Will copy over data folder using rsync work? if the database isn't gigenormous, on

Re: [GENERAL] Clone database using rsync?

2013-11-05 Thread matt
Copying the data folder should work as long as you stop the postgres service on the production server before starting the copy and don't start it up again until the copy finishes. pg_dump and pg_restore (look them up in the online docs) will get the job done without you having to take the

Re: [GENERAL] Clone database using rsync?

2013-11-05 Thread Adrian Klaver
On 11/05/2013 03:41 PM, m...@byrney.com wrote: Copying the data folder should work as long as you stop the postgres service on the production server before starting the copy and don't start it up again until the copy finishes. pg_dump and pg_restore (look them up in the online docs) will get

Re: [GENERAL] Clone database using rsync?

2013-11-05 Thread sparikh
Thanks Jeff for your quick response. I inherited this system and they had cron job which uses pg_dump for back up. I recently used to rsync to bring back my hot standby when it was out of sync and offline for few days because of space issue. That is when the thought that I might be able to use

Re: [GENERAL] pg_start_backup('label',true) why do I need 2nd parameter?

2013-11-05 Thread David Johnston
rummandba wrote A few days back, I faced a problem where I *pg_start_backup('label') *was hang in the server forever. so, the server is still hung? can you define what you mean by hung - what did and did not work? I stopped the process and then used *pg_start_backup('label',true) *and it

Re: [GENERAL] pg_start_backup('label',true) why do I need 2nd parameter?

2013-11-05 Thread Bill Moran
On Tue, 5 Nov 2013 15:30:19 -0800 AI Rumman rumman...@gmail.com wrote: Hi all, A few days back, I faced a problem where I *pg_start_backup('label') *was hang in the server forever. I stopped the process and then used *pg_start_backup('label',true) *and it worked. Now I am trying to

Re: [GENERAL] pg_start_backup('label',true) why do I need 2nd parameter?

2013-11-05 Thread David Johnston
Bill Moran wrote How long that takes is a factor of other settings (as David mentioned) and also depedent on what other transactions may be running. While I am inclined to believe this is true the documentation is unclear that other transactions have any bearing on the delay. All the