Re: [GENERAL] output screen in psql

2011-03-09 Thread Pavel Stehule
Hello 2011/3/10 abcdef : > Hi, I use postgres in red hat linux . > When I use psql and select the content of the table . > I find the format is not tidy . > I change align and unalign , the output is not filful my requirement. > Any special setting that can change the line size like oralce to fit

[GENERAL] output screen in psql

2011-03-09 Thread abcdef
Hi, I use postgres in red hat linux . When I use psql and select the content of the table . I find the format is not tidy . I change align and unalign , the output is not filful my requirement. Any special setting that can change the line size like oralce to fit my requirement ??? So, the whole tab

Re: [GENERAL] Detecting whether a point is in a box.

2011-03-09 Thread hrsuprith
Dear Madam, I had the same issue tonight. I sorted it out, perhaps it may help you :) Convert BOX to a polygon & insert some values as per the syntax. Than run a query SELECT polygon '((-3,10),(8,18),(-3,30),(-10,20))' @> point '(-8,25)'; let me know if this doesn't work for you ;) Cheers!

Re: [GENERAL] 9.0 streaming replication problem

2011-03-09 Thread Sean Hsien
On 10 March 2011 14:21, Sean Hsien wrote: > Hi, > > I've setup 2 nodes for streaming replication and it was working > perfectly. I the tested multiple failovers, switching master/slave, > and now the streaming replication doesn't work anymore. > > I had a look at the log and it seems fine "LOG:  r

[GENERAL] 9.0 streaming replication problem

2011-03-09 Thread Sean Hsien
Hi, I've setup 2 nodes for streaming replication and it was working perfectly. I the tested multiple failovers, switching master/slave, and now the streaming replication doesn't work anymore. I had a look at the log and it seems fine "LOG: replication connection authorized: user=postgres ...". F

Re: [GENERAL] First production install - general advice

2011-03-09 Thread mark
> -Original Message- > From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- > ow...@postgresql.org] On Behalf Of Ray Stell > Sent: Monday, March 07, 2011 10:45 AM > To: runner > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] First production install - general advice

[GENERAL] 9.1 Trigger question

2011-03-09 Thread Michael Black
The following from 9.1 documentation on triggers "SQL allows you to define aliases for the "old" and "new" rows or tables for use in the definition of the triggered action (e.g., CREATE TRIGGER ... ON tablename REFERENCING OLD ROW AS somename NEW ROW AS othername ..

Re: [GENERAL] list all members in a tablespace

2011-03-09 Thread Raghavendra
Hi Mike, I tried this, which will get the list of tables belong to 'XYZ' tablespace. select relname from pg_class where reltablespace=(select oid from pg_tablespace where spcname='xyz'); Hope this helps Best Regards, Raghavendra EnterpriseDB Corporation The Enterprise Postgres Company On Thu,

Re: [GENERAL] ER tool that supports domains and custom types?

2011-03-09 Thread Arturo Perez
In article , "Jaiswal Dhaval Sudhirkumar" wrote: > E-R data modeling Couldn't find the E-R data modeling and Open System Architect doesn't support Mac OS. Forgot to mention that latter in my original post. dbwrench fails to connect to my database even though psql connects just fine. go fi

[GENERAL] list all members in a tablespace

2011-03-09 Thread Michael Andrew Babb
Hi All, I'm doing a little housekeeping on my tablespaces and I'm curious if there is a quick and easy way to list all of the objects in a tablespace. Is there a command to list all objects in a tablespace? Thanks, Mike -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

Re: [GENERAL] pg_restore: [archiver] unsupported version (1.12) in file header

2011-03-09 Thread Adrian Klaver
On Wednesday, March 09, 2011 12:19:13 pm akp geek wrote: > I am getting the following error when I try to restore it from a dump. Any > suggestions? At a guess you are trying to go backwards, using a newer dump file with an older pg_restore. In other words doing 9.0 pg_dump and then 8.3 pg_resto

Re: [GENERAL] Reinterpreting BYTEA as TEXT, converting BYTEA to TEXT

2011-03-09 Thread Merlin Moncure
On Wed, Mar 9, 2011 at 4:09 PM, Vlad Romascanu wrote: > Hello, > > I need to perform "conversions" (transcoding) between BYTEA and TEXT > columns in a UTF-8 database.  I searched for existing solutions and > was unable to find one for 8.x or 9.x, so I cam up with something I'd > like to validate w

[GENERAL] Reinterpreting BYTEA as TEXT, converting BYTEA to TEXT

2011-03-09 Thread Vlad Romascanu
Hello, I need to perform "conversions" (transcoding) between BYTEA and TEXT columns in a UTF-8 database. I searched for existing solutions and was unable to find one for 8.x or 9.x, so I cam up with something I'd like to validate with the more enlightened members of this list... Case 1: reinterp

Re: [GENERAL] How to configure for remote TCP/IP client conncections using MS Visual Basic OLE DB calls and PostgreSQL dll's?

2011-03-09 Thread John Edens
That's a great site - I am now making a connection. Thanks for all the help! John -Original Message- From: Adrian Klaver [mailto:adrian.kla...@gmail.com] Sent: Wednesday, March 09, 2011 12:28 PM To: John Edens Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] How to configure for r

Re: [GENERAL] How to configure for remote TCP/IP client conncections using MS Visual Basic OLE DB calls and PostgreSQL dll's?

2011-03-09 Thread John Edens
Thanks for that explanation, Steve. This is my first time doing much of anything with a server, so that's all good to know! John Your server can have multiple IP addresses. In fact, it almost certainly has an IP assigned to your NIC and a localhost address. But you could have mult

[GENERAL] Huge spikes in number of connections doing "PARSE"

2011-03-09 Thread hubert depesz lubaczewski
hi, i have a server with pg 8.3.11. Every now and then, for no apparent reason (io normal, cpu usage normal, web traffic normal) i see hundreds of connections in "PARSE" state. to give some perspective - we're doing in the lowest traffic of the day around 3000 transactions per second, with ~ 500-

[GENERAL] pg_restore: [archiver] unsupported version (1.12) in file header

2011-03-09 Thread akp geek
I am getting the following error when I try to restore it from a dump. Any suggestions? Regards

Re: [GENERAL] select count(*)

2011-03-09 Thread Rajesh Kumar Mallah
i "discovered" it as a result of typo :) we usually select expressions without tables eg select 1+2 ; etc and the results are as expected, somehow i failed to stretch the analogy to count(*) which is mostly used over tables or table expression. thanks anyways. regds mallah. On Wed, Mar 9, 2011

Re: [GENERAL] How to configure for remote TCP/IP client conncections using MS Visual Basic OLE DB calls and PostgreSQL dll's?

2011-03-09 Thread Steve Crawford
On 03/09/2011 09:54 AM, John Edens wrote: Using * should be fine unless you have multiple IP addresses and want the *server* to *listen* on only some of those addresses - say localhost if you were running web and db on the same machine and didn't want to listen to connections fr

Re: [GENERAL] How to configure for remote TCP/IP client conncections using MS Visual Basic OLE DB calls and PostgreSQL dll's?

2011-03-09 Thread Adrian Klaver
On 03/09/2011 09:59 AM, John Edens wrote: If I am following, 144.96.80.35 is your server address not the clients. In pg_hba.conf the IPs are those from the clients you want to let in, so you will need to use an IP or mask that matches that of your client. To reduce confusion you might want to do

Re: [GENERAL] about memory size reported by system.

2011-03-09 Thread Scott Marlowe
On Wed, Mar 9, 2011 at 9:42 AM, Edmundo Robles L. wrote: > Hi everyone! > > I have a doubt about  the memory consumed by  each connection open. > > suddenly my server, running postgres 8.3.11,  began to run   too slowly. > > Checking the  process with: ps -adelfo pcpu,vsz,args | more > > The proce

Re: [GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-09 Thread Dmitriy Igrishin
2011/3/9 Adrian Klaver > On 03/09/2011 09:59 AM, Dmitriy Igrishin wrote: > >> >> >> 2011/3/9 Adrian Klaver > > >> >> >>On Wednesday, March 09, 2011 5:34:41 am Dmitriy Igrishin wrote: >> >> > >> > But I am missing something or there is a documentation in

Re: [GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-09 Thread Adrian Klaver
On 03/09/2011 09:59 AM, Dmitriy Igrishin wrote: 2011/3/9 Adrian Klaver mailto:adrian.kla...@gmail.com>> On Wednesday, March 09, 2011 5:34:41 am Dmitriy Igrishin wrote: > > But I am missing something or there is a documentation inaccuracy: > http://www.postgresql.org/doc

Re: [GENERAL] How to configure for remote TCP/IP client conncections using MS Visual Basic OLE DB calls and PostgreSQL dll's?

2011-03-09 Thread John Edens
>If I am following, 144.96.80.35 is your server address not the clients. >In pg_hba.conf the IPs are those from the clients you want to let in, so >you will need to use an IP or mask that matches that of your client. To >reduce confusion you might want to do that in the section for remote >conne

Re: [GENERAL] Copying data from one table to another - how to specify fields?

2011-03-09 Thread David Johnston
SELECT username, count(username) FROM phpbb_users GROUP BY username HAVING count(username) > 1; If anything shows up then (phpbb_users .username) is not a unique field but you are trying to insert it into one that is (drupal_users.uid) -Original Message- From: pgsql-general-ow...@postgr

Re: [GENERAL] about memory size reported by system.

2011-03-09 Thread Jaiswal Dhaval Sudhirkumar
Are you using any connection pooling system, if not look at the pgpool & pgbouncer. open connections always reserves memory, which slowdown the performance of system. you can also handle application connections at application level by defining garbage value if any connection disconnect. It

Re: [GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-09 Thread Dmitriy Igrishin
2011/3/9 Adrian Klaver > On Wednesday, March 09, 2011 5:34:41 am Dmitriy Igrishin wrote: > > > > > But I am missing something or there is a documentation inaccuracy: > > > http://www.postgresql.org/docs/9.0/static/functions-formatting.html#FUNCTIO > > NS-FORMATTING-NUMERICMOD-TABLEsays: fill mode

Re: [GENERAL] How to configure for remote TCP/IP client conncections using MS Visual Basic OLE DB calls and PostgreSQL dll's?

2011-03-09 Thread John Edens
Using * should be fine unless you have multiple IP addresses and want the *server* to *listen* on only some of those addresses - say localhost if you were running web and db on the same machine and didn't want to listen to connections from the outside. This setting only determines whe

Re: [GENERAL] select count(*)

2011-03-09 Thread Bill Moran
In response to Rajesh Kumar Mallah : > Dear List , > > if we simply do select count(*) and not specify any table then it gives 1 > eg: > > bric=# SELECT count(*) from job ; > count > --- > 2380 > (1 row) > > bric=# SELECT count(*) job ; > job > - >1 > (1 row) > > > > bric=#

Re: [GENERAL] ER tool that supports domains and custom types?

2011-03-09 Thread Jaiswal Dhaval Sudhirkumar
open system architect (open source), E-R data modeling, DBWrench. If you are planning to go for paid one than E-R data modeling is the best one. -- Thanks & Regards Dhaval Jaiswal -Original Message- From: pgsql-general-ow...@postgresql.org on behalf of Arturo Perez Sent: Wed 3/9/2011

[GENERAL] select count(*)

2011-03-09 Thread Rajesh Kumar Mallah
Dear List , if we simply do select count(*) and not specify any table then it gives 1 eg: bric=# SELECT count(*) from job ; count --- 2380 (1 row) bric=# SELECT count(*) job ; job - 1 (1 row) bric=# SELECT count(*) ; count --- 1 (1 row) bric=# SELECT count(*) j

[GENERAL] Mounting file system for WAL on Solaris 10

2011-03-09 Thread runner
PostgreSQL 9.0.3 on Solaris 10 Sparc I have moved the WAL to a separate file system and set the forcedirectio option per popular recommendation. My question is this: As standard operating procedure in our shop, whenever we mount a UFS file system, we use the "logging" option. Is there a

Re: [GENERAL] equivalent of mysql's SET type?

2011-03-09 Thread Merlin Moncure
On Wed, Mar 9, 2011 at 10:59 AM, Reece Hart wrote: > On Tue, Mar 8, 2011 at 9:41 PM, John R Pierce wrote: >> >> why not just have a set of booleans in the table for these individual >> on/off attributes?   wouldn't that be simplest? > > I like that approach, but I think it's unlikely to fly in th

Re: [GENERAL] equivalent of mysql's SET type?

2011-03-09 Thread Reece Hart
On Tue, Mar 8, 2011 at 9:41 PM, John R Pierce wrote: > why not just have a set of booleans in the table for these individual > on/off attributes? wouldn't that be simplest? I like that approach, but I think it's unlikely to fly in this specific case for a couple reasons. First, there are act

[GENERAL] about memory size reported by system.

2011-03-09 Thread Edmundo Robles L.
Hi everyone! I have a doubt about the memory consumed by each connection open. suddenly my server, running postgres 8.3.11, began to run too slowly. Checking the process with: ps -adelfo pcpu,vsz,args | more The processes,related to the connection to the db, each one have a consume of m

Re: [GENERAL] How to configure for remote TCP/IP client conncections using MS Visual Basic OLE DB calls and PostgreSQL dll's?

2011-03-09 Thread Adrian Klaver
On 03/09/2011 08:30 AM, John Edens wrote: Hey guys, I'm trying to get a VB program to make a client connection to my PostgreSQL server running on an Ubuntu 10.10 server. Here's what I've done: Client side - installed and registered the OLE DB .dll's from the PostgreSQL OLE DB Provider project.

Re: [GENERAL] How to configure for remote TCP/IP client conncections using MS Visual Basic OLE DB calls and PostgreSQL dll's?

2011-03-09 Thread Steve Crawford
On 03/09/2011 07:31 AM, John Edens wrote: Hey guys, I'm trying to get a VB program to make a client connection to my PostgreSQL server running on an Ubuntu 10.10 server listen_addresses = '*, 144.96.80.35, localhost' Using * should be fine unless you have multiple IP addresses and wan

[GENERAL] How to configure for remote TCP/IP client conncections using MS Visual Basic OLE DB calls and PostgreSQL dll's?

2011-03-09 Thread John Edens
Hey guys, I'm trying to get a VB program to make a client connection to my PostgreSQL server running on an Ubuntu 10.10 server. Here's what I've done: Client side - installed and registered the OLE DB .dll's from the PostgreSQL OLE DB Provider project. server side - the configura

[GENERAL] How to configure for remote TCP/IP client conncections using MS Visual Basic OLE DB calls and PostgreSQL dll's?

2011-03-09 Thread John Edens
Hey guys, I'm trying to get a VB program to make a client connection to my PostgreSQL server running on an Ubuntu 10.10 server. Here's what I've done: Client side - installed and registered the OLE DB .dll's from the PostgreSQL OLE DB Provider project. server side - the config

Re: [GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-09 Thread Adrian Klaver
On Wednesday, March 09, 2011 5:34:41 am Dmitriy Igrishin wrote: > > But I am missing something or there is a documentation inaccuracy: > http://www.postgresql.org/docs/9.0/static/functions-formatting.html#FUNCTIO > NS-FORMATTING-NUMERICMOD-TABLEsays: fill mode (suppress padding blanks and > zeroe

Re: [GENERAL] FW: backup using pg_dump postgreSQL 8.3.8

2011-03-09 Thread Andrew Sullivan
On Wed, Mar 09, 2011 at 10:31:56AM -0500, Tom Lane wrote: > Andrew Sullivan writes: > > On Wed, Mar 09, 2011 at 03:58:20PM +0200, Sandy Test wrote: > >> Unfortunately, even with the pg_hba.conf fix of adding host postgres ... > >> trust, > If it is asking for a password, and password authentica

Re: [GENERAL] FW: backup using pg_dump postgreSQL 8.3.8

2011-03-09 Thread Tom Lane
Andrew Sullivan writes: > On Wed, Mar 09, 2011 at 03:58:20PM +0200, Sandy Test wrote: >> We want to be able to run a nightly backup using the pg_dump command. >> >> Unfortunately, even with the pg_hba.conf fix of adding host postgres ... >> trust, >> >> It still asks for a password. > pg_hba s

Re: [GENERAL] FW: backup using pg_dump postgreSQL 8.3.8

2011-03-09 Thread Adrian Klaver
On Wednesday, March 09, 2011 5:58:20 am Sandy Test wrote: > > > > > 2. Is there a way of running a dos script that would run the pg_dump > providing a password when prompted? Using .pgpass http://www.postgresql.org/docs/9.0/static/libpq-pgpass.html > > > > Thanks > > > > Sandy Test > -

Re: [GENERAL] equivalent of mysql's SET type?

2011-03-09 Thread Merlin Moncure
On Tue, Mar 8, 2011 at 11:41 PM, John R Pierce wrote: > On 03/08/11 5:06 PM, Reece Hart wrote: >> >> I'm considering porting a MySQL database to PostgreSQL. That database uses >> MySQL's SET type. Does anyone have advice about representing this type in >> PostgreSQL? >> >> MySQL DDL excerpt: >> CR

Re: [GENERAL] Copying data from one table to another - how to specify fields?

2011-03-09 Thread David Johnston
2 Possibilities (assuming there is a single record with name == 'Alex' in the drupal_users table; not counting uid 0) 1. There is a record with username = 'Alex' in the phpbb_users table 2. Username is not UNIQUE within phpbb_users Write a select statement to extract username from phpbb_user for

Re: [GENERAL] Copying data from one table to another - how to specify fields?

2011-03-09 Thread Alexander Farber
Oh ok, found it: # select one.username, one.user_id, two.user_id from phpbb_users one, phpbb_users two where two.username=one.username and two.user_id <> one.user_id; username | user_id | user_id --+-+- Вячеслав |7564 | 421 Вячеслав | 421 |7564 (2 rows)

Re: [GENERAL] Copying data from one table to another - how to specify fields?

2011-03-09 Thread Alexander Farber
I've also tried renaming 'Alex' to a temp. value: # update drupal_users set name='Alex_1972' where name='Alex'; UPDATE 1 # INSERT INTO drupal_users (uid, name, mail, created, access) SELECT user_id, username, user_email, user_regdate, user_lastvisit FROM phpbb_users WHERE user_id > 50 and

Re: [GENERAL] Using bytea field...

2011-03-09 Thread Andy Colson
On 03/08/2011 09:06 PM, Andy Colson wrote: On 3/8/2011 12:28 PM, Andre Lopes wrote: Hi, I'm using a bytea field to store small images in base64. I need to know if I can compare bytea rows for equality. To know for example if the file already exists in the database, this is possible with bytea?

Re: [GENERAL] FW: backup using pg_dump postgreSQL 8.3.8

2011-03-09 Thread Andrew Sullivan
On Wed, Mar 09, 2011 at 03:58:20PM +0200, Sandy Test wrote: > > We want to be able to run a nightly backup using the pg_dump command. > > Unfortunately, even with the pg_hba.conf fix of adding host postgres ... > trust, > > It still asks for a password. pg_hba sometimes surprises people becaus

Re: [GENERAL] Copying data from one table to another - how to specify fields?

2011-03-09 Thread Alexander Farber
Hello Raymond and others, thank you for looking at my problem! It is a core Drupal 7 table, with a prefix "drupal_" (you can set it while installing Drupal 7 in adv. options). I have only 2 records in that target table: # select uid, name, mail, created, access from drupal_users; uid | name |

Re: [GENERAL] Transaction wraparound vacuum synchronicity

2011-03-09 Thread Andrew Sullivan
On Wed, Mar 09, 2011 at 10:52:25AM +, Michael Graham wrote: > Perhaps I should just force a vacuum on some of the tables the break it? It seems to me that you might want to VACUUM FREEZE the table when it becomes read-only. (I note that FREEZE is deprecated according to the 9.0 manual. Too b

Re: [GENERAL] Copying data from one table to another - how to specify fields?

2011-03-09 Thread Raymond O'Donnell
On 09/03/2011 14:21, Alexander Farber wrote: Oh it is called "INSERT INTO", thank you! I still have a problem though: # select uid, name, mail, created, access from drupal_users; uid | name |mail| created | access -+--++

[GENERAL] ER tool that supports domains and custom types?

2011-03-09 Thread Arturo Perez
Hi all, Anyone have a suggestion for a graphical ER tool that can work with Postgresql's domains and custom types? I was using Mogwai designer but it can't reverse engineer a DB with the above. tia, arturo -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes

[GENERAL] FW: backup using pg_dump postgreSQL 8.3.8

2011-03-09 Thread Sandy Test
We have postgreSQL 8.3.8 installed on a windows 8 server (64 bit). We want to be able to run a nightly backup using the pg_dump command. Unfortunately, even with the pg_hba.conf fix of adding host postgres ... trust, It still asks for a password. 1. Is this a 64bit issue? If the serve

Re: [GENERAL] Copying data from one table to another - how to specify fields?

2011-03-09 Thread Alexander Farber
Oh it is called "INSERT INTO", thank you! I still have a problem though: # select uid, name, mail, created, access from drupal_users; uid | name |mail| created | access -+--+++ 0 | |

Re: [GENERAL] Copying data from one table to another - how to specify fields?

2011-03-09 Thread Michael Glaesemann
On Mar 9, 2011, at 08:47 , Alexander Farber wrote: > Hello, > > I'm using CentOS 5.5 with PostgreSQL 8.4.7 and > am migrating my site from phpBB 3 to Drupal 7. > > I would like to copy these fields from one table: > > select user_id, username, user_email, user_regdate, user_lastvisit > from p

Re: [GENERAL] Copying data from one table to another - how to specify fields?

2011-03-09 Thread Andrew Sullivan
On Wed, Mar 09, 2011 at 02:47:46PM +0100, Alexander Farber wrote: > I would like to copy these fields from one table: > > select user_id, username, user_email, user_regdate, user_lastvisit > from phpbb_users where user_id > 50; > > into the other (already existing) table: > > select uid, nam

Re: [GENERAL] [ADMIN] FW: backup using pg_dump postgreSQL 8.3.8

2011-03-09 Thread Vibhor Kumar
On Mar 9, 2011, at 7:28 PM, Sandy Test wrote: > > We have postgreSQL 8.3.8 installed on a windows 8 server (64 bit). > > We want to be able to run a nightly backup using the pg_dump command. > Unfortunately, even with the pg_hba.conf fix of adding host postgres … trust, > It still asks for a pa

[GENERAL] Copying data from one table to another - how to specify fields?

2011-03-09 Thread Alexander Farber
Hello, I'm using CentOS 5.5 with PostgreSQL 8.4.7 and am migrating my site from phpBB 3 to Drupal 7. I would like to copy these fields from one table: select user_id, username, user_email, user_regdate, user_lastvisit from phpbb_users where user_id > 50; into the other (already existing) tabl

Re: [GENERAL] Web Hosting

2011-03-09 Thread Vincent Veyron
Le lundi 07 mars 2011 à 13:09 -0500, Matt a écrit : > Thanks, but I tried that originally and the companies that come up > have either poor ratings, won't support postgres, won't allow me the > freedom to run my own software This is what I use for hosting the site that's in my sig : http://www.on

Re: [GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-09 Thread Dmitriy Igrishin
2011/3/9 Sim Zacks > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 03/09/2011 03:12 PM, Dmitriy Igrishin wrote: > > > Hey all, > > > > dmitigr=> select to_char(1, '9'); > > to_char > > - > > 1 > > > > dmitigr=> select length(to_char(1, '9')); > > length > > > > 2 > > >

Re: [GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-09 Thread Dmitriy Igrishin
2011/3/9 Pavel Stehule > 2011/3/9 Dmitriy Igrishin : > > > > > > 2011/3/9 Pavel Stehule > >> > >> 2011/3/9 Dmitriy Igrishin : > >> > Hey all, > >> > > >> > dmitigr=> select to_char(1, '9'); > >> > to_char > >> > - > >> > 1 > >> > > >> > dmitigr=> select length(to_char(1, '9')); > >> >

Re: [GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-09 Thread Pavel Stehule
2011/3/9 Dmitriy Igrishin : > > > 2011/3/9 Pavel Stehule >> >> 2011/3/9 Dmitriy Igrishin : >> > Hey all, >> > >> > dmitigr=> select to_char(1, '9'); >> >  to_char >> > - >> >   1 >> > >> > dmitigr=> select length(to_char(1, '9')); >> >  length >> > >> >   2 >> > >> > Why to_ch

Re: [GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-09 Thread Dmitriy Igrishin
2011/3/9 Pavel Stehule > 2011/3/9 Dmitriy Igrishin : > > Hey all, > > > > dmitigr=> select to_char(1, '9'); > > to_char > > - > > 1 > > > > dmitigr=> select length(to_char(1, '9')); > > length > > > > 2 > > > > Why to_char() includes preceding blank space in the result

Re: [GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-09 Thread Sim Zacks
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/09/2011 03:12 PM, Dmitriy Igrishin wrote: > Hey all, > > dmitigr=> select to_char(1, '9'); > to_char > - > 1 > > dmitigr=> select length(to_char(1, '9')); > length > > 2 > > Why to_char() includes preceding blank space in the r

Re: [GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-09 Thread Raymond O'Donnell
On 09/03/2011 13:15, Pavel Stehule wrote: 2011/3/9 Dmitriy Igrishin: Hey all, dmitigr=> select to_char(1, '9'); to_char - 1 dmitigr=> select length(to_char(1, '9')); length 2 Why to_char() includes preceding blank space in the result ? it is compatibility wi

Re: [GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-09 Thread Pavel Stehule
2011/3/9 Dmitriy Igrishin : > Hey all, > > dmitigr=> select to_char(1, '9'); >  to_char > - >   1 > > dmitigr=> select length(to_char(1, '9')); >  length > >   2 > > Why to_char() includes preceding blank space in the result ? it is compatibility with Oracle? Regards Pavel

[GENERAL] Why length(to_char(1::integer, '9')) = 2 ?

2011-03-09 Thread Dmitriy Igrishin
Hey all, dmitigr=> select to_char(1, '9'); to_char - 1 dmitigr=> select length(to_char(1, '9')); length 2 Why to_char() includes preceding blank space in the result ? -- // Dmitriy.

Re: [GENERAL] Composite index structure

2011-03-09 Thread Chetan Suttraway
On Mon, Mar 7, 2011 at 2:49 AM, Nick Raj wrote: > Hi all, > > I want to construct an "Composite Index Structure" i.e. a combination of > gist and btree. > What i am thinking is that first creating a Rtree structure that is > pointing to another Btree structure. > For example, Suppose i want to fi

Re: [GENERAL] Using bytea field...

2011-03-09 Thread rsmogura
On Wed, 09 Mar 2011 13:27:16 +0200, Sim Zacks wrote: MD5 is not collision resistant (using the immortal words of wikipedia http://en.wikipedia.org/wiki/MD5). This means that it is possible that multiple images will return the same md5 hash. The question is, if it screws up and says that an imag

Re: [GENERAL] Using bytea field...

2011-03-09 Thread Sim Zacks
On 03/09/2011 01:27 PM, Sim Zacks wrote: This means that it is possible that multiple images will return the same md5 hash. OTOH, if you had an indexed md5 hash and compared the image only to the matches, that would be a fast and accurate querying method -- Sent via pgsql-general mailing list

Re: [GENERAL] Using bytea field...

2011-03-09 Thread Sim Zacks
MD5 is not collision resistant (using the immortal words of wikipedia http://en.wikipedia.org/wiki/MD5). This means that it is possible that multiple images will return the same md5 hash. The question is, if it screws up and says that an image already exists and then returns a different imag

[GENERAL] Transaction wraparound vacuum synchronicity

2011-03-09 Thread Michael Graham
Hi all, I have a database with a number of tables that are partitioned monthly, after that the tables are mostly read only (on rare occasions we may delete from a table but normally we just drop the partitions). Recently I've noticed that we have a lot of these tables are vacuumed around the same

[GENERAL]

2011-03-09 Thread Vlad Arkhipov
-- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] procedure in db

2011-03-09 Thread Vibhor Kumar
On Mar 9, 2011, at 9:56 AM, abcdef wrote: > I use postgresql in red hat linux . > I want to know how I can find out all the procedure stored in the database . > Any SQL command to do it ??? pg_catalog.pg_proc can be use to find all the functions. Thanks & Regards, Vibhor Kumar EnterpriseDB Corpo

Re: [GENERAL] 9.1 - rewrite less alter table?

2011-03-09 Thread hubert depesz lubaczewski
On Tue, Mar 08, 2011 at 10:43:55PM -0500, Noah Misch wrote: > The patch optimizing that case foundered. We may have it in 9.2. > The current code only kicks in when the destination has no typmod. When the > source/destination type pair are marked "(binary coercible)" in the output of > \dC, the o