Re: [GENERAL] 8.3.5 problem with plpgsql selecting into an array variable

2009-04-05 Thread raf
Tom Lane wrote: > raf writes: > > declare > > pay_group_rec pay_group; > > balance decimal(10,2)[]; > > begin > > select g.* into pay_group_rec from pay_group g where g.id = > > pay_group_id; > > > select > > sum(p.balance_period[1]), > >

Re: [GENERAL] 8.3.5 problem with plpgsql selecting into an array variable

2009-04-05 Thread Tom Lane
raf writes: > declare > pay_group_rec pay_group; > balance decimal(10,2)[]; > begin > select g.* into pay_group_rec from pay_group g where g.id = > pay_group_id; > select > sum(p.balance_period[1]), > sum(p.balance_period[2]) >

[GENERAL] 8.3.5 problem with plpgsql selecting into an array variable

2009-04-05 Thread raf
hi, postgresql-8.3.5 i'm seeing the following unexpected syntax error trying to select into a local array variable element. it seems that this: select sum(expr[1]), sum(expr[2]) into var[1], var[2] from... is being turned into this: select sum(expr[1]), sum(expr[2])[1], $1[2] from... ins

Re: [GENERAL] copy from with trigger

2009-04-05 Thread Tom Lane
Chris spotts writes: > I'm trying to copy from a tab delimited file. The dates inside the file > are Unix timestamp style dates. > I thought the following script would do the trick, but it just gives me > an error saying > ERROR: invalid input syntax for type timestamp: "1238736600" > CONTEXT:

[GENERAL] user defined aggregate for percentile calculations

2009-04-05 Thread Kashmir
cant seem to find anything about this, would it possible at all to create a percentile-aggregate in pgres? any pointers? tia -k -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] copy from with trigger

2009-04-05 Thread Chris spotts
I'm trying to copy from a tab delimited file. The dates inside the file are Unix timestamp style dates. I thought the following script would do the trick, but it just gives me an error saying ERROR: invalid input syntax for type timestamp: "1238736600" CONTEXT: COPY testtable line 1, column acq

Re: [GENERAL] Connect to server PG from laptop java app

2009-04-05 Thread Colin Streicher
Also, I don't know if this applies to windows systems, but on linux systems you have to also modify postgresql.conf On my system, it is in the same directory as pg_hba.conf looks like this: #-- # CONNECTIONS AND AUTHENTIC

Re: [GENERAL] Connect to server PG from laptop java app

2009-04-05 Thread Johan Nel
Jennifer, Jennifer Trey wrote: Hi, I am trying to create my DB schema on the server through my development laptop. I have installed Web Server 2008 and PostgreSQL. They are both running. For some reason its not working. Do I need to open some firewall ports? PostgreSQL runs on 5432. ( I thin

Re[GENERAL] commend ORM for postgresql, good with .net

2009-04-05 Thread novnov
This is really a scattershot question because I have little exposure to ORMs and only vaguely formulated requirements. Some background...I like postgresql a lot and also use sql server and oracle. I/we are usually responsible for all of the parts of an app, from the rdbms to the user interface. W

Re: [GENERAL] Connect to server PG from laptop java app

2009-04-05 Thread Raymond O'Donnell
On 05/04/2009 19:52, Jennifer Trey wrote: > no pg_hba entry for host 85.235 user postgres, database xxx .. ssl off Ah... you need to edit pg_hba.conf and add an entry for the client to allow it access. The documentation in the file itself is pretty good, and there's more here: http://www.p

Re: [GENERAL] Connect to server PG from laptop java app

2009-04-05 Thread Adrian Klaver
On Sunday 05 April 2009 11:28:09 am Jennifer Trey wrote: > Hi, I am trying to create my DB schema on the server through my development > laptop. > I have installed Web Server 2008 and PostgreSQL. They are both running. For > some reason its not working. Do I need to open some firewall ports? > Post

Re: [GENERAL] Connect to server PG from laptop java app

2009-04-05 Thread Raymond O'Donnell
On 05/04/2009 19:52, Jennifer Trey wrote: > no pg_hba entry for host 85.235 user postgres, database xxx .. ssl off > ... I meant to add too that pg_hba.comf is found in the top level of your PostgreSQL data directory. Ray. -- Ra

Re: [GENERAL] Connect to server PG from laptop java app

2009-04-05 Thread Jennifer Trey
no pg_hba entry for host 85.235 user postgres, database xxx .. ssl off ... ?? I guess that means that I need to set up pg then.. how is the question now :) / Jen On Sun, Apr 5, 2009 at 8:35 PM, Raymond O'Donnell wrote: > On 05/04/2009 19:28, Jennifer Trey wrote: > > Hi, I am trying to crea

Re: [GENERAL] Connect to server PG from laptop java app

2009-04-05 Thread ries van Twisk
On Apr 5, 2009, at 1:28 PM, Jennifer Trey wrote: Hi, I am trying to create my DB schema on the server through my development laptop. I have installed Web Server 2008 and PostgreSQL. They are both running. For some reason its not working. Define : "it's" Do I need to open some firewall

[GENERAL] Connect to server PG from laptop java app

2009-04-05 Thread Jennifer Trey
Hi, I am trying to create my DB schema on the server through my development laptop. I have installed Web Server 2008 and PostgreSQL. They are both running. For some reason its not working. Do I need to open some firewall ports? PostgreSQL runs on 5432. ( I think I did that though). Do I need to con

Re: [GENERAL] How to convert integer to boolean in insert

2009-04-05 Thread Tom Lane
Martijn van Oosterhout writes: > On Sun, Apr 05, 2009 at 04:14:37AM -0700, JiangMiao wrote: >> Is there any way to make pgsql implicit cast the integer to boolean? > You might want to create the cast temporarily and after the import > remove it again. The cast exists already, so he can't just "c

Re: [GENERAL] How to convert integer to boolean in insert

2009-04-05 Thread Martijn van Oosterhout
On Sun, Apr 05, 2009 at 04:14:37AM -0700, JiangMiao wrote: > and I found a way to add the cast > insert into foo(banned) values(0::boolean) > but I have a big table which dump from mysqldump and covert by > mysql2pgsql. all of boolean relation values is 0 instead of '0' or > FALSE. > > Is there an

Re: [GENERAL] How to convert integer to boolean in insert

2009-04-05 Thread Thomas Kellerer
JiangMiao wrote on 05.04.2009 13:14: for table foo banned:boolean When try run 'insert into foo(banned) values(0)' It returns ERROR: column "banned" is of type boolean but expression is of type integer LINE 1: insert into foo(banned) values(0) and I found a way to add the cast insert into

[GENERAL] How to convert integer to boolean in insert

2009-04-05 Thread JiangMiao
for table foo banned:boolean When try run 'insert into foo(banned) values(0)' It returns ERROR: column "banned" is of type boolean but expression is of type integer LINE 1: insert into foo(banned) values(0) and I found a way to add the cast insert into foo(banned) values(0::boolean) but I ha