[GENERAL] Re: [HACKERS] Frontend/backend protocol improvements proposal (request).

2013-06-26 Thread Albe Laurenz
Dmitriy Igrishin wrote: >> I understand the problem now. >> I pondered a bit over your design, and I came up with a different >> idea how to represent prepared statements in a C++ library. >> First, a prepared statement is identified by its name. >> To make the relationship between a PreparedState

Re: [GENERAL] utf8 errors

2013-06-26 Thread Albe Laurenz
Jirí Pavlovský wrote: > I have a win32 application. > LOG: statement: INSERT INTO recipients (DealID, > Contactid) VALUES (29009, 9387) > ERROR: invalid byte sequence for encoding "UTF8": 0x9c > > > But the query is clean ascii and it doesn't even contain the me

[GENERAL] array_agg and partition sorts

2013-06-26 Thread Rory Campbell-Lange
I'm on Postgres 9.1 and I've come across an issue which shows I don't understand partition sorting: Given a table like this: select * from test; n_group | t_name| t_additional -+-+-- 1 | Canberra| Australia 1 | Vienna

Re: [GENERAL] utf8 errors

2013-06-26 Thread Jiří Pavlovský
On 26.6.2013 10:58, Albe Laurenz wrote: > Jirí Pavlovský wrote: >> I have a win32 application. >> LOG: statement: INSERT INTO recipients (DealID, >> Contactid) VALUES (29009, 9387) >> ERROR: invalid byte sequence for encoding "UTF8": 0x9c >> >> >> But the query is

Re: [GENERAL] utf8 errors

2013-06-26 Thread Jiří Pavlovský
On 26.6.2013 10:58, Albe Laurenz wrote: > Jirí Pavlovský wrote: >> I have a win32 application. >> LOG: statement: INSERT INTO recipients (DealID, >> Contactid) VALUES (29009, 9387) >> ERROR: invalid byte sequence for encoding "UTF8": 0x9c >> >> >> But the query is

Re: [GENERAL] Archiving and recovering pg_stat_tmp

2013-06-26 Thread Sameer Thakur
> > >> >Do you think that it is important to do so? Are you experiencing > problems which you believe are due to missing/out of date >activity > statistics? Or is this more for curiosity? > I am making specifications for a tool which captures query plan > statistics. I wanted its behavior to be t

Re: [GENERAL] Concatenate table name in Pl/Pgsql

2013-06-26 Thread Adarsh Sharma
Final Fix : execute 'insert into tmp'||abc|| ' select $1.*' using new; Thanks On Wed, Jun 26, 2013 at 12:18 PM, Adarsh Sharma wrote: > Able to fix but still new error :( > > > test=# CREATE OR REPLACE FUNCTION tmp_trigger_function() > test-# RETURNS TRIGGER AS $$ > test$# DECLARE > test$# s

Re: [GENERAL] utf8 errors

2013-06-26 Thread Alban Hertroys
On 26 June 2013 11:17, Jiří Pavlovský wrote: > On 26.6.2013 10:58, Albe Laurenz wrote: > > Jirí Pavlovský wrote: > >> I have a win32 application. > >> LOG: statement: INSERT INTO recipients (DealID, > >> Contactid) VALUES (29009, 9387) > >> ERROR: invalid byte se

Re: [GENERAL] utf8 errors

2013-06-26 Thread Jiří Pavlovský
On 26.6.2013 12:19, Alban Hertroys wrote: > On 26 June 2013 11:17, Jiří Pavlovský > wrote: > > On 26.6.2013 10:58, Albe Laurenz wrote: > > Jirí Pavlovský wrote: > >> I have a win32 application. > >> LOG: statement: INSERT INTO recipients (DealID, > >

Re: [GENERAL] utf8 errors

2013-06-26 Thread Alban Hertroys
On 26 June 2013 12:39, Jiří Pavlovský wrote: > On 26.6.2013 12:19, Alban Hertroys wrote: > > On 26 June 2013 11:17, Jiří Pavlovský wrote: > >> On 26.6.2013 10:58, Albe Laurenz wrote: >> > Jirí Pavlovský wrote: >> >> I have a win32 application. >> >> LOG: statement: INSERT INTO recipients (De

Re: [GENERAL] utf8 errors

2013-06-26 Thread Jiří Pavlovský
On 26.6.2013 13:32, Alban Hertroys wrote: > On 26 June 2013 12:39, Jiří Pavlovský > wrote: > > On 26.6.2013 12:19, Alban Hertroys wrote: >> On 26 June 2013 11:17, Jiří Pavlovský > > wrote: >> >> On 26.6.2013 10:58, Albe Lauren

Re: [GENERAL] utf8 errors

2013-06-26 Thread Albe Laurenz
Jirí Pavlovský wrote: >>> I'm getting these errors on tables as >>> well. Actually when I copy and paste the offending queries from log into >>> pgAdmin it runs without an >>> error. >> So the queries work from pgadmin; what application/environment are they NOT >> working in? >> Something is obv

[GENERAL] dynamic partitioning

2013-06-26 Thread dafNi zaf
Hello! I want to dynamically create partition tables that inherit a main table called "foo". The creation must occur when needed. For example, lets say that I want to insert 10 entries and I want 5 partition tables (with 2 entries each). So, first I need a partition for the first 2 e

Re: [GENERAL] dynamic partitioning

2013-06-26 Thread dafNi zaf
one note: I create a table of 100 entries in order to test it so I want 5 partition of 20 entries each. (And not a table of 10 entries) thanks again! dafni On Wed, Jun 26, 2013 at 4:47 PM, dafNi zaf wrote: > Hello! > > I want to dynamically create partition tables that inherit a main tabl

Re: [GENERAL] dynamic partitioning

2013-06-26 Thread Daniel Cristian Cruz
You forgot to set the trigger on foo: CREATE TRIGGER foo_insert BEFORE INSERT ON foo FOR EACH ROW EXECUTE PROCEDURE foo_insert_trigger(); 2013/6/26 dafNi zaf > one note: I create a table of 100 entries in order to test it so I want 5 > partition of 20 entries each. > (And not a table

Re: [GENERAL] dynamic partitioning

2013-06-26 Thread AI Rumman
Yes, you missed the trigger part. And also you will get error like below during insert: INSERT INTO foo VALUES (99, 109, 109, 99, '2013-06-26 16:38:58.466'); NOTICE: table_name = (foo_100_to_119) NOTICE: CREATE TABLE foo_100_to_119 (CHECK ( foo_id >= 100 AND foo_id <= 119 )) INHERITS (foo) ERROR

Re: [GENERAL] utf8 errors

2013-06-26 Thread Tom Lane
Albe Laurenz writes: > Once you can reproduce the problem, try a network trace on the communication > between cleint and server. Maybe that helps to solve the problem. Actually, if you can reproduce the problem on demand, try attaching to the backend process with gdb and setting a breakpoint at

Re: [GENERAL] utf8 errors

2013-06-26 Thread Jiří Pavlovský
On 26.6.2013 10:58, Albe Laurenz wrote: > Jirí Pavlovský wrote: >> I have a win32 application. >> LOG: statement: INSERT INTO recipients (DealID, >> Contactid) VALUES (29009, 9387) >> ERROR: invalid byte sequence for encoding "UTF8": 0x9c >> >> >> But the query is

[GENERAL] Semi-Pseudo Data Types & Procedure Arguments

2013-06-26 Thread Joshua Burns
Has anyone played around with what I would call "Semi-Pseudo Data Types," in which a stored procedure may accept a sub-set of a Pseudo Data Types but not just any pseudo data-type, such as any type of string (text, character varying, character), any type of integer (smallint, integer, bigint), or a

Re: [GENERAL] dynamic partitioning

2013-06-26 Thread AI Rumman
That because you are generating table name from from_value which is distinct everytime. Like, INSERT INTO foo VALUES (1, 11, 11, 1, '2013-06-26 16:38:58.466'); NOTICE: table_name = (foo_1_to_21) NOTICE: CREATE TABLE foo_1_to_21 (CHECK ( foo_id >= 1 AND foo_id <= 21 )) INHERITS (foo) INSERT 0 0 p

Re: [GENERAL] utf8 errors

2013-06-26 Thread Alban Hertroys
On 26 June 2013 11:03, Jiří Pavlovský wrote: > On 26.6.2013 10:58, Albe Laurenz wrote: > > Jirí Pavlovský wrote: > >> I have a win32 application. > >> LOG: statement: INSERT INTO recipients (DealID, > >> Contactid) VALUES (29009, 9387) > >> ERROR: invalid byte se

[GENERAL] Need help compiling from souce

2013-06-26 Thread Jake Silverman
I'm trying to compile pg 9.3 beta 1 from source using microsoft visual studio on a computer running windows 7. When I build I run into around 1600 errors and around 36 warnings. I imagine I'm doing something horribly wrong. The following is the start of my error log: http://pastebin.com/PdGdvWT7 A

Re: [GENERAL] dynamic partitioning

2013-06-26 Thread dafNi zaf
I solved the problem with the error! thank you very much! But there is still 1 issue: when I insert multiple rows (for exaple with the attachment in my fist email) it creates 100 partition tables that contain 1 entry instead of 5 partitions with 20 entries.. Any ideas in that?? Thanks again! D

Re: [GENERAL] Semi-Pseudo Data Types & Procedure Arguments

2013-06-26 Thread Karsten Hilbert
On Wed, Jun 26, 2013 at 01:50:46AM -0400, Joshua Burns wrote: > Example #1: > -- A stored procedure which can accept two arguments, each of which could > be text, character varying, character varying(any length) or character(any > length). > SELECT * FROM my_fn('val1'::text, 'val2'::character(4));

Re: [GENERAL] array_agg and partition sorts

2013-06-26 Thread Rory Campbell-Lange
On 26/06/13, Rory Campbell-Lange (r...@campbell-lange.net) wrote: > I'm on Postgres 9.1 and I've come across an issue which shows I don't > understand partition sorting: > Returns: > > -[ RECORD 1 > ]- > agg1

Re: [GENERAL] Semi-Pseudo Data Types & Procedure Arguments

2013-06-26 Thread Tom Lane
Joshua Burns writes: > Has anyone played around with what I would call "Semi-Pseudo Data Types," > in which a stored procedure may accept a sub-set of a Pseudo Data Types but > not just any pseudo data-type, such as any type of string (text, character > varying, character), any type of integer (sm

Re: [GENERAL] Need help compiling from souce

2013-06-26 Thread Tom Lane
Jake Silverman writes: > I'm trying to compile pg 9.3 beta 1 from source using microsoft visual > studio on a computer running windows 7. When I build I run into around 1600 > errors and around 36 warnings. > I imagine I'm doing something horribly wrong. The following is the start of > my error lo

Re: [GENERAL] Semi-Pseudo Data Types & Procedure Arguments

2013-06-26 Thread David Johnston
Tom Lane-2 wrote > >> -- A stored procedure which can accept two argument, which can be a >> single >> integer field, or an array of integers. > > Those two cases seem unlikely to be supportable by the same > implementation, so it seems more likely that what you'd be doing is just > overloading t

Re: [GENERAL] Semi-Pseudo Data Types & Procedure Arguments

2013-06-26 Thread David Johnston
David Johnston wrote > > Tom Lane-2 wrote >> >>> -- A stored procedure which can accept two argument, which can be a >>> single >>> integer field, or an array of integers. >> >> Those two cases seem unlikely to be supportable by the same >> implementation, so it seems more likely that what you'd

[GENERAL] Problem with at_askml function in Postgis

2013-06-26 Thread Hall, Samuel L (Sam)
Using PostgreSQL 9.1.8 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 64-bit POSTGIS="2.0.1 r9979" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.2, released 2012/10/08" LIBXML="2.8.0" LIBJSON="UNKNOWN" TOPOLOGY RASTER Postgis seems t

Re: [GENERAL] Problem with at_askml function in Postgis

2013-06-26 Thread Tom Lane
"Hall, Samuel L (Sam)" writes: > I get this error > ERROR: function st_askml(geometry) is not unique > LINE 1: select st_askml(path) from paths where jobnumber = '20121491... >^ > HINT: Could not choose a best candidate function. You might need to add > explicit type casts. > B

Re: [GENERAL] [HACKERS] Frontend/backend protocol improvements proposal (request).

2013-06-26 Thread Dmitriy Igrishin
2013/6/26 Albe Laurenz > Dmitriy Igrishin wrote: > >> I understand the problem now. > >> I pondered a bit over your design, and I came up with a different > >> idea how to represent prepared statements in a C++ library. > > >> First, a prepared statement is identified by its name. > >> To make th

Re: [GENERAL] Need help compiling from souce

2013-06-26 Thread Jake Silverman
Sorry about that, and thanks for taking the time to help me. Here is the full file: https://www.dropbox.com/s/c4dwf47nob0i7fr/file4.txt -Jake (Just realized I didn't hit reply all. I'm sorry for sending you this message twice.) On Wed, Jun 26, 2013 at 11:29 AM, Tom Lane wrote: > Jake Silverma

[GENERAL] unique constraint violations

2013-06-26 Thread pg noob
Hi all, There are some places in our application where unique constraint violations are difficult to avoid due to multithreading. What we've done in most places to handle this is to retry in a loop. Generally it starts by checking if a value already exists, if not - try to insert it, which may ca

Re: [GENERAL] unique constraint violations

2013-06-26 Thread Steven Schlansker
On Jun 26, 2013, at 11:04 AM, pg noob wrote: > > Hi all, > > There are some places in our application where unique constraint violations > are difficult to avoid due to multithreading. > What we've done in most places to handle this is to retry in a loop. > > Generally it starts by checking

Re: [GENERAL] unique constraint violations

2013-06-26 Thread pg noob
Thank you for the suggestion Steven. Originally I did implement a solution using savepoints and that worked as a way to keep all the work done on the transaction leading up to the constraint violation, but errors would still show up in the Postgres log. With this new function approach there are no

[GENERAL] installer woes, 9.1 on windows 2008 R2

2013-06-26 Thread John R Pierce
trying to install 9.1.9 64bit on a win2008 r2 server and getting a failure of the initdb phase, with no clue why. I've installed the application on C:\postgresql\9.1\ and the data on D:\postgresql\9.1\data ... after the first try, I added the LOCAL\postgres user to the permissions on the D:\

Re: [GENERAL] installer woes, 9.1 on windows 2008 R2

2013-06-26 Thread Igor Neyman
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of John R Pierce Sent: Wednesday, June 26, 2013 3:38 PM To: PostgreSQL Subject: [GENERAL] installer woes, 9.1 on windows 2008 R2 trying to install 9.1.9 64bit on a win2008 r2 server and getting a fail

Re: [GENERAL] installer woes, 9.1 on windows 2008 R2

2013-06-26 Thread John R Pierce
On 6/26/2013 12:49 PM, Igor Neyman wrote: Look for bitrock_installer.log in the \Users\\AppData\Local\Temp. Or just do search for bitrock_installer.log file. ahhh. two weirdnesses below... A) why is it using 'myusername' (the account I ran the installer from) instead of the postgres serv

Re: [GENERAL] Need help compiling from souce

2013-06-26 Thread Tom Lane
Jake Silverman writes: > Sorry about that, and thanks for taking the time to help me. Here is the > full file: https://www.dropbox.com/s/c4dwf47nob0i7fr/file4.txt [ lots and lots of error C2065: 'BLCKSZ' : undeclared identifier error C2065: 'XLOG_SEG_SIZE' : undeclared identifier etc etc ] It lo

[GENERAL] convert from json to text[]

2013-06-26 Thread Mason Leung
Hi, I am running postgres 9.2.4 and 1 of my columns (column name is old_field) is type json. When I select from this table, I get the following sample data select old_field from table1; [], ['a', 'b'] ['a'] [] How do I change the data type from json to text[]? I have tried alter table table1

Re: [GENERAL] convert from json to text[]

2013-06-26 Thread Merlin Moncure
On Wed, Jun 26, 2013 at 8:34 PM, Mason Leung wrote: > Hi, > > I am running postgres 9.2.4 and 1 of my columns (column name is old_field) > is type json. When I select from this table, I get the following sample > data > > select old_field from table1; > > [], > ['a', 'b'] > ['a'] > [] > > How do