Re: [GENERAL] invalid OID warning after disk failure

2014-11-17 Thread Raghu Ram
On Mon, Nov 17, 2014 at 10:20 AM, Gabriel Sánchez Martínez gabrielesanc...@gmail.com wrote: The situation appears to be stable now, but upon running REINDEX and VACUUM on one of the databases, I get the following: WARNING: relation pg_attrdef TID 1/1: OID is invalid WARNING: relation

[GENERAL] incremental digest (and other) functions?

2014-11-17 Thread Pawel Veselov
Hi. I was looking into a need of doing SHA on contents of a large object, and it seems that the only digest (and other) functions provided by pgcrypto produce output based on a single string on an input, without being able to accumulate for multiple data blocks. It would be nice to see those,

[GENERAL] documentation for lo_* functions

2014-11-17 Thread Pawel Veselov
Hi. Where is the proper documentation for lo_* functions (e.g. lo_open) that are available as SQL functions? I see libpq functions documented in /static/lo-interfaces.html, but not the SQL ones (from pg_catalog). Thank you, Pawel.

Re: [GENERAL] NEW in after insert trugger contained incorrect data

2014-11-17 Thread Brilliantov Kirill Vladimirovich
Jim Nasby wrote on 11/15/2014 07:57 AM: Something else to consider: using FOUND to decide whether to INSERT vs UPDATE is a race condition: you can do the SELECT, someone else can then insert or delete, and then you attempt to do the wrong thing. To handle this correctly, you need an

Re: [GENERAL] documentation for lo_* functions

2014-11-17 Thread Dmitriy Igrishin
Hello Pawel, 2014-11-17 11:55 GMT+03:00 Pawel Veselov pawel.vese...@gmail.com: Hi. Where is the proper documentation for lo_* functions (e.g. lo_open) that are available as SQL functions? I see libpq functions documented in /static/lo-interfaces.html, but not the SQL ones (from pg_catalog).

[GENERAL] ERROR: Corrupt ascii-armor

2014-11-17 Thread VENKTESH GUTTEDAR
Hello, I am running PostgreSQL 9.3.5 on Ubuntu 14.04. i want to encrpty data while storing and decrypt while retrieving it. so i am using pgcrypto to achieve it. i have genrated the keys using gpg --gen-key. and i have exported them to also. I have created the table this way : CREATE TABLE

[GENERAL] [general] Encrypting/Decryption

2014-11-17 Thread VENKTESH GUTTEDAR
Hello, As i am new to postgresql and django. please help me to acheive the following. I have created a database with some tables and i want to encrypt the data in database tables, so please someone guide me how to do it.? i want to encrypt the data and also decrypt through django,

Re: [GENERAL] [general] Encrypting/Decryption

2014-11-17 Thread Naveed Shaikh
Hi Venktesh, Following is small test case: == leon=# create table demo(pw bytea); CREATE TABLE leon=# insert into demo(pw) values ( encrypt( 'data', 'key', 'aes') ); INSERT 0 1 leon=# select decrypt(pw, 'key', 'aes') FROM demo; decrypt \x64617461 (1 row)

Re: [GENERAL] [general] Encrypting/Decryption

2014-11-17 Thread Bill Moran
On Mon, 17 Nov 2014 16:53:43 +0530 VENKTESH GUTTEDAR venkteshgutte...@gmail.com wrote: Hello, As i am new to postgresql and django. please help me to acheive the following. I have created a database with some tables and i want to encrypt the data in database tables, so please

Re: [GENERAL] invalid OID warning after disk failure

2014-11-17 Thread Gabriel Sánchez Martínez
On Nov 17, 2014, at 3:28, Raghu Ram raghuchenn...@gmail.com wrote: On Mon, Nov 17, 2014 at 10:20 AM, Gabriel Sánchez Martínez gabrielesanc...@gmail.com wrote: The situation appears to be stable now, but upon running REINDEX and VACUUM on one of the databases, I get the following:

Re: [GENERAL] NEW in after insert trugger contained incorrect data

2014-11-17 Thread Brilliantov Kirill Vladimirovich
Hello! After modify trassa.update_cpu_load_list function on inserting one line per time trigger work fine. CREATE OR REPLACE FUNCTION trassa.update_cpu_load_list(device_id integer, device_timestamp integer, device_cpu smallint[], device_cpu_load smallint[]) RETURNS boolean AS $BODY$

Re: [GENERAL] invalid OID warning after disk failure

2014-11-17 Thread Gabriel Sánchez Martínez
On Nov 17, 2014, at 8:10, Gabriel Sánchez Martínez gabrielesanc...@gmail.com wrote: On Nov 17, 2014, at 3:28, Raghu Ram raghuchenn...@gmail.com wrote: On Mon, Nov 17, 2014 at 10:20 AM, Gabriel Sánchez Martínez gabrielesanc...@gmail.com wrote: The situation appears to be stable

Re: [GENERAL] invalid OID warning after disk failure

2014-11-17 Thread Alvaro Herrera
Gabriel Sánchez Martínez wrote: Any suggestions on what sanity checks I should run? For now I am doing reindex and vacuum. I think that forces everything to be read. I am assuming that if vacuum completes without error then the table is fine. The main sanity check is to make sure the disks

Re: [GENERAL] Managing Key Value tags on rows

2014-11-17 Thread Merlin Moncure
On Wed, Nov 12, 2014 at 7:17 PM, Tim Uckun timuc...@gmail.com wrote: What is the most efficient way to model key value tags on records. The keys and values will be variable and changing over time. The values may be of various types (numbers, dates, strings etc). There will be filters and

[GENERAL] Client Replication Login problem.

2014-11-17 Thread Rajesh K
Hi, I have a very basic question about  PostgreSQL replication.The Question is that after replication on Client Server ,not able to login as postgres user on client .(Postgres replication manuals are got from Official Website).But no issue on login to server.Answers are valuable. Thanks $

[GENERAL] String searching

2014-11-17 Thread Robert DiFalco
I notice there are several modules to create specialized indices in PostgreSQL for searching VARCHAR data. For example, fuzzy, trigram, full text, etc. I've been googling around but I can't find the optimal method (reasonable speed and size, simplicity) for my use case. My text searches will

Re: [GENERAL] ERROR: Corrupt ascii-armor

2014-11-17 Thread Jeff Janes
On Mon, Nov 17, 2014 at 3:00 AM, VENKTESH GUTTEDAR venkteshgutte...@gmail.com wrote: INSERT INTO testuserscards(username, cc)SELECT robotccs.username, pgp_pub_encrypt(robotccs.cc, keys.pubkey) As cc FROM (VALUES ('robby', '4'), ('artoo', '41112') ) As

Re: [HACKERS] [GENERAL] Performance issue with libpq prepared queries on 9.3 and 9.4

2014-11-17 Thread Robert Haas
On Thu, Nov 13, 2014 at 7:34 PM, Tom Lane t...@sss.pgh.pa.us wrote: One thing that occurs to me is that if the generic plan estimate comes out much cheaper than the custom one, maybe we should assume that the generic's cost estimate is bogus. Right offhand I can't think of a reason for a

Re: [HACKERS] [GENERAL] Performance issue with libpq prepared queries on 9.3 and 9.4

2014-11-17 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Thu, Nov 13, 2014 at 7:34 PM, Tom Lane t...@sss.pgh.pa.us wrote: One thing that occurs to me is that if the generic plan estimate comes out much cheaper than the custom one, maybe we should assume that the generic's cost estimate is bogus. Right

Re: [HACKERS] [GENERAL] Performance issue with libpq prepared queries on 9.3 and 9.4

2014-11-17 Thread Sam Saffron
One interesting option would be kicking in an extra more expensive planning cycle after the Nth run of the query, in general a lot of these planned queries run 1000s of times, if you add some extra cost to run 100 it may not be prohibitive cost wise. On Tue, Nov 18, 2014 at 8:27 AM, Tom Lane

Re: [GENERAL] Managing Key Value tags on rows

2014-11-17 Thread Tim Uckun
My Main worry is that the tag values will be of different types and ideally I would be able to search for using type specific ranges. For example if the tag value is a date then be able to do a date interval search but if the tag values are strings then do an ilike search. I was thinking of

[GENERAL] Can't drop a view (view does not exist) that has an entry in INFORMATION_SCHEMA.views

2014-11-17 Thread Klaus Hofeditz ]project-open[
Hi guys, I need to drop a view in order  to alter a type of a column: numeric(12,1) -  numeric(12,2): ERROR:  cannot alter type of a column used by a view or rule DETAIL:  rule _RETURN on view "TransTasksCube" depends on column "billable_units" Trying

Re: [GENERAL] Can't drop a view (view does not exist) that has an entry in INFORMATION_SCHEMA.views

2014-11-17 Thread Guillaume Lelarge
Le 17 nov. 2014 22:49, Klaus Hofeditz ]project-open[ klaus.hofed...@project-open.com a écrit : Hi guys, I need to drop a view in order to alter a type of a column: numeric(12,1) - numeric(12,2): ERROR: cannot alter type of a column used by a view or rule DETAIL: rule _RETURN on view

Re: [GENERAL] Managing Key Value tags on rows

2014-11-17 Thread Merlin Moncure
On Mon, Nov 17, 2014 at 3:43 PM, Tim Uckun timuc...@gmail.com wrote: My Main worry is that the tag values will be of different types and ideally I would be able to search for using type specific ranges. For example if the tag value is a date then be able to do a date interval search but if the

Re: [GENERAL] Can't drop a view (view does not exist) that has an entry in INFORMATION_SCHEMA.views

2014-11-17 Thread Klaus Hofeditz ]project-open[
Hi Guillaume  splendid - tx! ./k On 17/11/2014 22:53, Guillaume Lelarge wrote: Le 17 nov. 2014 22:49, "Klaus Hofeditz ]project-open[" klaus.hofed...@project-open.com a écrit : Hi guys, I need to drop a view in

[GENERAL] Re: Can't drop a view (view does not exist) that has an entry in INFORMATION_SCHEMA.views

2014-11-17 Thread Thomas Kellerer
Klaus Hofeditz ]project-open[ wrote on 17.11.2014 23:10: Hi guys, I need to drop a view in order to alter a type of a column: numeric(12,1) - numeric(12,2): ERROR: cannot alter type of a column used by a view or rule DETAIL: rule _RETURN on view TransTasksCube depends on column

[GENERAL] count distinct slow?

2014-11-17 Thread Roger Pack
Hello. As a note, I ran into the following today (doing a select distinct is fast, doing a count distinct is significantly slower?) assume a table issue with a COLUMN nodename character varying(64);, 7.5M rows... select distinct substring(nodename from 1 for 9) from issue; -- 5.8s select

Re: [GENERAL] count distinct slow?

2014-11-17 Thread Tom Lane
Roger Pack rogerdpa...@gmail.com writes: As a note, I ran into the following today (doing a select distinct is fast, doing a count distinct is significantly slower?) The planner appears to prefer hash aggregation for the variants of your query wherein the DISTINCT becomes a separate plan step.

Re: [GENERAL] String searching

2014-11-17 Thread Jonathan Vanasco
On Nov 17, 2014, at 12:55 PM, Robert DiFalco wrote: SELECT * FROM MyTable WHERE upper(FullName) LIKE upper('%John%'); That said, which would be the best extension module to use? A gist index on the uppercased column? Or something else? Thanks! Performance wise, I think a function

Re: [GENERAL] String searching

2014-11-17 Thread David G Johnston
Jonathan Vanasco-7 wrote The reason is that GIN/GIST use language patterns to simplify the index. so they work great on words select plainto_tsquery('doing watching reading programming'); 'watch' 'read' 'program' but not so great on names: select