[GENERAL] AT TIME ZONE and interval arguments

2013-01-31 Thread Craig Ringer
Hi all I'm mildly thrown by this: regress= SELECT TIME '04:00' AT TIME ZONE '01:00'; timezone - 19:00:00-01 (1 row) regress= SELECT TIME '04:00' AT TIME ZONE (INTERVAL '01:00'); timezone - 21:00:00+01 (1 row) regress= SELECT TIME '04:00' AT TIME ZONE (TEXT

Re: [GENERAL] Optimizing query?

2013-01-31 Thread Pavel Stehule
2013/1/31 Vincent Veyron vv.li...@wanadoo.fr: Le mercredi 30 janvier 2013 à 11:08 +, wolfg...@noten5.maas-noten.de a écrit : Hi, I am trying to match items from 2 tables based on a common string. One is a big table which has one column with entries like XY123, ABC44, etc The table has

Re: [GENERAL] naming of wal-archives

2013-01-31 Thread Neil Worden
If your command does overwrite, then the server currently emitting the 8D files will become unrecoverable once those files start getting overwritten. If it refuses to overwrite, but returns a zero status, then the server currently emitting 6D would become unrecoverable once it reaches 8D and

Re: [GENERAL] Optimizing select count query which often takes over 10 seconds

2013-01-31 Thread Alexander Farber
On Wed, Jan 30, 2013 at 2:06 PM, Kevin Grittner kgri...@ymail.com wrote: update pref_users set medals = 0 where medals 0; Thank you all for your insightful comments This has cured my cronjob -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] naming of wal-archives

2013-01-31 Thread Neil Worden
Btw, ps shows: postgres@darkblue:/data/pgdata/pg_xlog$ ps aux | grep post postgres 11496 0.1 0.9 161018232 3696076 ? SJan29 2:49 postmaster -i -D /data/pgdata postgres 11499 0.0 1.6 161097088 6450616 ? Ss Jan29 1:39 postgres: checkpointer process postgres 11500 0.0 0.3

Re: [GENERAL] naming of wal-archives

2013-01-31 Thread Neil Worden
And a few minutes later the archiver-process with the same process-id has written a file from ..8.. line: postgres 11502 0.0 0.0 161096724 3112 ? Ss Jan29 0:12 postgres: autovacuum launcher process postgres 11503 0.0 0.0 20136 884 ?Ss Jan29 0:10 postgres: archiver

Re: [GENERAL] Optimizing query?

2013-01-31 Thread Vincent Veyron
Le jeudi 31 janvier 2013 à 09:49 +0100, Pavel Stehule a écrit : any join where result is related to some function result can be very slow, because estimation will be out and any repeated function evaluation is just expensive. Hi Pavel, Thank you for the correction. Since we're at it, I

Re: [GENERAL] Optimizing query?

2013-01-31 Thread Pavel Stehule
2013/1/31 Vincent Veyron vv.li...@wanadoo.fr: Le jeudi 31 janvier 2013 à 09:49 +0100, Pavel Stehule a écrit : any join where result is related to some function result can be very slow, because estimation will be out and any repeated function evaluation is just expensive. Hi Pavel, Thank

Re: [GENERAL] AT TIME ZONE and interval arguments

2013-01-31 Thread Albe Laurenz
Craig Ringer wrote: I'm mildly thrown by this: regress= SELECT TIME '04:00' AT TIME ZONE '01:00'; timezone - 19:00:00-01 (1 row) regress= SELECT TIME '04:00' AT TIME ZONE (INTERVAL '01:00'); timezone - 21:00:00+01 (1 row) regress= SELECT TIME '04:00'

Re: [GENERAL] Windows Phone/Postgresql

2013-01-31 Thread Torello Querci
Are you try with npgsql? I used it with minor changes with mono for android and I was able to connect to PG database. Best Regards 2013/1/30 Bret Stern bret_st...@machinemanagement.com I'm thinking about picking up a new windows phone, and would like to connect to a postgresql server from

Re: [GENERAL] Optimizing query?

2013-01-31 Thread Vincent Veyron
Le jeudi 31 janvier 2013 à 11:06 +0100, Pavel Stehule a écrit : 2013/1/31 Vincent Veyron vv.li...@wanadoo.fr: Suppose I have a query of the form SELECT my_function(column_1), column_2 FROM my_table GROUP BY my_function(column_1) ORDER BY my_function(column_1); where my_function

Re: [GENERAL] Optimizing query?

2013-01-31 Thread Pavel Stehule
2013/1/31 Vincent Veyron vv.li...@wanadoo.fr: Le jeudi 31 janvier 2013 à 11:06 +0100, Pavel Stehule a écrit : 2013/1/31 Vincent Veyron vv.li...@wanadoo.fr: Suppose I have a query of the form SELECT my_function(column_1), column_2 FROM my_table GROUP BY my_function(column_1) ORDER

Re: [GENERAL] Version numbers for binaries

2013-01-31 Thread Magnus Hagander
On Thu, Jan 31, 2013 at 12:20 AM, deepak deepak...@gmail.com wrote: Hi ! We bundle Postgres into a Windows MSI, Postgres built with VS2008. One of the issues we ran into recently is Windows getting confused with the file versions of Postgres binaries, confused meaning, it was treating newer

[GENERAL] Parsing COPY ... WITH BINARY

2013-01-31 Thread Leonardo M . Ramé
I'm using this: COPY( select field1, field2, field3 from table ) TO 'C://Program Files/PostgreSql//8.4//data//output.dat' WITH BINARY To export some fields to a file, one of them is a ByteA field. Now, I need to read the file with a custom made program. How can I parse this file? BTW: I

Re: [GENERAL] naming of wal-archives

2013-01-31 Thread Adrian Klaver
On 01/31/2013 01:48 AM, Neil Worden wrote: Btw, ps shows: The archiver process says last was 0001006E0034 and when i look into my wal-archive-directory i see: -rw--- 1 postgres postgres 16777216 Jan 31 10:24 0001006E0033 -rw--- 1 postgres postgres

Re: [GENERAL] Version numbers for binaries

2013-01-31 Thread deepak
Hi! Sounds good, thanks. -- Deepak On Thu, Jan 31, 2013 at 9:11 AM, Magnus Hagander mag...@hagander.netwrote: On Thu, Jan 31, 2013 at 12:20 AM, deepak deepak...@gmail.com wrote: Hi ! We bundle Postgres into a Windows MSI, Postgres built with VS2008. One of the issues we ran into

Re: [GENERAL] naming of wal-archives

2013-01-31 Thread Jeff Janes
On Thu, Jan 31, 2013 at 12:50 AM, Neil Worden nworden1...@gmail.com wrote: The situation is as follows: All concerned machines are running 9.2.2 64-bit on Ubuntu Linux Server 12.10, installed from source, all following exactly the same procedure. We have a hot-standby running to a different

Fwd: [GENERAL] naming of wal-archives

2013-01-31 Thread Neil Worden
Sorry, this one should have been sent to the group. -- Forwarded message -- Hi, Master M - streaming via pg_receivexlog - TEST R (same location, currently for testing and experimenting) - streaming to hot standby via dsl - HOT1 (other location, hot-standby and

Re: [GENERAL] AT TIME ZONE and interval arguments

2013-01-31 Thread Tom Lane
Craig Ringer cr...@2ndquadrant.com writes: I'm mildly thrown by this: regress= SELECT TIME '04:00' AT TIME ZONE '01:00'; [ zone is taken as GMT-1 ] regress= SELECT TIME '04:00' AT TIME ZONE (INTERVAL '01:00'); [ zone is taken as GMT+1 ] and was wondering if anyone knows why the sense of the

[GENERAL] SQL sentence to insert where updated rows is zero...

2013-01-31 Thread Glus Xof
Hi guys, It's just to ask you if there is a single SQL sentence to INSERT values in case of UPDATE WHERE returns 0 rows updated. I mean, If I write something like, # update my_table set column1='value' where column2='key_value'; And system replies me with one UPDATE 0 because there is no row at

[GENERAL] COPY table to file missing quotation marks

2013-01-31 Thread Rich Shepard
I'd like to understand what I'm missing when I COPY a table to a .csv file but the text is not quoted. Here's an example of a command: copy chemistry to '/home/postgres/emapchem.csv' with (format CSV, header True, quote '', delimiter '|'); and here're part of the header and following row

Re: [GENERAL] COPY table to file missing quotation marks

2013-01-31 Thread Adrian Klaver
On 01/31/2013 08:37 AM, Rich Shepard wrote: I'd like to understand what I'm missing when I COPY a table to a .csv file but the text is not quoted. Here's an example of a command: copy chemistry to '/home/postgres/emapchem.csv' with (format CSV, header True, quote '', delimiter '|'); and

Re: [GENERAL] COPY table to file missing quotation marks

2013-01-31 Thread Rich Shepard
On Thu, 31 Jan 2013, Adrian Klaver wrote: http://www.postgresql.org/docs/9.2/interactive/sql-copy.html Adrian, I've read this. CSV Format ... The values in each record are separated by the DELIMITER character. If the value contains the delimiter character, the QUOTE character, the NULL

Re: [GENERAL] psql question

2013-01-31 Thread Little, Douglas
Thanks to steve and Al for the suggestions. I did get the variable concatenation solution to work. \set env `echo $TARGETSERVER` \echo env :env \set envfile 'P1GP1_ETL_STAGE_TBLS_BIO6113_100.':env'.sql' \echo envfile :envfile -- envfile P1GP1_ETL_STAGE_TBLS_BIO6113_100.DEV.sql However

Re: [GENERAL] COPY table to file missing quotation marks

2013-01-31 Thread Steve Crawford
On 01/31/2013 08:46 AM, Adrian Klaver wrote: On 01/31/2013 08:37 AM, Rich Shepard wrote: I'd like to understand what I'm missing when I COPY a table to a .csv file but the text is not quoted. ... http://www.postgresql.org/docs/9.2/interactive/sql-copy.html CSV Format ... The values in

Re: [GENERAL] COPY table to file missing quotation marks

2013-01-31 Thread Rich Shepard
On Thu, 31 Jan 2013, Steve Crawford wrote: Definition of the CSV Format: While there are various specifications and implementations for the CSV format...there is no formal specification in existence, which allows for a wide variety of interpretations of CSV files. Steve, It's been this

Re: [GENERAL] COPY table to file missing quotation marks

2013-01-31 Thread Steve Crawford
On 01/31/2013 09:03 AM, Rich Shepard wrote: On Thu, 31 Jan 2013, Steve Crawford wrote: Definition of the CSV Format: While there are various specifications and implementations for the CSV format...there is no formal specification in existence, which allows for a wide variety of

Re: [GENERAL] COPY table to file missing quotation marks

2013-01-31 Thread Adrian Klaver
On 01/31/2013 08:53 AM, Rich Shepard wrote: On Thu, 31 Jan 2013, Adrian Klaver wrote: http://www.postgresql.org/docs/9.2/interactive/sql-copy.html Adrian, I've read this. CSV Format ... The values in each record are separated by the DELIMITER character. If the value contains the

Re: [GENERAL] COPY table to file missing quotation marks

2013-01-31 Thread Rich Shepard
On Thu, 31 Jan 2013, Adrian Klaver wrote: FORCE_QUOTE Forces quoting to be used for all non-NULL values in each specified column. NULL output is never quoted. If * is specified, non-NULL values will be quoted in all columns. This option is allowed only in COPY TO, and only when using CSV

Re: [GENERAL] COPY table to file missing quotation marks

2013-01-31 Thread Adrian Klaver
On 01/31/2013 10:17 AM, Rich Shepard wrote: On Thu, 31 Jan 2013, Adrian Klaver wrote: FORCE_QUOTE Forces quoting to be used for all non-NULL values in each specified column. NULL output is never quoted. If * is specified, non-NULL values will be quoted in all columns. This option is allowed

Re: [GENERAL] Windows Phone/Postgresql

2013-01-31 Thread NickJonas
IDK, but I want to know what is the answer, so, Bumb! -- View this message in context: http://postgresql.1045698.n5.nabble.com/Windows-Phone-Postgresql-tp5743052p5743106.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list

[GENERAL] Pg Tcl - is it dying out?

2013-01-31 Thread Carlo Stonebanks
As our production system are being upgraded to Windows 7 64-bit we are finding that our Tcl apps which use the PgTcl client libraries are now failing (couldn't load library libpgtcl.dll: invalid argument). We have tried downloading the latest binaries (which are 32 bit) but the problems persist.

Re: [GENERAL] Optimizing query?

2013-01-31 Thread hamann . w
Pavel Stehlule wrote: Hi, I am trying to match items from 2 tables based on a common string. One is a big table which has one column with entries like XY123, ABC44, = etc The table has an index on that column. The second table is, typically, much smaller select from tab1,

Re: [GENERAL] Pg Tcl - is it dying out?

2013-01-31 Thread David Fetter
On Wed, Jan 30, 2013 at 05:45:06PM -0500, Carlo Stonebanks wrote: As our production system are being upgraded to Windows 7 64-bit we are finding that our Tcl apps which use the PgTcl client libraries are now failing (couldn't load library libpgtcl.dll: invalid argument). We have tried

Re: [GENERAL] Pg Tcl - is it dying out?

2013-01-31 Thread Carlo Stonebanks
Was there something constructive you might have been asking about that you forgot to include in this email? If so, what was it? I don't believe I forgot anything, as there was a question in the original post (which you did not include in your snip): Are we seeing the demise of PG Tcl? Should

[GENERAL] CREATE TEMPORARY TABLE does not work in SQL language function?

2013-01-31 Thread David Johnston
The only difference between the following two CREATE FUNCTION command is the language in which they are written. I do not recall and cannot seem to find after a quick search any limitation regarding the use of CREATE TEMPORARY TABLE in an SQL language function. It is not one of BEGIN, COMMIT,

Re: [GENERAL] SQL sentence to insert where updated rows is zero...

2013-01-31 Thread Vincent Veyron
Le jeudi 31 janvier 2013 à 17:25 +0100, Glus Xof a écrit : It's just to ask you if there is a single SQL sentence to INSERT values in case of UPDATE WHERE returns 0 rows updated. I mean, If I write something like, # update my_table set column1='value' where column2='key_value'; And

Re: [GENERAL] CREATE TEMPORARY TABLE does not work in SQL language function?

2013-01-31 Thread Tom Lane
David Johnston pol...@yahoo.com writes: The only difference between the following two CREATE FUNCTION command is the language in which they are written. The reason the SQL function doesn't work is that SQL functions parse and analyze their whole bodies before beginning execution --- so temptbl

Re: [GENERAL] Pg Tcl - is it dying out?

2013-01-31 Thread Kevin Grittner
Carlo Stonebanks stonec.regis...@sympatico.ca wrote: Are we seeing the demise of PG Tcl? Should I advise my client to NOT upgrade any systems running Tcl apps and stick with legacy OS's? Not the demise of PG in general, but specifically of concern for the PG Tcl developers. Your best bet

Re: [GENERAL] Pg Tcl - is it dying out?

2013-01-31 Thread Adrian Klaver
On 01/31/2013 10:59 AM, Carlo Stonebanks wrote: Was there something constructive you might have been asking about that you forgot to include in this email? If so, what was it? I don't believe I forgot anything, as there was a question in the original post (which you did not include in your

Re: [GENERAL] Parsing COPY ... WITH BINARY

2013-01-31 Thread Merlin Moncure
On Thu, Jan 31, 2013 at 8:47 AM, Leonardo M. Ramé l.r...@griensu.com wrote: I'm using this: COPY( select field1, field2, field3 from table ) TO 'C://Program Files/PostgreSql//8.4//data//output.dat' WITH BINARY To export some fields to a file, one of them is a ByteA field. Now, I need to

Re: [GENERAL] Pg Tcl - is it dying out?

2013-01-31 Thread Carlo Stonebanks
. If I am following correctly there are two PG/Tcl software packages in play here. Yep, but I am JUST talking about PgTcl. There are three possible PgTcl options, two are from the same developer - one in C, which doesn't work on Win 7 x64 (and possibly other Win platforms) a second in pure

Re: [GENERAL] Optimizing query?

2013-01-31 Thread Pavel Stehule
Hello 2013/1/31 haman...@t-online.de: Pavel Stehlule wrote: Hi, I am trying to match items from 2 tables based on a common string. One is a big table which has one column with entries like XY123, ABC44, = etc The table has an index on that column. The second table is, typically,