[GENERAL] 9.0: plpgsql eror when restoring a database as a non superuser

2011-10-22 Thread stefan
eneral/2010-12/msg00499.php Is there a way that this error can be prevented when restoring a database as a non superuser? I am already aware of a workaround using -l and -L, but I would strongly prefer the elegance of letting the bare psql tools do their job properly. Cheers, Stefan. -- Se

Re: [GENERAL] 9.0: plpgsql eror when restoring a database as a non superuser

2011-10-22 Thread stefan
On 22-10-11 16:12, Adrian Klaver wrote: On Saturday, October 22, 2011 2:12:14 am stefan wrote: pg_restore: [archiver (db)] could not execute query: ERROR: must be owner of language plpgsql Command was: CREATE OR REPLACE PROCEDURAL LANGUAGE plpgsql; Is there a way that this error can

Re: [GENERAL] 9.0: plpgsql eror when restoring a database as a non superuser

2011-10-22 Thread stefan
. Adrian, Thanks for suggesting that. I had not thought about that option and it may just be the best. Cheers, Stefan. -- 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] 9.0: plpgsql eror when restoring a database as a non superuser

2011-10-22 Thread stefan
On 22-10-11 18:21, Tom Lane wrote: Or just ignore the error during restore. Hi Tom, for a manual restore I could just live with that, but this is a semi automated setup and we feel very strongly about acting on pg_restore's exit code. Cheers, Stefan. -- Sent via pgsql-general ma

[GENERAL] get sequence from remote server

2005-07-24 Thread Stefan
g pl/pgsql? thx Stefan ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

[GENERAL] Analyse Logfile postgresql

2005-07-29 Thread Stefan
Hi, does anyone know a tool for analysing the postgres logfile? thanks, stefan ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] pgmonitor

2005-08-02 Thread stefan
> i want to list non-system tables with psql and get the following error. any > alternatives? Thanks. > > EPost-# \dt > ERROR: invalid byte sequence for encoding "UNICODE": 0xed > > my database used UNICODE as the encoding. and the OS is win2k pro wich > simplified chinese > as default language.

[GENERAL] Overlap function for hstore?

2015-04-03 Thread Stefan Keller
ray overlaps op takes every element (even 'a' or 2 alone) and doesn't test for key and value together like in 'b=>2'! Any clever ideas? Yours, Stefan -- 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] Postgresql Development Options

2015-04-05 Thread Stefan Keller
es:: http://docs.sqlalchemy.org/en/latest/dialects/postgresql.html Cheers, Stefan 2015-04-06 0:28 GMT+02:00 Adrian Klaver : > On 04/05/2015 01:46 PM, Ray Madigan wrote: >> >> The application will be very small, its main function is as a data >> acquision tool that reads data

Re: [GENERAL] Overlap function for hstore?

2015-04-05 Thread Stefan Keller
.value)) FROM ( SELECT each((select 'a=>1,b=>2,c=>3'::hstore)) as tmp_attr INTERSECT ALL SELECT each((select 'a=>2,d=>4,b=>2'::hstore)) as tmp_attr ) tmp_table; Cheers, S, 2015-04-04 3:16 GMT+02:00 David G. Johnston : > On Fri, Apr 3, 2015 at 5:37

[GENERAL] About COPY command (and probably file fdw too)

2015-05-20 Thread Stefan Stefanov
useful in file fdw too. To be able to re-arrange columns’ order would come as a free bonus for users. Sincerely, Stefan Stefanov

Re: [GENERAL] About COPY command (and probably file fdw too)

2015-05-21 Thread Stefan Stefanov
;stafflist". myfile.txt has many columns. COPY stafflist (userid, username, staffid) FROM 'myfile.txt' WITH (FORMAT text, DELIMITER E'\t', COLUMNS (1, 2, 7), ENCODING 'windows-1250') BR, Stefan Оригинално писмо От: Nicolas Paris nipa

Re: [GENERAL] About COPY command (and probably file fdw too)

2015-05-22 Thread Stefan Stefanov
Hi, I agree, pgloader seems to be right. And yes, it’s a matter of complexity and usability estimation. Stefan From: David G. Johnston Sent: Friday, May 22, 2015 12:19 AM To: Nicolas Paris Cc: Stefan Stefanov ; Forums postgresql Subject: Re: [GENERAL] About COPY command (and probably file fdw

Re: [GENERAL] About COPY command (and probably file fdw too)

2015-05-22 Thread Stefan Stefanov
What you suggest is exactly the second option in the first message below but that’s a real lot of overhead. From: Melvin Davidson Sent: Thursday, May 21, 2015 11:48 PM To: Nicolas Paris Cc: Stefan Stefanov ; Forums postgresql Subject: Re: [GENERAL] About COPY command (and probably file fdw

[GENERAL] FOSDEM 2016, 30th and 31st January 2016, Brussels: Call for Participation

2015-10-13 Thread Stefan Keller
Geospatial devroomː https://titanpad.com/VCAR6DZfHG Website: https://fosdem.org/2016/news/2015-09-24-call-for-participation/ :Stefan -- 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] Slides for PGCon2016; "FTS is dead ? Long live FTS !"

2016-05-31 Thread Stefan Keller
;s using methods as extension * it's inspired by inverted index * and uses position information to calculate rank and order results So I propose: "Ranking UMdex" ;-) :Stefan 2016-05-30 22:33 GMT+02:00 Andreas Joseph Krogh : > På mandag 30. mai 2016 kl. 22:27:11, skrev

[GENERAL] FTS with more than one language in body and with unknown query language?

2016-07-13 Thread Stefan Keller
dictionary which contains word translations en-de instead of synonyms en-en? * Any hints to related work where FTS has been used in a multilingual context? :Stefan -- 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] FTS with more than one language in body and with unknown query language?

2016-07-14 Thread Stefan Keller
приве́т! Artur Thanks for your explanations. 2016-07-14 17:20 GMT+02:00 Artur Zakirov : > On 14.07.2016 01:16, Stefan Keller wrote: ... >> * Should I create a synonym dictionary which contains word >> translations en-de instead of synonyms en-en? > > This synonym dict

Re: [GENERAL] FTS with more than one language in body and with unknown query language?

2016-07-15 Thread Stefan Keller
ave some issues to resolve...? :Stefan 2016-07-15 11:02 GMT+02:00 Artur Zakirov : > Hello, Stefan! > > On 15.07.2016 01:54, Stefan Keller wrote: >> >> приве́т! Artur >> >> Thanks for your explanations. >> >> 2016-07-14 17:20 GMT+02:00 A

Re: [GENERAL] Do parallel queries work with only dblink not with fdw?

2016-09-08 Thread Stefan Keller
Hi, Sorry for appending to that thread, but I think this is related: Does anyone have experience with parsel [1] and/or it's extension parallelsql [2]? :Stefan [1] http://geeohspatial.blogspot.ch/2013/12/a-simple-function-for-parallel-queries_18.html [2] https://github.com/k1aus/parall

Re: [GENERAL] PostgreSQL 9.5 and process REST calls enquiry

2016-03-05 Thread Stefan Keller
cript serverside). * connect to (m)any db inc. Postgres, like Spring Boot (Java EE) or sandman2 (Python) PostgREST looks promising. But since Postgres 9.5 ff. has good JSON support (and given I like Python) I'd prefer an even more lightweight solution. Any suggestions? :Stefan 2016-02-12 17:46

[GENERAL] Filtering the results of UNION ALL vs filtering the separate queries

2016-04-27 Thread Stefan Weiss
t it probably wasn't a good fit for that site.) Thanks in advance, Stefan [1] http://dba.stackexchange.com/questions/136653/ -- 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] Slides for PGCon2016; "FTS is dead ? Long live FTS !"

2016-05-29 Thread Stefan Keller
one before "6.7 mln classifieds"): What does "Queries in 8 h 9.2 +patch (9.6 rum)" mean? 2. What does R-U-M mean? (can't mean "Range Usage Metadata" which was finally coined range index BRIN)? :Stefan, co-organizer of Swiss PGDay 2016-05-29 11:29 GMT+02:00 Andre

Re: [GENERAL] why postgresql over other RDBMS

2007-05-26 Thread Stefan Kaltenbrunner
Tom Lane wrote: > Stefan Kaltenbrunner <[EMAIL PROTECTED]> writes: >> Tom Lane wrote: >>> A more interesting question is what sort of hardware you need for that >>> actually to be a win, though. Loading a few tables in parallel sounds >>> like an

Re: [GENERAL] pointer to feature comparisons, please

2007-06-13 Thread Stefan Kaltenbrunner
g a function to hide that is cheating the database - oracle might actually be more(!) clever here not less ...). this why you can get into all kind of weird situations with losing the integrity of your data or running into serious issues during dump/restore for example. What you need to do here is to

Re: [GENERAL] pointer to feature comparisons, please

2007-06-13 Thread Stefan Kaltenbrunner
Kevin Hunter wrote: > At 3:26p -0400 on 13 Jun 2007, Stefan Kaltenbrunner wrote: >>> The way that I currently know how to do this in Postgres is with >>> PLpgSQL functions. Then I add something like >>> >>> CONSTRAINT away_team_is_playing CHECK ( NO

[GENERAL] Loop through all views with PHP

2007-06-18 Thread Stefan Schwarzer
Hi there, my app is creating views for a certain task; now, I would like to run on a regular basis a script which deletes these views. As they are named with the date/hour/min/sec-appendix to make each view unique, I don't know the names myself (Ok, I could stock the names in a separate t

[GENERAL] how to: psql -U user --password password ?

2007-07-03 Thread Stefan Zweig
some very large *.sql files to import) and more convenient to do the import directly via psql instead of using jdbc/odbc. i appreciate any help. thanks in advance, stefan ___ Jetzt neu! Schuetzen Sie Ihren PC mit McAfee und

[GENERAL] Day of week vs. Language

2007-07-09 Thread Stefan Christ
on the language settings, or will the value 0 ALWAYS be a Sunday? Thanks in advance, Stefan ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's data

Re: [GENERAL] Limit number connections by IP

2007-07-13 Thread Stefan Kaltenbrunner
; can't have more than 5 connections open. > > It is possible? no - you can limit the maximum numbers of connections on a per database and also a per role base. If you really need a per source address limitation look into using whatever firewall solution is available on your OS. Stefan

Re: [GENERAL] Limit connections per username

2007-07-13 Thread Stefan Kaltenbrunner
Nik wrote: > PostgreSQL 8.2 on Windows 2003 Server. > > Is it possible to limit number of connections per username? yes - look for CONNECTION LIMIT on: http://www.postgresql.org/docs/8.2/static/sql-createrole.html and http://www.postgresql.org/docs/8.2/static/sql-alterrole.html

Re: [GENERAL] count the number of bits set to 1 in a bit string field

2007-07-15 Thread Stefan Becker
his would do it: select sum(case when (some_int & x'0004'::int)=0 then 0 else 1 end) as count_of3thbit, sum(case when (some_int & x'0020'::int)=0 then 0 else 1 end) as count_of6thbit from mytable ; constant x'0004'::int = 4 constant x'0020

Re: [GENERAL] createing indexes on large tables and int8

2007-07-16 Thread Stefan Kaltenbrunner
for "only" 100M rows - I wonder what kind of hardware that is and how much concurrent activity is going on ... Stefan ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail comm

Re: [GENERAL] PGInstaller Project

2007-07-24 Thread Stefan Berglund
ll the configuration by hand? I >want to ship PG with a desktop software and I'd rather choose all the >defaults myself rather than try to talk a novice user through setting >up PG. I wrote a VB wrapper and install PG from an embedded resource. It handles all the messy details t

Re: [GENERAL] PGInstaller Project

2007-07-24 Thread Stefan Berglund
t;> looks like what I need but I'm worried that it's abandoned. I see a >> beta posted back in April but nothing more since then. > >pgInstaller certainly isn't dead - it's the installer for the official windows >binary releases of PostgreSQL. I

Re: [GENERAL] [pgsql-advocacy] European users mailing list

2007-07-30 Thread Stefan Kaltenbrunner
y time will tell if we ever need eupug@, pgsql-eu-advocacy@ or nothing at all. > >> But for now, I was asked to arrange a general mailing list, which I have >> done. >> > > Except we already had a general european mailing list, so I'm really not > clear > on wh

Re: [GENERAL] Postgresql performance in production environment

2007-08-19 Thread Stefan Kaltenbrunner
;re usually skeptical about connection pooling > in general (or is that just the mysqli_pconnect() hangover?) pgbouncer works quite fine here. Stefan ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

[GENERAL] SQL query with IFs (?) to "Eliminate" NULL Values

2007-09-05 Thread Stefan Schwarzer
Hi there, I want to calculate per Capita values on-the-fly, taking for example the "Total GDP" data set and divide it by "Total Population". Now, each of these data sets have a couple of "0" or "-" values (the latter being the indicator for : "no data available"). Until now I have it

[GENERAL] Rankinf of Results?

2007-09-06 Thread Stefan Schwarzer
Hi there, I would like to achieve some kind of rating of the results of a query. As it searches in different fields of the (metadata) database, matching keywords of the field of the "data variable names" are more important than matching keywords in the "description" field... I have no ide

[GENERAL] Alias "all fields"?

2007-09-06 Thread Stefan Schwarzer
Hi there, I guess I am demanding too much But it would be cool to have some kind of alias for "all fields". What I mean is this here: Instead of this: SELECT * FROM gdp WHERE y1970 NOT NULL AND y1971 NOT NULL AND y2005 NOT NULL I would like to have this: SELECT *

Re: [GENERAL] Alias "all fields"?

2007-09-06 Thread Stefan Schwarzer
5 3 NULL 94 102 What do you think? Greetings, -Franz -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Stefan Schwarzer Gesendet: Donnerstag, 6. September 2007 13:43 An: pgsql-general@postgresql.org Betreff: [SPAM] [GEN

Re: [GENERAL] Alias "all fields"?

2007-09-10 Thread Stefan Schwarzer
Ouff thanks for all these replies. A reason for this kind of design yeah, I guess these here: a) not being a professional database designer b) import through Excel exports... that is, the QC, harmonization and aggregations are being done in Excel, and then the final result is being e

[GENERAL] Database/Table Design for Global Country Statistics

2007-09-12 Thread Stefan Schwarzer
Hi there, I learned in another posting that my table design - in a polite way - "could be improved". So, before doing any additional design errors, I would like to get feedback, if possible. I am dealing with some 500 tables for worldwide national statistics (GDP, population, environmen

Re: [GENERAL] Database/Table Design for Global Country Statistics

2007-09-12 Thread Stefan Schwarzer
Thanks for the feedback and the suggestions. A problem I have now when using the new design is the following: As a result from my PostGres query I get something like this: year|value |name --- 2001| 123 | Afghanistan

Re: [GENERAL] Database/Table Design for Global Country Statistics

2007-09-12 Thread Stefan Schwarzer
e). All I can do is offer you a moment of relaxation by looking at some really nice nature/landscape photos @ http://photoblog.la-famille-schwarzer.de Cheers, Stef On Sep 12, 2007, at 11:45 AM, Richard Huxton wrote: Stefan Schwarzer wrote: Thanks for the feedback and the suggestions. A

Re: [GENERAL] Database/Table Design for Global Country Statistics

2007-09-13 Thread Stefan Schwarzer
$curr_yr = -1 $cols = array(); while () { if ($row['year'] != $curr_yr) { if (sizeof($cols) > 0) { display_table_row($cols); } $cols = array(); $curr_year = $row['year']; } $cols[] = $row['value']; } // handle possible last row of table if (sizeof($cols) > 0) { display_table_row(

Re: [GENERAL] Database/Table Design for Global Country Statistics

2007-09-13 Thread Stefan Schwarzer
$curr_yr = -1 $cols = array(); while () { if ($row['year'] != $curr_yr) { if (sizeof($cols) > 0) { display_table_row($cols); } $cols = array(); $curr_year = $row['year']; } $cols[] = $row['value']; } // handle possible last row of table if (sizeof($cols) > 0) { display_table_ro

Re: [GENERAL] Database/Table Design for Global Country Statistics

2007-09-13 Thread Stefan Schwarzer
Umm - not sure what you're after. What's wrong with one of: SELECT ... ORDER BY year, value SELECT ... ORDER BY value, year Or did you want a particular year pulled out of the general list, in which case try something like: SELECT ... ORDER BY (year = 1970), year, value SELECT ... OR

Re: [GENERAL] Database/Table Design for Global Country Statistics

2007-09-13 Thread Stefan Schwarzer
Uiuiui and it gets even worse... I want to implement the possibility to calculate on-the-fly the per Capita values for the selected data set. With the "old" table design it would be something like this: SELECT (fish_catch.y_1970 / pop_total.y_1970), (fish_catch.y_1971 / pop_tota

[GENERAL] Data Model - Linking to PHP Code - Literature

2007-09-13 Thread Stefan Schwarzer
Of course you should really have a data model that knows what it wants to sort by and constructs the query appropriately. The table- drawing code can then ask the data-model for heading-names and sort- order details. It's more work up-front, but you only have to do it once and then you can

Re: [GENERAL] Database/Table Design for Global Country Statistics

2007-09-14 Thread Stefan Schwarzer
SELECT f.year, f.id, c.name, (f.value / p.value) AS per_capita FROM fish_catch AS f JOIN pop_total AS p USING (year, id) INNER JOIN countries AS c ON f.id = c.id ORDER BY (year = 2005), value, name Seems to never end Why is redesigning tables so difficult?! :-)) And fur

[GENERAL] Calculate Weighted Aggregation between Two Tables

2007-09-19 Thread Stefan Schwarzer
mathematical procedure... Could someone give me a hint how this could be achieved? Thanks for any help! Stef ___ Stefan Schwarzer Nature Photography: http://photoblog.la-famille-schwarzer.de UNEP GEO Data Portal: http://geodata.grid.unep.ch ___

[GENERAL] Compare Content in Multidimensional Array [PHP/SQL]

2007-09-26 Thread Stefan Schwarzer
the "smallest_common_year"?! If not, I wonder how, by using PHP, I can get that information... Can anyone give me a hint? Thank you very much! Stef ____ Stefan Schwarzer Lean Back and Relax - Enjoy some Nature P

[GENERAL] Find "smallest common year"

2007-09-27 Thread Stefan Schwarzer
hanks for any help! Stef ________ Stefan Schwarzer Lean Back and Relax - Enjoy some Nature Photography: http://photoblog.la-famille-schwarzer.de Appetite for Global Data? UNEP GEP Data Portal: http://geodata.grid.unep.ch

Re: [GENERAL] Find "smallest common year"

2007-09-27 Thread Stefan Schwarzer
wrote: If I understood your question, maybe it's you want: SELECT min() FROM table1 JOIN table2 ON (table1.data_field = table2.data_field); 2007/9/27, Stefan Schwarzer <[EMAIL PROTECTED] >: Hi there, my aim is to plot a line graph for a single country but for two or three

Re: [GENERAL] Find "smallest common year"

2007-09-27 Thread Stefan Schwarzer
es, 500 regional and 500 subregional and 500 global aggregations? Years being covered having something between 10 and 60 years for each of these variables. All available for 240 countries/ territories. Thanks for any recommendations! Stef Stefan Schwarzer wrote: Sorry, I forgot to men

[GENERAL] Normalized Tables & SELECT [was: Find "smallest common year"]

2007-09-28 Thread Stefan Schwarzer
last time we came up with SubSelects for each year. So, does this make sense? Thanks a lot for your help! Stef ____ Stefan Schwarzer Lean Back and Relax - Enjoy some Nature Photography: http://photob

[GENERAL] How to avoid: 9.50184e+06

2007-09-28 Thread Stefan Schwarzer
Hi there, how can I avoid results like this: 9.50184e+06 Instead it should return the "real" value, as 950184. Thanks for any hints! Stef Lean Back and Relax - Enjoy some Nature Photography: http://photoblog.la-famille

Re: [GENERAL] Normalized Tables & SELECT [was: Find "smallest common year"]

2007-09-28 Thread Stefan Schwarzer
Ah, but there is a standardised list of country-codes ideal for the DBA since the code is (usually) easily understandable. http://en.wikipedia.org/wiki/ISO_3166 The only problem might be if historical data uses old boundaries (e.g. Soviet Union, Yugoslavia). Yep, have all of them (ISO-2, I

Re: [GENERAL] Normalized Tables & SELECT [was: Find "smallest common year"]

2007-10-01 Thread Stefan Schwarzer
- one table for the years names/ids/etc. (1970, 1; 1971, 2; 1973, 3; ) If you _do_ need this table (because you want to constrain your statistical data to only contain a specific set of years, or because you need a quick list of available years to select from): Make the year pri

Re: [GENERAL] Normalized Tables & SELECT [was: Find "smallest common year"]

2007-10-01 Thread Stefan Schwarzer
BTW, You didn't actually use type text for your year column, did you? No quotes needed then. Otherwise you'd have to make sure your year values are all the same length or sorting gets... interesting. Yep, my comment just before concerns especially this paragraph, I guess. With not only ye

Re: [GENERAL] Normalized Tables & SELECT [was: Find "smallest common year"]

2007-10-01 Thread Stefan Schwarzer
I find it far easier to maintain normalized tables that produced non-normalized ones (for things like data warehousing) than it is to maintain non-normalized tables and trying to produce normalized data from that. Ok, I do understand that. So, instead of the earlier mentioned database design, I

Re: [GENERAL] Normalized Tables & SELECT [was: Find "smallest common year"]

2007-10-01 Thread Stefan Schwarzer
An entirely different question is whether it is a good idea to write a range as a value that the database cannot interpret correctly (referring to the '1970-75' notation). You cannot group records by value this way if you need to (for example) combine data from '1970' with data from '1970-75'

[GENERAL] Find min year and min value

2007-10-02 Thread Stefan Schwarzer
Hi there, I am trying to find in a table with different variables, countries and years the lowest year and within that year the lowest value The following SELECT works, but I wonder if it is "elegant". Can you recommend any other solution? SELECT

Re: [GENERAL] Find min year and min value

2007-10-02 Thread Stefan Schwarzer
Hi there, I am trying to find in a table with different variables, countries and years the lowest year and within that year the lowest value The following SELECT works, but I wonder if it is "elegant". Can you recommend any other solution? SELECT value AS minv FROM public_on_table.d

Re: [GENERAL] Find min year and min value

2007-10-02 Thread Stefan Schwarzer
SELECT year, value FROM ... I feel ashamed such a simple solution... gush Thanks for that! Unfortunately it doesn't stop there... If I want to find the "common smallest year" for two given variables (say, I have years 1970, 1971, 2005 for variable 1 (GDP) and 1980, 1981,... 200

Re: [GENERAL] Find min year and min value

2007-10-02 Thread Stefan Schwarzer
to get your advice. Thanks a lot! Stef ____ Stefan Schwarzer Lean Back and Relax - Enjoy some Nature Photography: http://photoblog.la-famille-schwarzer.de Appetite for Global Data? UNEP GEO Data Portal:

Re: [GENERAL] Find min year and min value

2007-10-04 Thread Stefan Schwarzer
Having 500 statistical global national variables for about 240 countries/territories. Need to do regional aggregations, per Capita calculations and some completeness computations on-the-fly. id_variable |year|value |id_country Both Steve and I have given you alternat

[GENERAL] How to convert rows into HTML columns?

2007-10-04 Thread Stefan Schwarzer
Hi there, I feel like a brain-washed person being slowly re-socialized. After changing from an Excel-like database design to a "central table" one (see here: http://archives.postgresql.org/pgsql-general/2007-10/ msg00132.php ) I am struggling with multiple problems... One is now the HTML t

Re: [GENERAL] How to convert rows into HTML columns?

2007-10-05 Thread Stefan Schwarzer
And the next question coming up is: How should my query look like so that I can sort the (HTML) table by a specific year in ascending or descending order? So, that it doesn't display it by the country names alphabetical order, but by, say 1998? If you have only one row, how would you sort this

Re: [GENERAL] Find min year and min value

2007-10-05 Thread Stefan Schwarzer
Alternately, you could have a gdp table and a fish_catch table which would be easily joined to give the same result. Expanding on this: create table fish_catches (country text not null, data_year date not null, primary key (country, data_yea

Re: [GENERAL] Find min year and min value

2007-10-05 Thread Stefan Schwarzer
Hmmm. Don't really get that query working. My SQL looks like this now: SELECT id_country, year, value FROM internet_users NATURAL JOIN gdp WHERE id_country = 8 ORDER BY year LIMIT 1 Ok, got it working with another proposed SQL SELECT. This is a solution (comes out

[GENERAL] ORDER BY - problem with NULL values

2007-10-10 Thread Stefan Schwarzer
Thanks for any info... Stef ____ Stefan Schwarzer Lean Back and Relax - Enjoy some Nature Photography: http://photoblog.la-famille-schwarzer.de Appetite for Global Data? UNEP GEO Data Portal: http://geodata.grid.unep.ch

Re: [GENERAL] ORDER BY - problem with NULL values

2007-10-10 Thread Stefan Schwarzer
Hi there, if I order a given year in DESCending ORDER, so that the highest values (of a given variable) for the countries are displayed at the top of the list, then actually the NULL values appear as first. Only below, I find the values ordered correctly. Is there any way to a) make the

[GENERAL] Calculation of per Capita on-the-fly - problems with SQL syntax

2007-10-11 Thread Stefan Schwarzer
Hi there, I need to calculate per Capita data on-the-fly. My table for a given variable looks like this: year|value |id_country --- 2001| 123 | 1 2002| 125 | 1 2003| 128 |

Re: [GENERAL] ORDER BY - problem with NULL values

2007-10-11 Thread Stefan Schwarzer
From 8.3 beta release notes: - ORDER BY ... NULLS FIRST/LAST I think this is what you want right? Yes, indeed. Sounds great. unfortunately I am on 8.1. And wouldn't really want to migrate to 8.3 and beta for the moment Thanks anyway! Stef ---(end of broadca

Re: [GENERAL] Calculation of per Capita on-the-fly - problems with SQL syntax

2007-10-15 Thread Stefan Schwarzer
This should give you the same data out in a different format. Note that most of the NULL values will be excluded from this result. SELECT cname, year, d.value/pt.value FROM public_multiple_tables.agri_area AS d INNER JOIN public_multiple_tables.pop_total AS pt ON pt.id_country = d.id_c

Re: [GENERAL] Calculation of per Capita on-the-fly - problems with SQL syntax

2007-10-16 Thread Stefan Schwarzer
I suggest using two *date* (or possibly integer) columns for each row and consider each row an year interval (in the mathematical sense, not to be confused with SQL intervals, which are actually durations). Depending on the interval representation you choose (closed-open or closed-closed),

Re: [GENERAL] Calculation of per Capita on-the-fly - problems with SQL syntax

2007-10-16 Thread Stefan Schwarzer
SELECT DISTINCT ( CASE WHEN d.year=2003 AND pt.year=2003 AND pt.value <> '0' AND pt.value IS NOT NULL THEN d.value / pt.value ELSE NULL END ) AS y_2003, ( CASE WHEN d.year=2002 AND pt.year=2002 AND pt.value <> '0' AND pt.value IS NOT NULL THEN d.value / pt.value ELSE NULL END ) AS y_2

[GENERAL] Crosstab Problems

2007-10-18 Thread Stefan Schwarzer
Hi there, successfully installed the tablefunc package. Now, I would like to transform this kind of result based on a normal SQL: c_name |year|value --- Germany | 2001| 123 Germany | 2002| 125 Germany

Re: [GENERAL] Crosstab Problems

2007-10-18 Thread Stefan Schwarzer
Could you provide a self-contained test case for this? There's not really enough information here for someone else to duplicate the problem. Also, which PG version are you using? Wasn't sure what you ment with "a self containted test case". Is it the raw data? Here is a SQL dump for the ta

Re: [GENERAL] Crosstab Problems

2007-10-19 Thread Stefan Schwarzer
But when re-doing the query now without the JOIN, it works (almost): SELECT * FROM crosstab( 'SELECT id_country AS id, year_start AS year, value FROM agri_area AS d WHERE year_start = 2003 OR year_start = 2

[GENERAL] (Never?) Kill Postmaster?

2007-10-23 Thread Stefan Schwarzer
Hi there, I read dozens of times the "TIP 2: Don't 'kill -9' the postmaster"... Now, what am I supposed to do if I launched a query which takes ages, and which I want to interrupt? Thanks for any advice, Stef _____

[GENERAL] "Concatenate" two queries - how?

2007-10-24 Thread Stefan Schwarzer
Hi there, I have two queries, which I would like to bring together to form one result. The first query is a simple SELECT on a table of national statistics. SELECT COALESCE(c.name, ), year_start AS year, value FROM fish_catch AS d LEFT JOIN countri

[GENERAL] Substitute column in SELECT with static value?

2007-11-16 Thread Stefan Schwarzer
substitute this with a "static" value, such as "Global"? So, that the query still results in three columns? Thanks for any advice! Stef ____ Stefan Schwarzer Lean Back and Relax - Enjoy some Nature Photo

Re: [GENERAL] Substitute column in SELECT with static value? (Crosstab problem?)

2007-11-18 Thread Stefan Schwarzer
Hi there, I run an aggregation on national statistics to retrieve regional values (for Africa, Europe, ...). Now, I want to have a global aggregation as well. The easiest thing for my PHP/HTML procedure would be to have the global row make appear within the regional result. So it would

Re: [GENERAL] Read-only availability of a standby server?

2007-11-21 Thread Stefan Kaltenbrunner
.4 (and some basic groundwork already happened in 8.3) ... Stefan ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can ge

Re: [GENERAL] Error while compiling PostgreSQL with Java

2007-11-25 Thread Stefan Kaltenbrunner
up authentication as with every other client). Stefan ---(end of broadcast)--- TIP 6: explain analyze is your friend

[GENERAL] pgcrypto functions fail for asymmetric encryption/decryption

2007-11-29 Thread Stefan Niantschur
Hi, I have a table with userids and public keys. I want to write a function which does a select and returns the result pgp encrypted. However, I have some problems: SELECT encode(decode((SELECT ens_pubkey FROM ens_user)::text,'escape'),'escape'::text)::text; -> returns the public key, => ok SELE

Re: [GENERAL] pgcrypto functions fail for asymmetric encryption/decryption

2007-12-03 Thread Stefan Niantschur
Am Fri, 30 Nov 2007 12:06:37 +0200 schrieb "Marko Kreen" <[EMAIL PROTECTED]>: Hi Marko, first of all, thank you for your help. Please find my answers below: > On 11/29/07, Stefan Niantschur <[EMAIL PROTECTED]> wrote: > > I have a table with userids and

Re: [GENERAL] pgcrypto functions fail for asymmetric encryption/decryption

2007-12-03 Thread Stefan Niantschur
x27;::text); Thank you very much for your help. > On 12/3/07, Stefan Niantschur <[EMAIL PROTECTED]> wrote: > > > Or at least send key parameters (gpg --list-keys output). > > > > pub 1024D/0476AD06 2007-11-27 [verfällt: 2008-11-26] > > uid Test User (Probebenutze

Re: [GENERAL] pgcrypto functions fail for asymmetric encryption/decryption

2007-12-03 Thread Stefan Niantschur
Am Montag, 3. Dezember 2007 schrieben Sie: > On 12/3/07, Stefan Niantschur <[EMAIL PROTECTED]> wrote: > > I finally made it. I created a brand-new key, reworked the query and > > voila. > > > > It seems that the GnuPG key has to be created with > > paramter

[GENERAL] UNION not working... why?

2007-12-13 Thread Stefan Schwarzer
o_3_code = 'CH')) ORDER BY d.year_start DESC LIMIT 1 ____ Stefan Schwarzer Lean Back and Relax - Enjoy some Nature Photography http://photoblog.la-famille-schwarzer.de Appetite for Global Data? UNEP GEO Data Portal: http://geodata.grid.unep.ch

Re: [GENERAL] UNION not working... why?

2007-12-13 Thread Stefan Schwarzer
Oh great. Thanks a lot. But now, I have another problem in this context. If I use text in the SELECT statement (so, that the final output gives me the name of the selected variables, plus the year and the value) than I get this error message: ERROR: failed to find conversion function from

Re: [GENERAL] UNION not working... why?

2007-12-13 Thread Stefan Schwarzer
But now, I have another problem in this context. If I use text in the SELECT statement (so, that the final output gives me the name of the selected variables, plus the year and the value) than I get this error message: ERROR: failed to find conversion function from "unknown" to text [squint...]

[GENERAL] Installation problem: failed to initialize lc_messages to ""

2008-01-09 Thread Stefan Schwarzer
Hi there, I am trying to install Postgres 8.1.11 on Mac Leopard. Compilation was ok. Now, the initdb has some problems: $ /usr/local/pgsql/bin/initdb -D --locale=C /Users/schwarzer/Documents/ data_postgres ... selecting default max_connections ... 10 selecting default shared_buffers ... 50

Re: [GENERAL] Installation problem: failed to initialize lc_messages to ""

2008-01-10 Thread Stefan Schwarzer
FATAL: XX000: failed to initialize lc_messages to "" LOCATION: InitializeGUCOptions, guc.c:2666 Typically what this means is that you have an improper setting of LANG or LC_ALL in your environment ("improper" meaning that it doesn't match any of the locales that are actually installed on yo

Re: [GENERAL] Installation problem: failed to initialize lc_messages to ""

2008-01-10 Thread Stefan Schwarzer
FATAL: XX000: failed to initialize lc_messages to "" LOCATION: InitializeGUCOptions, guc.c:2666 Typically what this means is that you have an improper setting of LANG or LC_ALL in your environment ("improper" meaning that it doesn't match any of the locales that are actually installed on yo

Re: [GENERAL] Installation problem: failed to initialize lc_messages to ""

2008-01-10 Thread Stefan Schwarzer
/usr/local/pgsql/bin/initdb -D --locale=en_US.UTF-8 /Users/ schwarzer/Documents/data_postgres Dunno if it'll make a difference, but I'd put the "-D" immediately before the path to the data directory. Thanks for the hint. But unfortunately same error message --

Re: [GENERAL] Installation problem: failed to initialize lc_messages to ""

2008-01-10 Thread Stefan Schwarzer
/usr/local/pgsql/bin/initdb -D --locale=en_US.UTF-8 /Users/schwarzer/Documents/data_postgres Dunno if it'll make a difference, but I'd put the "-D" immediately before the path to the data directory. Also, pay attention to the first few lines of initdb output --- it will tell you what it think

  1   2   3   4   5   >