Re: [GENERAL] Money casting too liberal?

2013-03-31 Thread Gavan Schneider
On 30/3/13 at 11:09 PM, D'Arcy J.M. Cain wrote: I am formulating Cain's Law. Something like "If a discussion lasts long enough, someone will mention Godwin's Law." +1 More formally: As an online discussion grows longer, the probability of Godwin's Law being mentioned approaches one

Re: [GENERAL] Money casting too liberal?

2013-03-31 Thread Gavan Schneider
On 30/3/13 at 12:58 AM, D'Arcy J.M. Cain wrote: On Sat, 30 Mar 2013 12:04:21 +1100 Gavan Schneider wrote: No MONEY column would be complete without the ability to specify whether it is normally DEBIT or CREDIT (or in my preferred case That seems extreme. What use case would there ever be fo

Re: [GENERAL] Money casting too liberal?

2013-03-31 Thread Julian
On 31/03/13 21:57, Gavan Schneider wrote: > On 30/3/13 at 12:58 AM, D'Arcy J.M. Cain wrote: > Basically if MONEY is to be a useful tool it should really handle money > matters in a way that makes accountants happy. If it can't do that then > nobody is going to bother using it for serious work since

Re: [GENERAL] pg_stat_get_last_vacuum_time(): why non-FULL?

2013-03-31 Thread CR Lender
On 2013-03-28 20:44, Kevin Grittner wrote: > CR Lender wrote: > >> The database is running on PostgreSQL 8.3.6. > >> I've read the manual more carefully now, and I can't see any mention of >> what VACUUM does that VACUUM FULL does not. The point about extreme >> maintainance is taken, but from w

Re: [GENERAL] Money casting too liberal?

2013-03-31 Thread ajmcello
unsubscribe On Sun, Mar 31, 2013 at 3:31 AM, Gavan Schneider wrote: > On 30/3/13 at 11:09 PM, D'Arcy J.M. Cain wrote: > > I am formulating Cain's Law. Something like "If a discussion lasts >> long enough, someone will mention Godwin's Law." >> > > +1 > > More formally: > As an online disc

Re: [GENERAL] Regular function

2013-03-31 Thread ajmcello
unsubscribe On Sat, Mar 30, 2013 at 9:07 PM, Adrian Klaver wrote: > On 03/30/2013 08:42 PM, ajmcello wrote: > >> unsubscribe >> >> > If you want to unsubscribe: > > > To make changes to your subscription: > http://www.postgresql.org/**mailpref/pgsql-general

Re: [GENERAL] Money casting too liberal?

2013-03-31 Thread Raymond O'Donnell
On 31/03/2013 17:45, ajmcello wrote: > unsubscribe Hi there, Instructions for unsubscribing are in the footer of every email sent from the list: > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org > ) > To make changes to

Re: [GENERAL] Money casting too liberal?

2013-03-31 Thread Leif Biberg Kristensen
Søndag 31. mars 2013 18.45.10 skrev ajmcello : > unsubscribe > > On Sun, Mar 31, 2013 at 3:31 AM, Gavan Schneider wrote: > > On 30/3/13 at 11:09 PM, D'Arcy J.M. Cain wrote: > > I am formulating Cain's Law. Something like "If a discussion lasts > > > >> long enough, someone will mention Godwi

Re: [GENERAL] Money casting too liberal?

2013-03-31 Thread Misa Simic
Hi Gavan, It is more about are problems described can be solved just by datatype at all... Just SUM values in GL transactions table would not make sense in any case to accountants - regardless will result be big number or 0 (what always will/should be in normal situations)... Maybe better would

Re: [GENERAL] Bad plan on a huge table query

2013-03-31 Thread Jeff Janes
On Tue, Mar 26, 2013 at 5:08 AM, Daniel Cristian Cruz < danielcrist...@gmail.com> wrote: > Well, I did it: > > explain (analyze, buffers) > select count(*) from turma.aula_confirmacao where > inicio_aula::DATE BETWEEN DATE_TRUNC('YEAR', CURRENT_TIMESTAMP) AND > CURRENT_TIMESTAMP; -- changed name b

[GENERAL] Problem with pg_basebackup and streaming replication. (9.2.3 / win64)

2013-03-31 Thread Tore Halvorsen
Hi, I'm having problem setting up a slave on windows. I'm doing a pg_basebackup and this seems to work, but when I'm starting the slave with a recovery.conf-file, I'm getting a redo-error with FATAL creating file (path to tablespace) File Exists. This is reproducible. The first slave worked perfe

Re: [GENERAL] Problem with pg_basebackup and streaming replication. (9.2.3 / win64)

2013-03-31 Thread Adrian Klaver
On 03/31/2013 01:15 PM, Tore Halvorsen wrote: Hi, I'm having problem setting up a slave on windows. I'm doing a pg_basebackup and this seems to work, but when I'm starting the slave with a recovery.conf-file, I'm getting a redo-error with FATAL creating file (path to tablespace) File Exists. Thi

[GENERAL] in C trigger function find out if column is part of primary key

2013-03-31 Thread Enke, Dr., Michael
Hello C-(trigger)-experts, I have to find out if a column ( i = 0, ..., tupdesc->natts-1 ) is part of a primary key but for performance reasons I do not want to execute another query via SPI. Is this possible? Currently I did not find a way, instead I check for "not null" attribute tupdesc->attr

[GENERAL] Fwd: JDBC Array double precision [] error

2013-03-31 Thread Juan Pablo Cook
Hi everyone! I need your help with this problem. I'm using PostgreSQL 9.2 Server & the latest jdbc driver: postgresql-9.2-1002.jdbc4.jar I have a table with this column array: -- histograma double precision[] And I want to retrieve this and cast into java to double[] but I can't. This is the e

[GENERAL] Current Schema for Functions called within other Functions

2013-03-31 Thread Lee Hachadoorian
I'm working on some PL/pgSQL functions to generate dynamic SQL. The functions live in the public schema, but the SQL generated will vary depending on what schema they are called from. Something is going on which I cannot figure out. I am defining "variables" by creating a getter function within eac

Re: [GENERAL] Fwd: JDBC Array double precision [] error

2013-03-31 Thread Hannes Erven
Hi Juan Pablo, > double[] array = (double[]) rs1.getArray("histograma").getArray(); java.lang.ClassCastException: [Ljava.lang.Double; cannot be cast to [D The error message already tells you the solution: use Double, not double. Like this: Double[] array = (Double[]) rs1.getArray("histogra

Re: [GENERAL] Money casting too liberal?

2013-03-31 Thread Gavan Schneider
On 31/3/13 at 5:20 AM, D'Arcy J.M. Cain wrote: On Sun, 31 Mar 2013 21:57:49 +1100 Gavan Schneider wrote: On 30/3/13 at 12:58 AM, D'Arcy J.M. Cain wrote: That seems extreme. What use case would there ever be for making a column always debit or always credit? I have a G/L system and most money

Re: [GENERAL] Fwd: JDBC Array double precision [] error

2013-03-31 Thread Juan Pablo Cook
Hi Hannes... Thanks a lot for your help! I was stuck being many many hours trying and googling it the problem but didn't realize that. This: *Double[] array = (Double[]) rs1.getArray("histograma").get**Array();* solve my problem! Thanks again!! Juan Cook On Sun, Mar 31, 2013 at 7:38 PM, Han

[GENERAL] Using varchar primary keys.

2013-03-31 Thread Tim Uckun
Consider the following scenario. I have a typical tagging structure. There is a table called tags, there is a table called taggings. The taggings table acts as a many to many join table between the taggers and the tags. The tags table has two fields id and tag. id is a serial data type. The tagg

[GENERAL] my-post-engine, let's make MySQL speak to PostgreSQL

2013-03-31 Thread Pierre
Hello I just "released" (aka made known to more people than me and my desk-neighboors) a tiny tool that may come handy to some people. It's a MySQL "plugin" (their definition of plugin is flabbergasting) that provides a postgres storage engine in a MySQL instance. It's usable both for select/up

Re: [GENERAL] Using varchar primary keys.

2013-03-31 Thread Misa Simic
Hi Tim, Debate "natural" vs "surrogate" key last for a too long time - with no official winner... I think it is more "religional" then real issue... Advice will be simple: pick approach what best fit your needs, taking into account now and tomorrow (probability of change)... SQL standard and no

Re: [GENERAL] Using varchar primary keys.

2013-03-31 Thread Modulok
On 3/31/13, Tim Uckun wrote: > Consider the following scenario. > > I have a typical tagging structure. There is a table called tags, there is > a table called taggings. The taggings table acts as a many to many join > table between the taggers and the tags. > > The tags table has two fields id an

Re: [GENERAL] Using varchar primary keys.

2013-03-31 Thread Julian
On 01/04/13 12:19, Modulok wrote: > On 3/31/13, Tim Uckun wrote: >> Consider the following scenario. >> >> I have a typical tagging structure. There is a table called tags, there is >> a table called taggings. The taggings table acts as a many to many join >> table between the taggers and the tags

Re: [GENERAL] Using varchar primary keys.

2013-03-31 Thread Gavan Schneider
On 1/4/13 at 10:35 AM, Tim Uckun wrote: Consider the following scenario. Since I don't consider myself an expert I am talking in basic terms below. Please don't misunderstand this plodding as anything other than me attempting to be as clear as possible. These comments reflect my understandi

Re: [GENERAL] Using varchar primary keys.

2013-03-31 Thread Tim Uckun
> > > Natural Keys have a purpose but when do they exist in the database? > > In my case it's the tags. Table tags has only two columns id and tag. Each one has a unique index. I have many other similar lookup tables. For example things like order_status, item_type etc. > What about the Natural

Re: [GENERAL] Using varchar primary keys.

2013-03-31 Thread Jasen Betts
On 2013-04-01, Tim Uckun wrote: > --14dae93996072d9ff304d945bd3c > Content-Type: text/plain; charset=UTF-8 > >> >> >> Natural Keys have a purpose but when do they exist in the database? >> >> > In my case it's the tags. Table tags has only two columns id and tag. Each > one has a unique index. I

Re: [GENERAL] Using varchar primary keys.

2013-03-31 Thread Tim Uckun
> > how about using an enum instead of this table? > > That's an interesting idea. Are enums mutable?

Re: [GENERAL] Using varchar primary keys.

2013-03-31 Thread Jasen Betts
On Mon, Apr 01, 2013 at 07:08:15PM +1300, Tim Uckun wrote: > > > > how about using an enum instead of this table? > > > > > That's an interesting idea. Are enums mutable? since 9.1 you can add values. http://www.postgresql.org/docs/9.1/static/sql-altertype.html -- ⚂⚃ 100% natural -- Sent