Re: [GENERAL] How to find freak UTF-8 character?

2011-09-30 Thread Leif Biberg Kristensen
On Saturday 1. October 2011 07.55.01 Leif Biberg Kristensen wrote: > I've somehow introduced a spurious UTF-8 character in my database. When I > try to export to an application that requires LATIN1 encoding, my export > script bombs out with this message: > > psycopg2.DataError: character 0xe2808e

[GENERAL] How to find freak UTF-8 character?

2011-09-30 Thread Leif Biberg Kristensen
I've somehow introduced a spurious UTF-8 character in my database. When I try to export to an application that requires LATIN1 encoding, my export script bombs out with this message: psycopg2.DataError: character 0xe2808e of encoding "UTF8" has no equivalent in "LATIN1" I figure that it should

Re: [GENERAL] stored procs

2011-09-30 Thread Craig Ringer
On 09/30/2011 11:41 PM, John R Pierce wrote: On 09/30/11 2:09 AM, J.V. wrote: Some tables have millions of rows, well, something like UPDATE tablename SET id=generate_series(1,numberofrows); will update every row to a sequential value. However, I have no idea how you would match the foreign ke

Re: [GENERAL] Connection refused (0x0000274D/10061)

2011-09-30 Thread Craig Ringer
On 09/30/2011 06:17 PM, Pietro Laranci wrote: On the machines are not active firewalls. Most likely there _is_ a firewall involved, maybe just not one you're aware of. As Adrian said, check the settings in the standard Windows Firewall if you're on Windows. For more troubleshooting: Check

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Scott Marlowe
On Fri, Sep 30, 2011 at 2:57 PM, Cody Caughlan wrote: > Please see below. > > On Fri, Sep 30, 2011 at 1:12 PM, Scott Marlowe > wrote: >> >> On Fri, Sep 30, 2011 at 1:45 PM, Cody Caughlan wrote: >> > That worked, but "file" shows no difference: >> > $ iconv -f utf-8 -t utf-8 -c foo.sql > utf.sql

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Cody Caughlan
Please see below. On Fri, Sep 30, 2011 at 1:12 PM, Scott Marlowe wrote: > On Fri, Sep 30, 2011 at 1:45 PM, Cody Caughlan wrote: > > That worked, but "file" shows no difference: > > $ iconv -f utf-8 -t utf-8 -c foo.sql > utf.sql > > $ file -i foo.sql > > foo.sql: text/plain; charset=us-ascii > >

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Scott Marlowe
On Fri, Sep 30, 2011 at 1:45 PM, Cody Caughlan wrote: > That worked, but "file" shows no difference: > $ iconv -f utf-8 -t utf-8 -c foo.sql > utf.sql > $ file -i foo.sql > foo.sql: text/plain; charset=us-ascii > $file -i utf.sql > utf.sql: text/plain; charset=us-ascii > So iconv didnt actually con

Re: [GENERAL] postgres for OLAP & data mining

2011-09-30 Thread Dario Beraldi
On 30 September 2011 18:41, Henry Drexler wrote: > Are you looking for stuff like this? > > http://www.postgresql.org/docs/9.0/static/functions-window.html > http://www.postgresql.org/docs/9.0/static/functions-string.html > > Thanks for reply. Yes, I knew these functions. In fact, I was rather wo

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Scott Marlowe
On Fri, Sep 30, 2011 at 1:41 PM, Scott Marlowe wrote: > On Fri, Sep 30, 2011 at 1:39 PM, Cody Caughlan wrote: >> Its a Rails app and I do have: >>   encoding: utf8 > > > Hmmm, if you try this does it work (mostly)? > > iconv -f utf-8 -t utf-8 -c < infile > outfile If that doesn't work try: icon

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Cody Caughlan
That worked, but "file" shows no difference: $ iconv -f utf-8 -t utf-8 -c foo.sql > utf.sql $ file -i foo.sql foo.sql: text/plain; charset=us-ascii $file -i utf.sql utf.sql: text/plain; charset=us-ascii So iconv didnt actually convert the file OR does is the "file" command just ignorant? On Fri

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Scott Marlowe
On Fri, Sep 30, 2011 at 1:39 PM, Cody Caughlan wrote: > Its a Rails app and I do have: >   encoding: utf8 Hmmm, if you try this does it work (mostly)? iconv -f utf-8 -t utf-8 -c < infile > outfile -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your su

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Cody Caughlan
Its a Rails app and I do have: encoding: utf8 Set in my DB configuration. On Fri, Sep 30, 2011 at 12:38 PM, Scott Marlowe wrote: > On Fri, Sep 30, 2011 at 1:35 PM, Cody Caughlan wrote: > > > > > > On Fri, Sep 30, 2011 at 12:31 PM, Scott Marlowe > > > wrote: > >> > >> On Fri, Sep 30, 2011 at

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Scott Marlowe
On Fri, Sep 30, 2011 at 1:35 PM, Cody Caughlan wrote: > > > On Fri, Sep 30, 2011 at 12:31 PM, Scott Marlowe > wrote: >> >> On Fri, Sep 30, 2011 at 12:46 PM, Cody Caughlan wrote: >> > Please see below. >> > >> > On Fri, Sep 30, 2011 at 11:38 AM, Scott Marlowe >> > >> > wrote: >> >> >> >> On Fri,

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Cody Caughlan
On Fri, Sep 30, 2011 at 12:31 PM, Scott Marlowe wrote: > On Fri, Sep 30, 2011 at 12:46 PM, Cody Caughlan wrote: > > Please see below. > > > > On Fri, Sep 30, 2011 at 11:38 AM, Scott Marlowe > > > wrote: > >> > >> On Fri, Sep 30, 2011 at 12:26 PM, Cody Caughlan > wrote: > >> > Thanks Scott. See

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Tom Lane
Cody Caughlan writes: > Ok, I see what you mean. This would create a new DB with the proper > encoding. Which is "fine", and probably what I will do. I guess I see an > ideal scenario being one where we permanently convert the template encoding > to UTF8 so going forward I dont have to worry about

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Scott Marlowe
On Fri, Sep 30, 2011 at 12:46 PM, Cody Caughlan wrote: > Please see below. > > On Fri, Sep 30, 2011 at 11:38 AM, Scott Marlowe > wrote: >> >> On Fri, Sep 30, 2011 at 12:26 PM, Cody Caughlan wrote: >> > Thanks Scott. See below: >> > >> > On Fri, Sep 30, 2011 at 11:05 AM, Scott Marlowe >> > >> >

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Cody Caughlan
Please see below. On Fri, Sep 30, 2011 at 11:38 AM, Scott Marlowe wrote: > On Fri, Sep 30, 2011 at 12:26 PM, Cody Caughlan wrote: > > Thanks Scott. See below: > > > > On Fri, Sep 30, 2011 at 11:05 AM, Scott Marlowe > > > wrote: > >> > >> On Fri, Sep 30, 2011 at 11:25 AM, Cody Caughlan > wrote:

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Tom Lane
Scott Marlowe writes: > On Fri, Sep 30, 2011 at 12:26 PM, Cody Caughlan wrote: >> So it appears both template0 & template1 are SQL_ASCII, so how would >> creating from a new DB from template0 be any different than template1? > P.s. I'm not sure why it works, I just know that it does. :) CREATE

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Scott Marlowe
On Fri, Sep 30, 2011 at 12:26 PM, Cody Caughlan wrote: > Thanks Scott. See below: > > On Fri, Sep 30, 2011 at 11:05 AM, Scott Marlowe > wrote: >> >> On Fri, Sep 30, 2011 at 11:25 AM, Cody Caughlan wrote: >> > I would like to change my server_encoding which is currently SQL_ASCII >> > to UTF8. >>

Re: [GENERAL] postgres for OLAP & data mining

2011-09-30 Thread Eduardo Morras
At 16:12 30/09/2011, Dario Beraldi wrote: Hello, I'm looking for some information (guidelines, docs, tutorials, etc...) about using postgres for OLAP, data mining, data warehousing. The sort of questions I'm trying to answer are on the lines of - What tools/SQL commands are available? - How s

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Cody Caughlan
Thanks Scott. See below: On Fri, Sep 30, 2011 at 11:05 AM, Scott Marlowe wrote: > On Fri, Sep 30, 2011 at 11:25 AM, Cody Caughlan wrote: > > I would like to change my server_encoding which is currently SQL_ASCII to > UTF8. > > > > I have existing data that I would like to keep. > > > > From my u

Re: [GENERAL] Change server encoding after the fact

2011-09-30 Thread Scott Marlowe
On Fri, Sep 30, 2011 at 11:25 AM, Cody Caughlan wrote: > I would like to change my server_encoding which is currently SQL_ASCII to > UTF8. > > I have existing data that I would like to keep. > > From my understanding of the steps I need to: > > 1) alter the template1 database encoding via > > UPD

Re: [GENERAL] postgres for OLAP & data mining

2011-09-30 Thread Henry Drexler
Are you looking for stuff like this? http://www.postgresql.org/docs/9.0/static/functions-window.html http://www.postgresql.org/docs/9.0/static/functions-string.html On Fri, Sep 30, 2011 at 10:12 AM, Dario Beraldi wrote: > Hello, > > I'm looking for some information (guidelines, docs, tutorials,

[GENERAL] Change server encoding after the fact

2011-09-30 Thread Cody Caughlan
I would like to change my server_encoding which is currently SQL_ASCII to UTF8. I have existing data that I would like to keep. From my understanding of the steps I need to: 1) alter the template1 database encoding via UPDATE pg_database SET encoding = 6 where datname IN ('template0', 'template

Re: [GENERAL] how to improve this similarity query?

2011-09-30 Thread pasman pasmański
Look at doc chapter II.12 2011/9/30, haman...@t-online.de : > Hi, > > I have a table of names, and searches are usually performed on prefix match. > This could nicely translate into an index search > Suppose first name is stored as either 'Jim' or 'Jimmy', searching > ... where firstname ~* '^jim'

Re: [GENERAL] stored procs

2011-09-30 Thread John R Pierce
On 09/30/11 2:09 AM, J.V. wrote: Some tables have millions of rows, well, something like UPDATE tablename SET id=generate_series(1,numberofrows); will update every row to a sequential value. However, I have no idea how you would match the foreign key references in other tables to these new

Re: [GENERAL] Any was to prevent a join if no columns are selected from a view?

2011-09-30 Thread Jason Long
On Thu, 2011-09-29 at 22:54 -0600, Ben Chobot wrote: > On Sep 29, 2011, at 4:57 PM, Jason Long wrote: > > > > > I thought I had read somewhere that Postges could ignore a join if > > it > > was not necessary because there were no columns from the table or > > view > > selected in the query. Is

[GENERAL] One-click installer, Windows 7 32-bit, and icacls.exe

2011-09-30 Thread Karl Wright
I saw a thread where somebody saw icacls.exe being called by the one-click installer. I'm having the same thing - the installer has been running for 45 minutes now and is basically going to have to be stopped because I'm out of time waiting for it. Looking at process monitor, it is clear that ica

Re: [GENERAL] postgres for OLAP & data mining

2011-09-30 Thread Ovnicraft
On Fri, Sep 30, 2011 at 9:12 AM, Dario Beraldi wrote: > Hello, > > I'm looking for some information (guidelines, docs, tutorials, etc...) > about using postgres for OLAP, data mining, data warehousing. The sort of > questions I'm trying to answer are on the lines of > - What tools/SQL commands are

Re: [GENERAL] Quick-and-Dirty Data Entry with LibreOffice3?

2011-09-30 Thread Rich Shepard
On Fri, 30 Sep 2011, Vincent Veyron wrote: You get a lot more : this gives you an interface to Postgresql inside an Emacs buffer. Thank you. Rich -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/p

[GENERAL] postgres for OLAP & data mining

2011-09-30 Thread Dario Beraldi
Hello, I'm looking for some information (guidelines, docs, tutorials, etc...) about using postgres for OLAP, data mining, data warehousing. The sort of questions I'm trying to answer are on the lines of - What tools/SQL commands are available? - How should postgres be configured? - How suitable is

Re: [GENERAL] Quick-and-Dirty Data Entry with LibreOffice3?

2011-09-30 Thread Vincent Veyron
Le mercredi 28 septembre 2011 à 06:07 -0700, Rich Shepard a écrit : > On Wed, 28 Sep 2011, Vincent Veyron wrote: > > > I'm not sure what 'INSTALL INTO ... statements' are, but are you aware > > of the very convenient 'M-x sql-postgres' in emacs? > > Vincent, > >I have a SQL major mode for em

Re: [GENERAL] Connection refused (0x0000274D/10061)

2011-09-30 Thread Adrian Klaver
On Friday, September 30, 2011 3:17:51 am Pietro Laranci wrote: > Good morning to everybody > > I have a pg9 db to wich i can connect to by local but not from remote. In > the properties of the postgres db , the port is set to 5300 (not the > default 5432). I tried to connect in remote with pgadmi

Re: [GENERAL] Deadlock of REINDEX and SELECT queries in PostgresSQL 7.4

2011-09-30 Thread Adrian Klaver
On Thursday, September 29, 2011 8:49:07 am Tendulker, Shivanand G Prabhu (SSTL) wrote: > Hello > > We are facing a deadlock kind of issue in PostgresSQL 7.4 > > We have 2 databases with 3 tables each. DB contains about 250 records. We > observed deadlock when 2 different clients are performing R

Re: [GENERAL] Rules going away

2011-09-30 Thread Gregg Jaskiewicz
You're right, rules are perfect for very limited and narrow cases. And make it very hard to write complicated queries against. (i.e., updates that only touch few columns, likewise with inserts). I'm guessing the upside is that rules are faster then triggers. -- Sent via pgsql-general mailing list

Re: [GENERAL] Rules going away

2011-09-30 Thread Igor Neyman
> -Original Message- > From: Gregg Jaskiewicz [mailto:gryz...@gmail.com] > Sent: Friday, September 30, 2011 5:18 AM > To: Igor Neyman > Cc: Ondrej Ivanič; pgsql-general@postgresql.org > Subject: Re: [GENERAL] Rules going away > > speaking of DO INSTEAD, for insert/update case. Try using RE

[GENERAL] how to improve this similarity query?

2011-09-30 Thread hamann . w
Hi, I have a table of names, and searches are usually performed on prefix match. This could nicely translate into an index search Suppose first name is stored as either 'Jim' or 'Jimmy', searching ... where firstname ~* '^jim'; gets proper result. I had hoped that creating a functional index on l

Re: [GENERAL] Problem dbi_link with postgresql 9.04

2011-09-30 Thread Albe Laurenz
Emanuel Araújo wrote: > found that the problem occurs when the dbi_link makes parsing of a field > float / double to a text > field, because when it creates the tables already created with this type of > data. I do not understand that. > Another thing we see is that the problem is not with null

Re: [GENERAL] Problem dbi_link with postgresql 9.04

2011-09-30 Thread Emanuel Araújo
hi, news! found that the problem occurs when the dbi_link makes parsing of a field float / double to a text field, because when it creates the tables already created with this type of data. Another thing we see is that the problem is not with null fields or zero bytes but with a value of 1.5, no

[GENERAL] Connection refused (0x0000274D/10061)

2011-09-30 Thread Pietro Laranci
Good morning to everybody I have a pg9 db to wich i can connect to by local but not from remote. In the properties of the postgres db , the port is set to 5300 (not the default 5432). I tried to connect in remote with pgadmin3 and quantum gis, both give the error Connection refused (0x274D/

Re: [GENERAL] stored procedures (packages)

2011-09-30 Thread Albe Laurenz
J.V. wrote: > I need to run a series of stored procedures, what is the best way to > organize and run. > > Ideally would like something like Oracle PL/SQL where I can put all > methods in one file and create a main() method > > then just : select main() to have them all run. > > If there is a w

Re: [GENERAL] stored procs

2011-09-30 Thread Alban Hertroys
On 30 September 2011 11:20, J.V. wrote: > For tables that already exist and have a foreign key relationship, is there > an equivalent alter statement for the statement below? > > Does this mean that if table xxx.id primary key value changes, the foreign > key value will change as well? They do if

Re: [GENERAL] stored procs

2011-09-30 Thread J.V.
For tables that already exist and have a foreign key relationship, is there an equivalent alter statement for the statement below? Does this mean that if table xxx.id primary key value changes, the foreign key value will change as well? If this is the case, then would not have to match up all

Re: [GENERAL] Rules going away

2011-09-30 Thread Gregg Jaskiewicz
speaking of DO INSTEAD, for insert/update case. Try using RETURNING with that and rules ;) Good luck -- 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] stored procs

2011-09-30 Thread John R Pierce
On 09/30/11 1:28 AM, John R Pierce wrote: On 09/30/11 1:23 AM, John R Pierce wrote: convert the fields to bigint which are 64 bit and not likely to wrap around any time in this century indeed, this is as simple as ... alter table tblname alter column id type bigint; of course, you'll nee

Re: [GENERAL] stored procs

2011-09-30 Thread John R Pierce
On 09/30/11 1:23 AM, John R Pierce wrote: convert the fields to bigint which are 64 bit and not likely to wrap around any time in this century indeed, this is as simple as ... alter table tblname alter column id type bigint; of course, you'll need to alter all the FK fields that refer to

Re: [GENERAL] stored procs

2011-09-30 Thread John R Pierce
On 09/30/11 1:13 AM, J.V. wrote: thanks for the help, we have a production schema with 80 tables and a few of the tables have consumed the max limit for the id field, so I have to write a program (stored functions would be the fastest way to do this), that will go and drop the sequence, create

Re: [GENERAL] stored procs / data types

2011-09-30 Thread John R Pierce
On 09/30/11 12:59 AM, J.V. wrote: What data types do I have access to in a stored proc? I cannot seem to find the stored procedure manual. http://www.postgresql.org/docs/current/static/plpgsql.html I am not speaking of database field/column data types, but rather stored proc data types.

Re: [GENERAL] stored procedures (packages)

2011-09-30 Thread John R Pierce
On 09/30/11 12:57 AM, J.V. wrote: I need to run a series of stored procedures, what is the best way to organize and run. Ideally would like something like Oracle PL/SQL where I can put all methods in one file and create a main() method then just : select main() to have them all run. in fu

[GENERAL] stored procs / data types

2011-09-30 Thread J.V.
What data types do I have access to in a stored proc? I cannot seem to find the stored procedure manual. I am not speaking of database field/column data types, but rather stored proc data types. Regards, J.V. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make change

[GENERAL] stored procedures (packages)

2011-09-30 Thread J.V.
I need to run a series of stored procedures, what is the best way to organize and run. Ideally would like something like Oracle PL/SQL where I can put all methods in one file and create a main() method then just : select main() to have them all run. If there is a way to do this, please let

Re: [GENERAL] stored procs

2011-09-30 Thread John R Pierce
On 09/30/11 12:24 AM, J.V. wrote: What I want to do however is within a stored procedure make a call and store all tables in a given schema in a list. so procedure1 calls procedure2 (not sure why this extra level of procedures, but I'm playing along) and procedure2 does SELECT table_name fro

Re: [GENERAL] could not access file "$libdir/pg_buffercache": No such file or directory

2011-09-30 Thread Albe Laurenz
Royce Ausburn wrote: > I'm in the process of testing out Postgres 9.0 for production use. I've been using it for development > on my mac, a build from EnterpriseDB. We've just installed a 9.0.5 on an Ubuntu (Ubuntu 10.04.3 LTS) > machine from a backport from lucid. There's an existing 8.4.8 postg

Re: [GENERAL] stored procs

2011-09-30 Thread J.V.
Yes, I know that one. What I want to do however is within a stored procedure make a call and store all tables in a given schema in a list. Is this something you can answer? thanks J.V. On 9/29/2011 3:25 AM, Richard Huxton wrote: On 29/09/11 02:33, J.V. wrote: Is is possible within a store