Re: [GENERAL] Query failed: ERROR: character with byte sequence 0xc2 0x96 in encoding "UTF8" has no equivalent in encoding "WIN1250"

2015-11-26 Thread Albe Laurenz
I realize I was too short, sorry. NTPT wrote: > but how to update affected columns ? error message does not provide single > clue ( at least row name) For every table and every column in the source database that might be affected, try something like: SELECT id, col FROM tab WHERE col LIKE

Re: [GENERAL] Query failed: ERROR: character with byte sequence 0xc2 0x96 in encoding "UTF8" has no equivalent in encoding "WIN1250"

2015-11-26 Thread Albe Laurenz
I wrote: > You can run something like this over the plain text dump: > > sed -e 's/–/-/g' dump.sql >fixed.sql Scrap that, it should of course be: sed -e 's/–/-/g' dump.sql >fixed.sql Yours, Laurenz Albe -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to

[GENERAL] Postgresql Dump Question

2015-11-26 Thread Sachin Srivastava
Hi Team, If anybody have PostgreSQL Dump questions like Oracle dump question for preparation of PostgreSQL certification. kindly provide, if someone have. Regards, SS

[GENERAL] ARRAY_AGG and ORDER

2015-11-26 Thread Sterpu Victor
Hello I need to order an array using another column in table ad_query_join_select. I need something like this but this is not a valid SQL: SELECT array_to_string(array_agg(aqjs.id ORDER BY aqjs.to_left), ',') AS str, aq.name FROM ad_query aq JOIN ad_query_join_select aqjs ON

Re: [GENERAL] ARRAY_AGG and ORDER

2015-11-26 Thread Geoff Winkless
On 26 November 2015 at 12:43, Sterpu Victor wrote: > Hello > > I need to order an array using another column in table ad_query_join_select. > > I need something like this but this is not a valid SQL: > SELECT array_to_string(array_agg(aqjs.id *ORDER BY aqjs.to_left*), ',') > AS

Re: [GENERAL] ARRAY_AGG and ORDER

2015-11-26 Thread Sterpu Victor
Yes, thank you. :) -- Original Message -- From: "Sterpu Victor" To: "Geoff Winkless" Sent: 11/26/2015 2:51:48 PM Subject: Re[2]: [GENERAL] ARRAY_AGG and ORDER Yes, thank you. :) -- Original Message -- From: "Geoff Winkless"

[GENERAL] long transactions / backend memory usage

2015-11-26 Thread krichy
Dear all, We have run into a case where we run a long transaction, and during the transaction the backend process's memory usage is growing constantly. I've written a script to simulate this, please someone confirm if it is normal or not. The script just inserts and removes rows in a table

Re: [GENERAL] long transactions / backend memory usage

2015-11-26 Thread Karsten Hilbert
On Thu, Nov 26, 2015 at 03:35:49PM +0100, kri...@tvnetwork.hu wrote: > We have run into a case where we run a long transaction, and during the > transaction the backend process's memory usage is growing constantly. > > I've written a script to simulate this, please someone confirm if it is >

Re: [GENERAL] Convert from hex to string

2015-11-26 Thread Adrian Klaver
On 11/25/2015 11:12 PM, Francisco Olarte wrote: Hi Adrian: On Wed, Nov 25, 2015 at 9:33 PM, Adrian Klaver wrote: I will grant you that working with encodings is like working with timestamps, explicit is better. The thing I am having a problem with is how not knowing

Re: [GENERAL] long transactions / backend memory usage

2015-11-26 Thread krichy
Do you mean the scripting language? Originally we use C++ code with tntdb (from http://www.tntnet.org/) with the same symptons/issues. I dont think that counts. Thanks, Kojedzinszky Richárd Euronet Magyarorszag Informatika Zrt. On Thu, 26 Nov 2015, Karsten Hilbert wrote: Date: Thu, 26

Re: [GENERAL] long transactions / backend memory usage

2015-11-26 Thread Adrian Klaver
On 11/26/2015 06:35 AM, kri...@tvnetwork.hu wrote: Dear all, We have run into a case where we run a long transaction, and during the transaction the backend process's memory usage is growing constantly. I've written a script to simulate this, please someone confirm if it is normal or not. The

Re: [GENERAL] long transactions / backend memory usage

2015-11-26 Thread Karsten Hilbert
On Thu, Nov 26, 2015 at 04:58:25PM +0100, Kojedzinszky Rich�rd wrote: > Do you mean the scripting language? Originally we use C++ code with tntdb > (from http://www.tntnet.org/) with the same symptons/issues. That (perl and c++ showing the same) should indeed rule out a language issue. Karsten

Re: [GENERAL] long transactions / backend memory usage

2015-11-26 Thread Adrian Klaver
On 11/26/2015 06:35 AM, kri...@tvnetwork.hu wrote: Dear all, We have run into a case where we run a long transaction, and during the transaction the backend process's memory usage is growing constantly. I've written a script to simulate this, please someone confirm if it is normal or not. The

Re: [GENERAL] long transactions / backend memory usage

2015-11-26 Thread Tom Lane
kri...@tvnetwork.hu writes: > We have run into a case where we run a long transaction, and during the > transaction the backend process's memory usage is growing constantly. > [ test program just inserts and immediately deletes rows ] I see a leakage of about 40 bytes per cycle in this example,

Re: [GENERAL] Postgresql Dump Question

2015-11-26 Thread Jerry Sievers
Sachin Srivastava writes: > Hi Team, > > If anybody have PostgreSQL Dump questions like Oracle dump question for > preparation of PostgreSQL certification. kindly provide, if someone have. Are you just interested in passing the test? If so, then I can't help you.

Re: [GENERAL] Old source code needed

2015-11-26 Thread Adrian Klaver
On 11/26/2015 01:29 PM, NTPT wrote: Hi all, I need to find a old source codes for Postgresql9.0 BETA relases. could You help me ? http://git.postgresql.org/gitweb/?p=postgresql.git;a=tags Then, say for REL9_0_BETA2 click on commit which will take you to:

[GENERAL] 2 questions

2015-11-26 Thread anj patnaik
Hello all, I've got 2 more questions. The cron job is now setup and email gets generated with proper body. I've one setup with NFS which appears to work smoothly. Now soon, I will be given a Linux VM on a different physical server, but will retain my NFS mount. I've installed Postgres 9.4 using

[GENERAL] Old source code needed

2015-11-26 Thread NTPT
Hi all, I need to find a old source codes for Postgresql9.0 BETA relases.  could You help me ?

Re: [GENERAL] Taking lot time

2015-11-26 Thread Ramesh T
When this thread started you said you where selecting 20 rows. Yes. Which is correct 20 rows or columns and if columns how many rows? Yes,I did selected 20 columns from two tables. Where are you measuring this time? Here is the query plan, http://explain.depesz.com/s/EeYT Any Help

Re: [GENERAL] long transactions / backend memory usage

2015-11-26 Thread Kojedzinszky Richárd
Do you mean the scripting language? Originally we use C++ code with tntdb (from http://www.tntnet.org/) with the same symptons/issues. I dont think that counts. Thanks, Kojedzinszky Richárd Euronet Magyarorszag Informatika Zrt. On Thu, 26 Nov 2015, Karsten Hilbert wrote: Date: Thu, 26

[GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread mrtruji
Just added a new bytea type column to an existing psql table and populated the column entirely with row data. Running into some strange query results: When I select the newly added column by itself I get all the data as expected: SELECT new_col FROM data LIMIT 1; Result: \x8481e7dec3650040b

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread Melvin Davidson
Is it possible you have more than one row where state = 'CA'? Putting a LIMIT 1 would then restrict to only 1 row. Have you tried with no limit? IE: SELECT new_col FROM data; On Thu, Nov 26, 2015 at 7:13 PM, mrtruji wrote: > Just added a new bytea type column to an existing

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread mrtruji
Sure. I copied my email submisison from my stack exchange posting so couldn't submit the formatted tables there. Below is an example and you are correct that features_bin is the newly added column. I mean EMPTY ROW in that features_bin returns empty. id | state | features_bin

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread mrtruji
Used psycopg2 in python to create and fill in the table with the code below: cur.execute('alter table data add features_bin bytea;') for x in features: cur.execute('insert into data (features_bin) values (%s);',[x]) conn.commit() features is a list variable of binary array objects. On

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread mrtruji
Hi, Thanks for the reply. The limit is just to simplify results for the examples. The same behavior occurs when each of the three queries are not limited. Whenever I try to filter by the original columns and select the new column the resultant values for the new column are empty. Conversely,

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread Melvin Davidson
OK, thanks for clarifying, but just for sanity sake, it would REALLY be nice if you would advise us of the exact version of PostgreSQL and the O/S you are working with. A copy of the table structure would also be helpful. Just one more thing, is it possible you have an index on that table that

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread Adrian Klaver
On 11/26/2015 06:10 PM, mrtruji wrote: Hi, Thanks for the reply. The limit is just to simplify results for the examples. The same behavior occurs when each of the three queries are not limited. Whenever I try to filter by the original columns and select the new column the resultant values for

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread Melvin Davidson
Look like another case of PEBKAC solved. Thanks Adrian & JOhn for the assist. Happy Thanksgiving everyone. On Thu, Nov 26, 2015 at 10:22 PM, John R Pierce wrote: > On 11/26/2015 7:08 PM, mrtruji wrote: > >> Ok this is strange. Shouldn't it always be one or the other? Total

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread mrtruji
Sure thing. Below are the results from your query along with the version and table info. Not sure about the index. I queried the table quite a bit before adding the new column and didn't have any issues. Here is the result from your query: nspname | relname | indexrelname | type | ?column?

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread Adrian Klaver
On 11/26/2015 04:13 PM, mrtruji wrote: Just added a new bytea type column to an existing psql table and populated the column entirely with row data. Running into some strange query results: When I select the newly added column by itself I get all the data as expected: |SELECT new_col FROM data

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread Adrian Klaver
On 11/26/2015 06:10 PM, mrtruji wrote: Hi, Thanks for the reply. The limit is just to simplify results for the examples. The same behavior occurs when each of the three queries are not limited. Whenever I try to filter by the original columns and select the new column the resultant values for

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread mrtruji
Ok this is strange. Shouldn't it always be one or the other? Total row count for the table is 279,096. doggies=# select count(*) from data where features_bin is null; count 279096 (1 row) doggies=# select count(*) from data where features_bin is not null; count 279096 (1

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread David G. Johnston
On Thursday, November 26, 2015, mrtruji wrote: > Ok this is strange. Shouldn't it always be one or the other? Total row > count for the table is 279,096. > > doggies=# select count(*) from data where features_bin is null; > count > > 279096 > (1 row) > > doggies=#

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread John R Pierce
On 11/26/2015 7:11 PM, mrtruji wrote: for x in features: cur.execute('insert into data (features_bin) values (%s);',[x]) conn.commit() yup, my guess was right. you inserted new rows with the features_bin field, but no other fields. you want to use UPDATE, not INSERT, and you'd

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread mrtruji
On Thu, Nov 26, 2015 at 7:24 PM, Melvin Davidson wrote: > Look like another case of PEBKAC solved. Thanks Adrian & JOhn for the > assist. Happy Thanksgiving everyone. > > On Thu, Nov 26, 2015 at 10:22 PM, John R Pierce > wrote: > >> On 11/26/2015 7:08

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread David G. Johnston
On Thursday, November 26, 2015, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Thursday, November 26, 2015, mrtruji > wrote: > >> Ok this is strange. Shouldn't it always be one or the other? Total row >> count

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread Melvin Davidson
ok. It looks like a bug tome, and this is Thanksgiving holiday, so probably the developers won't be able to lot at this until Monday. But just to be sure, what happens when you create a new table with the same structure and populate that? And can you do a pg_dump of the table and see if the data

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread Scott Mead
> On Nov 26, 2015, at 21:29, mrtruji wrote: > > Sure thing. Below are the results from your query along with the version and > table info. Not sure about the index. I queried the table quite a bit before > adding the new column and didn't have any issues. > > Here is the

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread John R Pierce
On 11/26/2015 4:13 PM, mrtruji wrote: Just added a new bytea type column to an existing psql table and populated the column entirely with row data. Running into some strange query results: When I select the newly added column by itself I get all the data as expected:. can you show

Re: [GENERAL] Selecting newly added column returns empty but only when selecting with other columns in table

2015-11-26 Thread John R Pierce
On 11/26/2015 7:08 PM, mrtruji wrote: Ok this is strange. Shouldn't it always be one or the other? Total row count for the table is 279,096. doggies=# select count(*) from data where features_bin is null; count 279096 (1 row) doggies=# select count(*) from data where features_bin