Re: [GENERAL] number of rows returned by a query

2010-12-02 Thread Guillaume Lelarge
Le 03/12/2010 07:34, Konstantin Izmailov a écrit : > Dmitriy, > It worked like a charm! Bol'shoe spasibo! > > I'm curious what are the Postgres versions that support MOVE ALL. The > documentation does not even mention "ALL" option. > Actually, it does: http://www.postgresql.org/docs/9.0/inter

Re: [GENERAL] number of rows returned by a query

2010-12-02 Thread Konstantin Izmailov
Dmitriy, It worked like a charm! Bol'shoe spasibo! I'm curious what are the Postgres versions that support MOVE ALL. The documentation does not even mention "ALL" option. Konstantin On Thu, Dec 2, 2010 at 3:49 AM, Dmitriy Igrishin wrote: > Hey Konstantin, > > Use MOVE ALL, then PQcmdTuples to

Re: [GENERAL] how can i bugfix "idle in transaction" lockups ?

2010-12-02 Thread Christophe Pettus
On Nov 30, 2010, at 7:21 AM, Jonathan Vanasco wrote: > i couldn't find anything in the docs, and the project has decent traffic, so > its going to be an issue to log all statements so I can sift through the data > by PID With machine-readable logs, it shouldn't be *that* serious an issue. 1.

Re: [GENERAL] how can i bugfix "idle in transaction" lockups ?

2010-12-02 Thread Jonathan Vanasco
begin w/o commit or rollback? and thanks. you've been very helpful! On Nov 30, 2010, at 2:21 PM, Merlin Moncure wrote: > Begin w/o commit is a grave application error and you should > consider reworking your code base so that it doesn't happen (ever). -- Sent via pgsql-general mailing list (p

Re: [GENERAL] Looking for auto starting procedures

2010-12-02 Thread Alvaro Herrera
Excerpts from mabra's message of jue dic 02 20:04:36 -0300 2010: > I've just not understood, when I have to write a function to test sql code > and when I can do it interactively. In Postgres, PL/pgSQL and SQL are two different languages. There are things in PL/pgSQL that you cannot do in pure S

Re: [GENERAL] Dumping a table from one database and adding it to another

2010-12-02 Thread Brent Wood
Brent Wood DBA/GIS consultant NIWA, Wellington New Zealand >>> "James B. Byrne" 12/03/10 12:56 PM >>> I have read the documentation respecting backups but I cannot seem to find any mention of the specific case that I wish performed. Hi James, pg_dump can take arguments to dump a specified table,

Re: [GENERAL] Looking for auto starting procedures

2010-12-02 Thread mabra
Hello ! Very good, thanks ! I've just not understood, when I have to write a function to test sql code and when I can do it interactively. Your shown function compiles and works, but I do not have the result in the logs [altough I see th executing function with my settings to 'debug' ;-) ]. Wil

Re: [GENERAL] How to find correct locale name for CREATEDATABASE

2010-12-02 Thread Peter Eisentraut
On tor, 2010-12-02 at 19:53 +0200, Andrus wrote: > I'm trying to create portable application which can automatically > create > database using estonian locale in any server. > Postgres returns different values for same locale: > > In Fedoraet_EE.UTF8 > Other linuxeset_EE.UTF-8 > In Window

Re: [GENERAL] Looking for auto starting procedures

2010-12-02 Thread Scott Ribe
On Dec 2, 2010, at 1:27 PM, wrote: > > I have not understand, where I can issue direct sql statements > and it looks like, the RAISE is not possible with plSql: Right, it's not actually SQL, so you can't use it in plain SQL. It is part of the plpgsql procedural language. So you could easily c

Re: [GENERAL] Looking for auto starting procedures

2010-12-02 Thread mabra
Hello ! Rellay good;I see, the track is not wong ;-) But currently, I stuck in 8.4 [debian/squeeze]. I'll try to write a function and leran if and how I can call it. Thanks a lot! br++mabra -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgre

Re: [GENERAL] Dumping a table from one database and adding it to another

2010-12-02 Thread James B. Byrne
On Thu, December 2, 2010 15:57, Adrian Klaver wrote: > a >> different database, using PG utilities? >> >> > > pg_dump -U postgres -a -t cell_per -f cell_per.sql production > followed by: /usr/bin/psql -f cell_per.sql production works wonderfully. Thank you. -- *** E-Mail is NOT a S

Re: [GENERAL] Dumping a table from one database and adding it to another

2010-12-02 Thread Adrian Klaver
On 12/02/2010 12:49 PM, James B. Byrne wrote: I have read the documentation respecting backups but I cannot seem to find any mention of the specific case that I wish performed. I have a pair of tables in a production database that I wish to dump and then restore to a new, different database. I

Re: [GENERAL] Dumping a table from one database and adding it to another

2010-12-02 Thread Adrian Klaver
On 12/02/2010 12:49 PM, James B. Byrne wrote: I have read the documentation respecting backups but I cannot seem to find any mention of the specific case that I wish performed. I have a pair of tables in a production database that I wish to dump and then restore to a new, different database. I

[GENERAL] Dumping a table from one database and adding it to another

2010-12-02 Thread James B. Byrne
I have read the documentation respecting backups but I cannot seem to find any mention of the specific case that I wish performed. I have a pair of tables in a production database that I wish to dump and then restore to a new, different database. I can, and probably will, recreate the tables and

Re: [GENERAL] Looking for auto starting procedures

2010-12-02 Thread Adrian Klaver
On 12/02/2010 12:27 PM, ma...@manfbraun.de wrote: Hello ! a) The idea with to test a RAISE statement with an prefix, could be good. But I am just that new, I could not make it working. I have not understand, where I can issue direct sql statements and it looks like, the RAISE is not possible wi

Re: [GENERAL] PG84 and SELinux

2010-12-02 Thread James B. Byrne
On Thu, December 2, 2010 15:23, Devrim GÜNDÜZ wrote: > On Wed, 2010-12-01 at 16:54 -0500, Tom Lane wrote: >> AFAIK, the Red Hat RPMs work out-of-the-box with SELinux; > > They should -- we are using the same routines for initdb'ing. > I will do a touch /.autorelabel and restart the server before

Re: [GENERAL] Looking for auto starting procedures

2010-12-02 Thread mabra
Hello ! a) The idea with to test a RAISE statement with an prefix, could be good. But I am just that new, I could not make it working. I have not understand, where I can issue direct sql statements and it looks like, the RAISE is not possible with plSql: mbtest=# RAISE NOTICE 'mynotice: %', 'hel

Re: [GENERAL] PG84 and SELinux

2010-12-02 Thread Devrim GÜNDÜZ
On Wed, 2010-12-01 at 16:54 -0500, Tom Lane wrote: > AFAIK, the Red Hat RPMs work out-of-the-box with SELinux; I'm a bit > surprised to hear that the PGDG ones don't, because last I heard > they use the same file layout. They should -- we are using the same routines for initdb'ing. -- Devrim GÜ

[GENERAL] pg_dump: Error message from server: ERROR: canceling statement due to conflict with recovery

2010-12-02 Thread zhong ming wu
pg_dump: SQL command failed pg_dump: Error message from server: ERROR: canceling statement due to conflict with recovery DETAIL: User query might have needed to see row versions that must be removed. pg_dump: The command was: COPY public.i.. TO stdout; pg_dumpall: pg_dump failed on database "

Re: [GENERAL] Full Text Partial Match at begining

2010-12-02 Thread Radosław Smogura
On Thu, 02 Dec 2010 17:34:28 +0100, Dimitri Fontaine wrote: > AI Rumman writes: >> Is it possible to match "%text' in Postgresql 9 Full Text. > > See http://www.sai.msu.su/~megera/wiki/wildspeed > > -- > Dimitri Fontaine > http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

Re: [GENERAL] Looking for auto starting procedures

2010-12-02 Thread Scott Ribe
On Dec 2, 2010, at 11:32 AM, wrote: > > The usual notification from postgreSQL does not allow to write > an [own, better to evaluate] identifier in the syslog. This is > not a matter of the syslog daemon, its on the program which logs. > May be, I have just not found this. Am I missing somethin

Re: [GENERAL] How to find correct locale name for CREATEDATABASE

2010-12-02 Thread Andrus
In Fedoraet_EE.UTF8 Other linuxeset_EE.UTF-8 These are the same locales, just a differently named encoding. Postgres requires those suffixes in locale names. They must me exactly UTF8 or UTF-8 or 1257 . If those are missing, or even if - sign is missed in UTF-8, error occurs on create

Re: [GENERAL] Looking for auto starting procedures

2010-12-02 Thread mabra
Hello ! And thanks to all, for answers. Naturally, cron does not operate on DB tables and if I add/remove/change a line in a control table dynamically, cron would not notice that ;-) So I had to write a daemon, which acts on that table. This might happen about ~5 - 20 seconds and cron is operates

Re: [GENERAL] How to find correct locale name for CREATEDATABASE

2010-12-02 Thread Alban Hertroys
On 2 Dec 2010, at 18:53, Andrus wrote: >> However, if the locale that your database needs isn't available, what did >> you intend to do about that? You can't just pick a different one, it >> probably wouldn't behave the same. Apparently you can't just use the default >> locales either, or you w

Re: [GENERAL] How to find correct locale name for CREATEDATABASE

2010-12-02 Thread Andrus
However, if the locale that your database needs isn't available, what did you intend to do about that? You can't just pick a different one, it probably wouldn't behave the same. Apparently you can't just use the default locales either, or you wouldn't be asking about this. I'm trying to create

Re: [GENERAL] [REPOST] plpgsql : looping over multidimensional array : getting NULL for subdimension

2010-12-02 Thread Merlin Moncure
On Thu, Dec 2, 2010 at 12:20 PM, Merlin Moncure wrote: > On Thu, Dec 2, 2010 at 9:03 AM, Samba wrote: >> Thank you  Merlin for your answer, >> >>    I tried that and is working as you said. >>    But when I do >>    other_array=some_array[1:2]; >>    I'm getting the en

Re: [GENERAL] [REPOST] plpgsql : looping over multidimensional array : getting NULL for subdimension

2010-12-02 Thread Merlin Moncure
On Thu, Dec 2, 2010 at 9:03 AM, Samba wrote: > Thank you  Merlin for your answer, > >    I tried that and is working as you said. >    But when I do >    other_array=some_array[1:2]; >    I'm getting the entire > '{{samba,sarath,sreenivas},{samba,mukhesh,pavan}}'; > >  

Re: [GENERAL] Full Text Partial Match at begining

2010-12-02 Thread Dimitri Fontaine
AI Rumman writes: > Is it possible to match "%text' in Postgresql 9 Full Text. See http://www.sai.msu.su/~megera/wiki/wildspeed -- Dimitri Fontaine http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To m

Re: [GENERAL] How to recover a postgres installation from files

2010-12-02 Thread Anibal David Acosta
Thanks!!! I'll download right now :) -Mensaje original- De: Radosław Smogura [mailto:rsmog...@softperience.eu] Enviado el: jueves, 02 de diciembre de 2010 08:22 a.m. Para: Craig Ringer CC: Anibal David Acosta; pgsql-ad...@postgresql.org; pgsql-general@postgresql.org Asunto: Re: [GENER

Re: [GENERAL] How to find correct locale name for CREATEDATABASE

2010-12-02 Thread Alban Hertroys
On 2 Dec 2010, at 13:34, Andrus wrote: >>> Because, as opposed to the developers of the projects that you're >>> apparently familiar with, the Postgres developers have common sense ;) > > intidb fallbacks to en_US locale if locale specified in command line is not > found. Aren't you confusing di

Re: [GENERAL] [REPOST] plpgsql : looping over multidimensional array : getting NULL for subdimension

2010-12-02 Thread Samba
Thank you Merlin for your answer, I tried that and is working as you said. But when I do other_array=some_array[1:2]; I'm getting the entire '{{samba,sarath,sreenivas},{samba,mukhesh,pavan}}'; not just the second subarray, i.e. '{{samba,mukhesh,pava

Re: [GENERAL] mysql query to postgres Timediff

2010-12-02 Thread Pavel Stehule
Hello PostgreSQL hasn't a timediff function and hasn't a session variables. You can see how can be implemented this function in pg http://okbob.blogspot.com/2009/08/mysql-functions-for-postgresql.html. If you can compare values from different rows, you have to have a pg >= 8.4 with window function

Re: ***SPAM*** Re: [GENERAL] How to find correct locale name for CREATEDATABASE

2010-12-02 Thread Andrus
Because, as opposed to the developers of the projects that you're apparently familiar with, the Postgres developers have common sense ;) intidb fallbacks to en_US locale if locale specified in command line is not found. This causes invalid cluster to be created. How to fix this ? Is this really

Re: [GENERAL] Looking for auto starting procedures

2010-12-02 Thread Robert Gravsjö
On 2010-12-01 16.16, ma...@manfbraun.de wrote: Hello ! I am coming from Sql Server right now and have to learn about the infrastructure. What I missed first, is, to execute procedures regularly/repeatedly on a given time. I want to prevent my to write a lot external programs und use cron :-(

Re: [GENERAL] How to find correct locale name for CREATE DATABASE

2010-12-02 Thread Robert Gravsjö
On 2010-12-01 09.26, Andrus wrote: Thom, You can list available locales on your system with: locale -a Thank you. How to resolve this issue if only 5432 port is open in server ? Maybe asking the sysadmin of that host to return the result of "locale -a"? Btw, are you sure et_EE.UTF-8 is

Re: [GENERAL] How to recover a postgres installation from files

2010-12-02 Thread Radosław Smogura
ftp://svimik.servehttp.com/soft/postgresql-8.1.4-1-binaries-no-installer.zip ftp://po.istu.ru/public/distrib/Windows/Devel/db/postgresql/postgresql-8.1.5-1.zip ftp://ftp.lviv.farlep.net/opensource/DataBases/postgresql-8.1.2-1.zip ftp://svimik.servehttp.com/soft/postgresql-8.1.4-1.zip ftp://isyrkov.

Re: [GENERAL] number of rows returned by a query

2010-12-02 Thread Dmitriy Igrishin
Hey Konstantin, Use MOVE ALL, then PQcmdTuples to get number of rows, then MOVE BACKWARD ALL to point cursor at initial position. 2010/12/2 Konstantin Izmailov > Maybe this question was discussed previously, but I could not find an > answer: > > An application used PQntuples function to obtain

[GENERAL] mysql query to postgres Timediff

2010-12-02 Thread franrtorres77
Hello I have the next query in mysql to get the time difference from two rows, but I would like to implement it in postgres, but I'm getting some errors when I try to query it. select speed,mobile,date, timediff(@nexttime,date) as tdiff2, (@nexttime:=date) as Next from positions where speed=0 an

Re: [GENERAL] How to recover a postgres installation from files

2010-12-02 Thread Craig Ringer
On 02/12/10 01:11, Anibal David Acosta wrote: > So, I only have the postgres directory on my hands. I decide to install the > same database version in another computer and replace DATA directory, but I > notice that 8.1 (windows binary) is not available for download. > > So, I don't know how to r

Re: [GENERAL] How to recover a postgres installation from files

2010-12-02 Thread Magnus Hagander
On Thu, Dec 2, 2010 at 08:44, Craig Ringer wrote: > On 02/12/10 01:11, Anibal David Acosta wrote: > >> So, I don't know how to recover the database from the data directory of a >> windows postgres 8.1 installation. > > You'll need PostgreSQL 8.1 for Windows. This appears to have been > removed fro