Re: [GENERAL] Populating missing dates in postgresql data

2015-03-27 Thread Vincent Veyron
On Thu, 26 Mar 2015 00:25:09 + "Lavrenz, Steven M" wrote: > I have a second table (TABLE B) with all of the object_ids and channels that > are supposed to be reporting in each day. For cases where a certain channel > does not check in, I want to add a column that indicates the comm failure.

[GENERAL] SSPI authentication ASC_REQ_REPLAY_DETECT flag

2015-03-27 Thread Jacobo Vazquez
Hi all, I installed PostgreSQL 9.3 on a Windows Server 2012 and I have configured it to use SSPI authentication. The client is on a Windows 7 machine and make the connections via ODBC using a DSN with psqlodbc driver version 9.03.04.00. Authentication works in this scenario for the user authen

Re: [GENERAL] Could not read block of temporary files

2015-03-27 Thread R Clarke
I'm using Postgresql 9.1.15 It didn't succeed, which is why the message is confusing. The table was not created. It runs for about 10 minutes and then this error comes up. I tried reindexing the tables but that didn't help. This is the query: create table lu_addresses as SELECT distnct(l.id)

Re: [GENERAL] Populating missing dates in postgresql data

2015-03-27 Thread David G. Johnston
On Fri, Mar 27, 2015 at 3:41 AM, Vincent Veyron wrote: > On Thu, 26 Mar 2015 00:25:09 + > "Lavrenz, Steven M" wrote: > > > I have a second table (TABLE B) with all of the object_ids and channels > that are supposed to be reporting in each day. For cases where a certain > channel does not che

Re: [GENERAL] 9.4+ partial log-shipping possible?

2015-03-27 Thread Mike
No idea if this is an option for you or not, but if you make tables unlogged they won't generate WAL and therefore won't be replicated: http://rhaas.blogspot.ca/2010/05/global-temporary-and-unlogged-tables.html Of course unlogged tables have several drawbacks to carefully consider. On 03/26/2

Re: [GENERAL] Populating missing dates in postgresql data

2015-03-27 Thread Vincent Veyron
On Fri, 27 Mar 2015 08:33:36 -0700 "David G. Johnston" wrote: > ​This is a performance optimization that I would avoid at nearly any cost, > and there are likely better ways to limit the processing scope without > having to trust the a cron job runs daily​ mmmhh... it's not so much performance o

[GENERAL] json-patch support?

2015-03-27 Thread Deven Phillips
Are there any plans or ideas about implement JSON Patch ( http://jsonpatch.com/) support for PostgreSQL? We deal with some relatively large JSON documents for our in-house application and it is often better to just send a json-patch update rather than the full document. It would be very nice if we

Re: [GENERAL] 9.4+ partial log-shipping possible?

2015-03-27 Thread Andrew Sullivan
On Thu, Mar 26, 2015 at 04:32:00PM +0100, Sven Geggus wrote: > > We need to somehow save the state of the osm database to be able to apply > future changes. This is currently done using a few tables in the target > database. However these tables are not needed for map rendering and are > consumi

[GENERAL] Building JSON objects

2015-03-27 Thread Eli Murray
Hi All, I'm trying to create an array of JSON objects from an existing table. I've created a new table: "CREATE TABLE json(data json[]);" Now i need to populate it with key value pairs from another table. I'd like to create the objects to look like: { "code": rawdata.deptcode, "name": rawdata.d

Re: [GENERAL] Building JSON objects

2015-03-27 Thread Adrian Klaver
On 03/27/2015 10:40 AM, Eli Murray wrote: Hi All, I'm trying to create an array of JSON objects from an existing table. I've created a new table: "CREATE TABLE json(data json[]);" Now i need to populate it with key value pairs from another table. I'd like to create the objects to look like: {

Re: [GENERAL] segmentation fault postgres 9.3.5 core dump perlu related ?

2015-03-27 Thread Day, David
Hi, Update : A storey with a happy ending. I have not seen this segmentation fault since converting the pgperl functions to python within the FreeBSD 9.x environment. So I believe Guy Helmer’s suggested causation was likely spot on. Due to the inability to reproduce the issue on demand there i

[GENERAL] check data for datatype

2015-03-27 Thread Suresh Raja
> > Hi All: > I have a very large table and the column type is text. I would like to convert in numeric. How can I find rows that dont have numbers. I would like to delete those rows. Thanks, -Suersh Raja

Re: [GENERAL] Building JSON objects

2015-03-27 Thread Eli Murray
I'm running psql --version 9.4.1 Also, it may be worth noting that rawdata.deptname and rawdata.deptcode are both text data types. The errors I'm getting are: ERROR: syntax error at or near "json_build_object" LINE 1: insert into json(data) json_build_object(SELECT DISTINCT dep... and ERROR:

Re: [GENERAL] check data for datatype

2015-03-27 Thread Raymond O'Donnell
On 27/03/2015 18:08, Suresh Raja wrote: > Hi All: > > > I have a very large table and the column type is text. I would like to > convert in numeric. How can I find rows that dont have numbers. I > would like to delete those rows. Use a regular expression: select from where ~ http:

Re: [GENERAL] Building JSON objects

2015-03-27 Thread Jan de Visser
On March 27, 2015 01:12:52 PM Eli Murray wrote: > ERROR: syntax error at or near "json_build_object" > LINE 1: insert into json(data) json_build_object(SELECT DISTINCT dep... You may want to review the syntax of the INSERT command, i.e. this doesn't have anything to do with JSON: INSERT INTO fo

Re: [GENERAL] json-patch support?

2015-03-27 Thread Arthur Silva
On Fri, Mar 27, 2015 at 1:56 PM, Deven Phillips wrote: > Are there any plans or ideas about implement JSON Patch ( > http://jsonpatch.com/) support for PostgreSQL? We deal with some > relatively large JSON documents for our in-house application and it is > often better to just send a json-patch u

Re: [GENERAL] Building JSON objects

2015-03-27 Thread Adrian Klaver
On 03/27/2015 11:12 AM, Eli Murray wrote: I'm running psql --version 9.4.1 Also, it may be worth noting that rawdata.deptname and rawdata.deptcode are both text data types. The errors I'm getting are: ERROR: syntax error at or near "json_build_object" LINE 1: insert into json(data) json_build

Re: [GENERAL] Building JSON objects

2015-03-27 Thread David G. Johnston
On Fri, Mar 27, 2015 at 11:31 AM, Jan de Visser wrote: > On March 27, 2015 01:12:52 PM Eli Murray wrote: > > ERROR: syntax error at or near "json_build_object" > > LINE 1: insert into json(data) json_build_object(SELECT DISTINCT dep... > > You may want to review the syntax of the INSERT command,

Re: [GENERAL] json-patch support?

2015-03-27 Thread Merlin Moncure
On Fri, Mar 27, 2015 at 1:36 PM, Arthur Silva wrote: > On Fri, Mar 27, 2015 at 1:56 PM, Deven Phillips > wrote: >> >> Are there any plans or ideas about implement JSON Patch >> (http://jsonpatch.com/) support for PostgreSQL? We deal with some relatively >> large JSON documents for our in-house ap

Re: [GENERAL] Building JSON objects

2015-03-27 Thread Szymon Guz
On 27 March 2015 at 19:12, Eli Murray wrote: > I'm running psql --version 9.4.1 > > Also, it may be worth noting that rawdata.deptname and rawdata.deptcode > are both text data types. > > The errors I'm getting are: > > ERROR: syntax error at or near "json_build_object" > LINE 1: insert into jso

Re: [GENERAL] Building JSON objects

2015-03-27 Thread Jan de Visser
On March 27, 2015 11:38:42 AM David G. Johnston wrote: > On Fri, Mar 27, 2015 at 11:31 AM, Jan de Visser wrote: > > On March 27, 2015 01:12:52 PM Eli Murray wrote: > > > ERROR: syntax error at or near "json_build_object" > > > LINE 1: insert into json(data) json_build_object(SELECT DISTINCT dep..

Re: [GENERAL] Building JSON objects

2015-03-27 Thread Adrian Klaver
On 03/27/2015 11:12 AM, Eli Murray wrote: I'm running psql --version 9.4.1 Also, it may be worth noting that rawdata.deptname and rawdata.deptcode are both text data types. The errors I'm getting are: ERROR: syntax error at or near "json_build_object" LINE 1: insert into json(data) json_build

Re: [GENERAL] check data for datatype

2015-03-27 Thread Jerry Sievers
Suresh Raja writes: > Hi All: > > I have a very large table and the column type is text.  I would like to > convert in numeric.  How can I find rows that dont have numbers.  I would > like to delete those > rows. begin; set local client_min_messages to notice; create table foo (a text

[GENERAL] JSON merge in postgresql

2015-03-27 Thread Arup Rakshit
I have a simple table having column `data` which is a JSON type. Sample data I took from -- http://schinckel.net/2014/05/25/querying-json-in-postgres/ [arup@pg_food_mgmt (master)]$ rails db psql (9.2.7) Type "help" for help. pg_foo_development=# SELECT * FROM json_test; id | dat

Re: [GENERAL] Building JSON objects

2015-03-27 Thread Eli Murray
Thanks to you all for the replies. Adrian, your solution is working for me without errors but it's not actually inserting anything. I'll keep fiddling with it and see if I can get what I want but I'm confident now that I'm on the right path. As a backup, I did what I wanted to in Javascript and wro

Re: [GENERAL] Building JSON objects

2015-03-27 Thread David G. Johnston
On Fri, Mar 27, 2015 at 12:30 PM, Eli Murray wrote: > Thanks to you all for the replies. Adrian, your solution is working for me > without errors but it's not actually inserting anything. I'll keep fiddling > with it and see if I can get what I want but I'm confident now that I'm on > the right p

[GENERAL] Alias field names in foreign data wrapper?

2015-03-27 Thread Deven Phillips
I am trying out some ideas using FDW, and I have added some FDW tables which access a backend MySQL DB... Unfortunately, I am getting some errors because of fields names with reserved words. I was wondering if there is a way to "alias" a field name when creating the foreign table? Thanks in advanc

Re: [GENERAL] json-patch support?

2015-03-27 Thread Deven Phillips
OK, then I will look into perhaps implementing it as a pl-python or pl-java function. Thanks for the advice!! Deven On Fri, Mar 27, 2015 at 2:40 PM, Merlin Moncure wrote: > On Fri, Mar 27, 2015 at 1:36 PM, Arthur Silva wrote: > > On Fri, Mar 27, 2015 at 1:56 PM, Deven Phillips < > deven.phill.

Re: [GENERAL] Alias field names in foreign data wrapper?

2015-03-27 Thread Deven Phillips
Better example of the problem... My FDW table schema is: CREATE FOREIGN TABLE liquorstore_backendipaddress ( id bigint NOT NULL, backend_network_id bigint, backend_virtual_interface_id bigint, address character varying(15) NOT NULL, is_gateway boolean NOT NULL, is_reserved

Re: [GENERAL] Alias field names in foreign data wrapper?

2015-03-27 Thread David G. Johnston
On Fri, Mar 27, 2015 at 1:55 PM, Deven Phillips wrote: > Better example of the problem... My FDW table schema is: > > CREATE FOREIGN TABLE liquorstore_backendipaddress ( > id bigint NOT NULL, > backend_network_id bigint, > backend_virtual_interface_id bigint, > address character v

[GENERAL] how would you speed up this long query?

2015-03-27 Thread zach cruise
select sub_query_1.pid, sub_query_1.tit, sub_query_1.num, sub_query_3.cid, sub_query_3.id, sub_query_3.c, sub_query_3.s, sub_query_3.z, sub_query_3.cy, sub_query_3.cd, sub_query_3.cr, org.id as org__id, org.pid as org__pi

Re: [GENERAL] Alias field names in foreign data wrapper?

2015-03-27 Thread Adrian Klaver
On 03/27/2015 01:55 PM, Deven Phillips wrote: Better example of the problem... My FDW table schema is: CREATE FOREIGN TABLE liquorstore_backendipaddress ( id bigint NOT NULL, backend_network_id bigint, backend_virtual_interface_id bigint, address character varying(15) NOT NUL

Re: [GENERAL] how would you speed up this long query?

2015-03-27 Thread Gavin Flower
On 28/03/15 10:10, zach cruise wrote: select sub_query_1.pid, sub_query_1.tit, sub_query_1.num, sub_query_3.cid, sub_query_3.id, sub_query_3.c, sub_query_3.s, sub_query_3.z, sub_query_3.cy, sub_query_3.cd, sub_query_3.cr

Re: [GENERAL] Alias field names in foreign data wrapper?

2015-03-27 Thread Deven Phillips
Yes. Here's the MySQL schema: CREATE TABLE `liquorstore_backendipaddress` ( `id` int(11) NOT NULL AUTO_INCREMENT, `backend_network_id` int(11) DEFAULT NULL, `backend_virtual_interface_id` int(11) DEFAULT NULL, `address` varchar(15) NOT NULL, `is_gateway` tinyint(1) NOT NULL, `is_reserv

Re: [GENERAL] Building JSON objects

2015-03-27 Thread Adrian Klaver
On 03/27/2015 12:30 PM, Eli Murray wrote: Thanks to you all for the replies. Adrian, your solution is working for me without errors but it's not actually inserting anything. I'll keep fiddling with it and see if I can get what I want but I'm confident now that I'm on the right path. As a backup,

Re: [GENERAL] Alias field names in foreign data wrapper?

2015-03-27 Thread Adrian Klaver
On 03/27/2015 02:20 PM, Deven Phillips wrote: Yes. Here's the MySQL schema: CREATE TABLE `liquorstore_backendipaddress` ( `id` int(11) NOT NULL AUTO_INCREMENT, `backend_network_id` int(11) DEFAULT NULL, `backend_virtual_interface_id` int(11) DEFAULT NULL, `address` varchar(15) NOT NU

Re: [GENERAL] Alias field names in foreign data wrapper?

2015-03-27 Thread Deven Phillips
OK, one of the devs on the GitHub page for that FDW helped me realize that I had accidentally mapped the wrong table! Doh! Deven On Fri, Mar 27, 2015 at 5:31 PM, Adrian Klaver wrote: > On 03/27/2015 02:20 PM, Deven Phillips wrote: > >> Yes. Here's the MySQL schema: >> >> CREATE TABLE `liquorsto

Re: [GENERAL] Alias field names in foreign data wrapper?

2015-03-27 Thread Adrian Klaver
On 03/27/2015 03:04 PM, Deven Phillips wrote: OK, one of the devs on the GitHub page for that FDW helped me realize that I had accidentally mapped the wrong table! Doh! Me looks back. Oops, missed that. Deven -- Adrian Klaver adrian.kla...@aklaver.com -- Sent via pgsql-general mailing

[GENERAL] pgadmin3 installation on Oracle Linux 6.6 64-bit ?

2015-03-27 Thread Yuri Budilov
Hello everyone. I am new to PostgreSQL and Linux (coming across from Microsoft SQL Server). I installed PostgreSQL 9.4 on Oracle Linux 6.6 and its working ok (psql, etc). Now I try to install pgadmin3 on the same OS. I am having problems installing pdadmin3 rpms on Oracle Linux 6.6 64-bit.I sele