Re: [GENERAL] Create loop in postgresql

2012-09-03 Thread Robert Buckley
_zgb) From energie.tennet_auswertung_2010)),2) FROM energie.tennet_auswertung_2010 ); ? ____ Von: Robert Buckley An: salah jubeh ; "pgsql-general@postgresql.org" Gesendet: 19:30 Montag, 3.September 2012 Betreff: Re: [GENERAL] Create loop in postgresql

Re: [GENERAL] Create loop in postgresql

2012-09-03 Thread Robert Buckley
w_zgb) totalsum From energie.tennet_auswertung_2010) as total; How would I update the rows? Cheers for any help, Rob Von: salah jubeh An: Robert Buckley ; "pgsql-general@postgresql.org" Gesendet: 18:23 Montag, 3.September 2012 Betreff: Re: [GENERAL] Create loop

Re: [GENERAL] Create loop in postgresql

2012-09-03 Thread Robert Buckley
Thanksthat worked a treat! cheers, Rob Von: salah jubeh An: Robert Buckley ; "pgsql-general@postgresql.org" Gesendet: 18:23 Montag, 3.September 2012 Betreff: Re: [GENERAL] Create loop in postgresql Hello Robert, I just gave an example and

Re: [GENERAL] Create loop in postgresql

2012-09-03 Thread Robert Buckley
_zgb / (se... Von: salah jubeh An: Robert Buckley ; "pgsql-general@postgresql.org" Gesendet: 17:45 Montag, 3.September 2012 Betreff: Re: [GENERAL] Create loop in postgresql I am wondering why do not you write it like this select name,ges_kw_zgb, select round(100 * (ges_kw_zgb / (se

[GENERAL] Create loop in postgresql

2012-09-03 Thread Robert Buckley
Hi, I am trying to loop through the records in a table and update a column. I can do this with a case statement but I would like to simplify this to a simple loop statement. I can´t seem to work out how to do it though. Here is the case statement. select name,ges_kw_zgb, case When name='Bad Ha

[GENERAL] create a script which imports csv data

2012-06-28 Thread Robert Buckley
Hi, I have to create a script which imports csv data into postgresql ...and have a few questions about the best way to do it. The csv data is automatically created from an external database so I have no influence over which columns etc are downloaded. The csv comes without an fid field and has

WG: [GENERAL] PostgreSQL Naming Rules

2011-10-28 Thread Robert Buckley
- Weitergeleitete Message - Von: Robert Buckley An: Szymon Guz Gesendet: 13:23 Freitag, 28.Oktober 2011 Betreff: Re: [GENERAL] PostgreSQL Naming Rules Thanks, I tried importing a table and I got some errors regarding Character sets. The error suggested I should use Latin1 instead

[GENERAL] PostgreSQL Naming Rules

2011-10-28 Thread Robert Buckley
Hi, according to this article http://www.informit.com/articles/article.aspx?p=409471, the naming of tables, and fields is restricted to 63 characters and must start with an underscore or letter. Nothing is however said about in which character set.  Am I allowed to name a table field < Änderu

Re: [GENERAL] script not working in php

2011-10-06 Thread Robert Buckley
Thankssimple but important! Von: Rodrigo Gonzalez An: Robert Buckley Cc: "pgsql-general@postgresql.org" Gesendet: 14:39 Donnerstag, 6.Oktober 2011 Betreff: Re: [GENERAL] script not working in php On 10/06/2011 09:22 AM, Robert Buckley

[GENERAL] script not working in php

2011-10-06 Thread Robert Buckley
Hi, this works ok in pgadmin3 select name[i], kw[i] from ( select generate_series(1,6) as i,                array['Biomasse', 'Deponiegas', 'Solar', 'Wasser', 'Wind','GESAMT'] as name,                array[biomasse_kw, deponiegas_kw, solar_kw,wasser_kw, wind_kw, kw] as kw        from energie.te

Re: [GENERAL] problem with round() in php script

2011-10-06 Thread Robert Buckley
Im not quite sure what you are referring tothis is my php code. The connection is included, but not in the sql query! Von: Raymond O'Donnell An: Robert Buckley Cc: "pgsql-general@postgresql.org" Gesendet: 10:42 Donnerstag, 6.Oktober 20

[GENERAL] problem with round() in php script

2011-10-06 Thread Robert Buckley
hi, In pgadmin3 this query works ok. SELECT name,round(ges_kw,0) FROM energie.tennet_auswertung_2010; but in php 5.3.2 the result is 0 for all rows $result = pg_query(' SELECT name,round(ges_kw,0) FROM energie.tennet_auswertung_2010 '); What should I do to round up to 0 decimal places? yours

[GENERAL] user-interface to upload csv files

2011-10-05 Thread Robert Buckley
Hi, I am having problems getting csv files into postgres. Does anyone know if there is an opensource user-interface to tackle this? yours, Rob

[GENERAL] Add quto increment to existing column

2011-10-04 Thread Robert Buckley
Hi, I have a column in a table called hist_id with the datatype "integer". When I created the table I assigned this column the primary key constraint but didn´t make it an auto-increment column. How could I do this to an the already existing column? I have created the sequence with the followi

Re: [GENERAL] auto-increment column

2011-10-04 Thread Robert Buckley
neral@postgresql.org Gesendet: 13:43 Dienstag, 4.Oktober 2011 Betreff: Re: [GENERAL] auto-increment column 2011-10-04 13:30 keltezéssel, Robert Buckley írta: Hi, > > >I have a column in a table called hist_id with the datatype "integer". When I >created the table I assigned

[GENERAL] auto-increment column

2011-10-04 Thread Robert Buckley
Hi, I have a column in a table called hist_id with the datatype "integer". When I created the table I assigned this column the primary key constraint but didn´t make it an auto-increment column. How could I do this to an the already existing column? I have created the sequence with the followi