[GENERAL] Choosing primary key type: 64 or 52 bit primary keys?

2011-07-22 Thread Antonio Vieiro
Hi all, I'd like to use an integer number for my primary key. I need it to be bigger than 32 bits. As far as I understand I have two options: a) use all the 64 bits of a 'bigint' b) use the 52 mantissa bits of a 'double precision' My question is, which would be faster for indexing? I assume

Re: [GENERAL] Choosing primary key type: 64 or 52 bit primary keys?

2011-07-22 Thread Radoslaw Smogura
I think there is no difference in indexing int or floats. Only one difference is speed of comparison of this numbers. If you create normal system use 64bit ints. Regards, Radoslaw Smogura (mobile) -Original Message- From: Antonio Vieiro Sent: 22 lipca 2011

Re: [GENERAL] Maximum number of client connection supported by Postgres 8.4.6

2011-07-22 Thread Jenish Vyas
Hi All, Exact Error Message is as follow.. [ERROR] Error getting DB connection: The connection attempt failed. [ERROR] Action commit error: Out of database connections. This is the output I am getting form application server, On database end I am getting nothing. plz suggest. If possible

Re: [GENERAL] Is there a way to 'unrestrict' drop view?

2011-07-22 Thread Willy-Bas Loos
On Thu, Jul 21, 2011 at 3:20 PM, Thomas Pasch thomas.pa...@nuclos.de wrote: I would like to recreate/replace a view, but there are 'dependant objects' on it. Is there a way to 'unrestrict' the dependant check in the current transaction, like it could be done with certain constraints? Hi, Nice

Re: [GENERAL] Maximum number of client connection supported by Postgres 8.4.6

2011-07-22 Thread Albe Laurenz
Jenish Vyas wrote: [unexpectedly runs out of connections] Exact Error Message is as follow.. [ERROR] Error getting DB connection: The connection attempt failed. [ERROR] Action commit error: Out of database connections. This is the output I am getting form application server, On database

[GENERAL] Tracing in Postgres

2011-07-22 Thread Harshitha S
Hi, I am trying to integrate a tracing framework in the Postgres code. I need to know if elog.c under backend/utils/error is the place where the changes can be made. The tracing framework that I want to integrate has some additional capability. I want to replace the tracing and logging

[GENERAL] Timestamp parsing with blanked time part

2011-07-22 Thread Ireneusz Pluta
Hi, consider the following: select quote_literal(blank_hms) as quote_literal(blank_hms), blank_hms::timestamp as blank_hms::timestamp from (select unnest(array['2011-07-22 :', '2011-07-22 : ', '2011-07-22 : : ']::text[]) as blank_hms) a; select version(); quote_literal(blank_hms) |

[GENERAL] Timestamp parsing with blanked time part

2011-07-22 Thread Ireneusz Pluta
Hi, consider the following: select quote_literal(blank_hms) as quote_literal(blank_hms), blank_hms::timestamp as blank_hms::timestamp from (select unnest(array['2011-07-22 :', '2011-07-22 : ', '2011-07-22 : : ']::text[]) as blank_hms) a; select version(); quote_literal(blank_hms) |

Re: [GENERAL] Maximum number of client connection supported by Postgres 8.4.6

2011-07-22 Thread Tomas Vondra
On 22 Červenec 2011, 10:29, Albe Laurenz wrote: Have you considered the possibility that the limit and the error do not originate in that database, but in the application server? If the max_connections is 1200 and you get that error with 1000 of them, it's probably a problem with a connection

Re: [GENERAL] Choosing primary key type: 64 or 52 bit primary keys?

2011-07-22 Thread Achilleas Mantzios
bigint by all means. floating point arithmetic is somewhat more bloated/fuzzy/straight forward than integer, and even if postgresql was perfect regarding floating point comparisons, no one can claim the same for client languages. So define your PK as bigint. Στις Friday 22 July 2011 10:01:58

Re: [GENERAL] COPY TO '|gzip /my/cool/file.gz'

2011-07-22 Thread Willy-Bas Loos
On Wed, Jul 20, 2011 at 8:53 PM, Vibhor Kumar vibhor.ku...@enterprisedb.com wrote: You can use STDOUT to pipe output to a shell command and STDIN to read input from shell command. Something like given below: psql -c COPY mytable to STDOUT|gzip /home/tgl/mytable.dump.gz cat filename|psql -c

Re: [GENERAL] Tracing in Postgres

2011-07-22 Thread Craig Ringer
On 22/07/2011 4:43 PM, Harshitha S wrote: Hi, I am trying to integrate a tracing framework in the Postgres code. I need to know if elog.c under backend/utils/error is the place where the changes can be made. It depends: what exactly are the kinds of events you want to trace? If you're looking

Re: [GENERAL] Choosing primary key type: 64 or 52 bit primary keys?

2011-07-22 Thread Achilleas Mantzios
Στις Friday 22 July 2011 13:25:21 ο/η Achilleas Mantzios έγραψε: bigint by all means. floating point arithmetic is somewhat more bloated/fuzzy/straight forward than integer,

Re: [GENERAL] Is there a way to 'unrestrict' drop view?

2011-07-22 Thread Thomas Pasch
Hi, well, the reason I'm asking is that this *is* posible in Oracle DB. For me it looks like that the DB knows that the view is broken. You can't use it, *but* it is still there (and it will be usable again when the view query is valid again). I completely agree that the view should be usable

Re: [GENERAL] Timestamp parsing with blanked time part

2011-07-22 Thread Tom Lane
Ireneusz Pluta ipl...@wp.pl writes: [ Postgres accepts timestamp input of the form '2011-07-22 :' ] Some other datetime parsers reject it, the Perl DateTime::Format::Pg is an example. Is this case a subject of eventual corrections in the future versions of postgres and it would start emit

Re: [GENERAL] Is there a way to 'unrestrict' drop view?

2011-07-22 Thread Tom Lane
Thomas Pasch thomas.pa...@nuclos.de writes: well, the reason I'm asking is that this *is* posible in Oracle DB. For me it looks like that the DB knows that the view is broken. You can't use it, *but* it is still there (and it will be usable again when the view query is valid again). I

Re: [GENERAL] Is there a way to 'unrestrict' drop view?

2011-07-22 Thread Albe Laurenz
Thomas Pasch wrote: well, the reason I'm asking is that this *is* posible in Oracle DB. For me it looks like that the DB knows that the view is broken. You can't use it, *but* it is still there (and it will be usable again when the view query is valid again). True, but Oracle pays a price for

[GENERAL] interesting finding on order by behaviour

2011-07-22 Thread Samuel Hwang
I ran the same tests in SQL Server 2008R2, Oracle10 and PostgreSQL 9.0.4 and found something interesting... set up = drop table t1 create table t1 (f1 varchar(100)) insert into t1 (f1) values ('AbC') insert into t1 (f1) values ('CdE') insert into t1 (f1) values ('abc') insert into t1 (f1)

Re: [GENERAL] interesting finding on order by behaviour

2011-07-22 Thread Reid Thompson
On Fri, 2011-07-22 at 10:11 -0700, Samuel Hwang wrote: I ran the same tests in SQL Server 2008R2, Oracle10 and PostgreSQL 9.0.4 and found something interesting... results = SQL Server 2008 R2 (with case insensitive data, the ordering follows ASCII order) Oracle 10 (data is

Re: [GENERAL] interesting finding on order by behaviour

2011-07-22 Thread Scott Ribe
On Jul 22, 2011, at 11:11 AM, Samuel Hwang wrote: results = SQL Server 2008 R2 (with case insensitive data, the ordering follows ASCII order) f1 --- AbC abc ABc cde CdE Well, if it's case insensitive, then AbC abc ABc are all equal, so any order for those 3 would be

[GENERAL] Why do I have reading from the swap partition?

2011-07-22 Thread Ioana Danes
Hi Everyone, I am trying to debug a slowness that is happening on one of my production sites and I would like to ask you for some help. This is my environment: --- Dedicated server running: SUSE Linux Enterprise Server 11 (x86_64): VERSION = 11 PATCHLEVEL = 1 RAM = 16GB

[GENERAL] Implementing thick/fat databases

2011-07-22 Thread Karl Nack
I've been following a few blogs (http://database-programmer.blogspot.com/, http://thehelsinkideclaration.blogspot.com/) that make a very compelling argument, in my opinion, to move as much business/transactional logic as possible into the database, so that client applications become little more

Re: [GENERAL] Why do I have reading from the swap partition?

2011-07-22 Thread Scott Marlowe
On Fri, Jul 22, 2011 at 12:19 PM, Ioana Danes ioanasoftw...@yahoo.ca wrote: I do a select * from a 8 GB table (a different one then the one used in the query). At a point it starts using swap space on disk. Once it starts swapping I still let it run for couple of minutes and the I stop it

Re: [GENERAL] Why do I have reading from the swap partition?

2011-07-22 Thread Radosław Smogura
On Fri, 22 Jul 2011 11:19:13 -0700 (PDT), Ioana Danes wrote: Hi Everyone, I am trying to debug a slowness that is happening on one of my production sites and I would like to ask you for some help. This is my environment: --- Dedicated server running: SUSE Linux Enterprise

Re: [GENERAL] Implementing thick/fat databases

2011-07-22 Thread Darren Duncan
Karl Nack wrote: I've been following a few blogs (http://database-programmer.blogspot.com/, http://thehelsinkideclaration.blogspot.com/) that make a very compelling argument, in my opinion, to move as much business/transactional logic as possible into the database, so that client applications

[GENERAL] Dropping extensions

2011-07-22 Thread Marc Munro
In postgres 9.1 I have created 2 extensions, veil and veil_demo. When I install veil, it creates a default (not very useful) version of a function: veil_init(). When I create veil_demo, it replaces this version of the function with it's own (useful) version. If I drop the extension veil_demo, I

[GENERAL] Update columns in same table from update trigger?

2011-07-22 Thread Pablo Romero Abiti
Here's what I want to do: I have a master table that has 2 columns: idcol1 and idcol2, where idcol2 is equivalent to idcol1 Table: color_eq idcol1  idcol2 1      1 2      2 2  3 Table: warehouse idcol    qty 1        10 2        20 if I execute update warehouse set qty=10

Re: [GENERAL] interesting finding on order by behaviour

2011-07-22 Thread Shianmiin Hwang
On Jul 22, 12:20 pm, scott_r...@elevated-dev.com (Scott Ribe) wrote: On Jul 22, 2011, at 11:11 AM, Samuel Hwang wrote: results = SQL Server 2008 R2 (with case insensitive data, the ordering follows ASCII order) f1 --- AbC abc ABc cde CdE Well, if it's case

[GENERAL] Locking several tables within one transaction

2011-07-22 Thread Ilia Lilov
There are two places from which my database can be accessed: 1) PHP code, which only read data from db and sends it to users' browsers; 2) C++ code, which writes data to db one time per 15 minutes (one huge transaction which affects all the tables in db); Both pieces of code use local socket to

Re: [GENERAL] Implementing thick/fat databases

2011-07-22 Thread John R Pierce
On 07/22/11 4:11 PM, Darren Duncan wrote: Karl Nack wrote: I've been following a few blogs (http://database-programmer.blogspot.com/, http://thehelsinkideclaration.blogspot.com/) that make a very compelling argument, in my opinion, to move as much business/transactional logic as possible into

Re: [GENERAL] Locking several tables within one transaction

2011-07-22 Thread Scott Marlowe
On Fri, Jul 22, 2011 at 9:45 AM, Ilia Lilov lilo...@gmail.com wrote: There are two places from which my database can be accessed: 1) PHP code, which only read data from db and sends it to users' browsers; 2) C++ code, which writes data to db one time per 15 minutes (one huge transaction which

Re: [GENERAL] Implementing thick/fat databases

2011-07-22 Thread Darren Duncan
John R Pierce wrote: On 07/22/11 4:11 PM, Darren Duncan wrote: Karl Nack wrote: I've been following a few blogs (http://database-programmer.blogspot.com/, http://thehelsinkideclaration.blogspot.com/) that make a very compelling argument, in my opinion, to move as much business/transactional