Re: [GENERAL] Longest Common Subsequence in Postgres - Algorithm Challenge

2013-07-09 Thread Darren Duncan
Though people talk about doing this in other languages, I think you can solve it in plain SQL if you wanted to. For one thing, you could start off using unordered set operations to make the problem space smaller, such as using set intersection to see what the common subSETs of values there

Re: [GENERAL] Longest Common Subsequence in Postgres - Algorithm Challenge

2013-07-09 Thread Misa Simic
On Monday, July 8, 2013, Robert James wrote: On 7/8/13, hubert depesz lubaczewski dep...@depesz.com javascript:; wrote: On Mon, Jul 08, 2013 at 09:09:26AM -0400, Robert James wrote: I have two relations, where each relation has two fields, one indicating a name and one indicating a

Re: [GENERAL] Why is NULL = unbounded for rangetypes?

2013-07-09 Thread Andreas Joseph Krogh
På mandag 08. juli 2013 kl. 19:16:15, skrev Jeff Davis pg...@j-davis.com: On Mon, 2013-07-08 at 10:19 +0200, Andreas Joseph Krogh wrote: Hi.   Both of these queries return TRUE because NULL means unmounded: select daterange('2013-07-01' :: DATE, null, '[]') daterange('2013-07-04' :: DATE,

[GENERAL] Support for Foreign keys with arrays

2013-07-09 Thread itishree sukla
Hello Every one, I have a requirement for support for foreign keys with arrays, which is not there in postgresql 9.2, however it is in development for 9.3, i can see there is some thread saying patch is available, can any one please help me to get the patch, or any other work around by which we

[GENERAL] My question about autonomous transaction

2013-07-09 Thread 高健
Hello: I have found the following wiki about autonomous transaction: https://wiki.postgresql.org/wiki/Autonomous_subtransactions But when I test it, I found the following error: pgsql=# BEGIN; BEGIN pgsql=# INSERT INTO tab01 VALUES (1); INSERT 0 1 pgsql=# BEGIN SUBTRANSACTION;

Re: [GENERAL] PERFORM statement

2013-07-09 Thread Raymond O'Donnell
On 09/07/2013 05:20, Mike Christensen wrote: I was reading about Postgres stored procs in the FAQ: https://wiki.postgresql.org/wiki/FAQ#Does_PostgreSQL_have_stored_procedures.3F It claims that an alternative syntax to: SELECT theNameOfTheFunction(arg1, arg2); Is: PERFORM

Re: [GENERAL] My question about autonomous transaction

2013-07-09 Thread Adrian.Vondendriesch
Hello, Am 09.07.2013 11:29, schrieb 高健: Hello: I have found the following wiki about autonomous transaction: https://wiki.postgresql.org/wiki/Autonomous_subtransactions But when I test it, I found the following error: pgsql=# BEGIN; BEGIN pgsql=# INSERT INTO

[GENERAL] Re: [GENERAL] 回复: [GENERAL] Can't create plpython language

2013-07-09 Thread Raghavendra
[postgres@lix PostgreSQL]$ psql Password: psql (9.2.4) Type help for help. postgres=# create language plpython2u; ERROR: could not access file $libdir/plpython2: No such file or directory postgres=# create language plpython3u; ERROR: could not access file $libdir/plpython3: No such

Re: [GENERAL] pg 9.2.4 dblink

2013-07-09 Thread Karsten Hilbert
On Tue, Jul 09, 2013 at 03:55:47PM +0200, Peter Kroon wrote: I want to talk to multiple db's in one session. You'll have to define session to get meaningful answers. Karsten -- GPG key ID E4071346 @ gpg-keyserver.de E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346 -- Sent via

[GENERAL] pg 9.2.4 dblink

2013-07-09 Thread Peter Kroon
Hi, I want to talk to multiple db's in one session. Is dblink the best solution or is there another way without installing dblink? Best, Peter

Re: [GENERAL] domains, case statements, functions: bug?

2013-07-09 Thread Adrian Klaver
On 07/08/2013 06:58 PM, Tom Lane wrote: Adrian Klaver adrian.kla...@gmail.com writes: test= create function f(t) returns m as $$ select case when true then $1.c end $$ language sql; ERROR: return type mismatch in function declared to return m DETAIL: Actual return type is numeric. pg_typeof

Re: [GENERAL] pg 9.2.4 dblink

2013-07-09 Thread Joshua D. Drake
On 07/09/2013 06:55 AM, Peter Kroon wrote: Hi, I want to talk to multiple db's in one session. Is dblink the best solution or is there another way without installing dblink? If you want to query one database from another there is: dblink postgres_fdw (read only) which you can get from PGXN

Re: [GENERAL] replication stops working

2013-07-09 Thread John DeSoi
On Jul 8, 2013, at 5:41 PM, Daniel Serodio (lists) daniel.li...@mandic.com.br wrote: If there are no errors in the log, how did you conclude that replication has stopped working? Since you're using a hot standby, you've also setup streaming replication in addition to the WAL archiving,

[GENERAL] function with unknown params

2013-07-09 Thread giozh
i've declared and implemented e function like: CREATE OR REPLACE FUNCTION acquistoLotto(m_g INTEGER, grossista VARCHAR(20), produttore BIGINT, costo INTEGER, dat DATE, descr VARCHAR(120), num_prod INTEGER) RETURNS VOID AS $$ but when i'm trying to call it like select acquistoLotto(0,

Re: [GENERAL] function with unknown params

2013-07-09 Thread Raghavendra
On Tue, Jul 9, 2013 at 10:00 PM, giozh gi...@yahoo.it wrote: i've declared and implemented e function like: CREATE OR REPLACE FUNCTION acquistoLotto(m_g INTEGER, grossista VARCHAR(20), produttore BIGINT, costo INTEGER, dat DATE, descr VARCHAR(120), num_prod INTEGER) RETURNS VOID AS $$ but

Re: [GENERAL] function with unknown params

2013-07-09 Thread Alvaro Herrera
giozh wrote: i've declared and implemented e function like: CREATE OR REPLACE FUNCTION acquistoLotto(m_g INTEGER, grossista VARCHAR(20), produttore BIGINT, costo INTEGER, dat DATE, descr VARCHAR(120), num_prod INTEGER) RETURNS VOID AS $$ but when i'm trying to call it like select

Re: [GENERAL] Force ssl connection

2013-07-09 Thread Muhammad Bashir Al-Noimi
On Tue, Jul 9, 2013 at 2:46 AM, Adrian Klaver adrian.kla...@gmail.com wrote: Also remember in pg_hba.conf first match wins, so if there is a more permissive entry before your restrictive one, the permissive one will take precedence. Thanks for reply but you just quted some line from the

Re: [GENERAL] function with unknown params

2013-07-09 Thread giozh
ok, it works. But why on error message i had that two unknown data type? if was an error on date type, why it don't signal that? -- View this message in context: http://postgresql.1045698.n5.nabble.com/function-with-unknown-params-tp5763215p5763224.html Sent from the PostgreSQL - general

Re: [GENERAL] function with unknown params

2013-07-09 Thread Mike Christensen
You passed in: 22/1/2013 Which is 22 divided by 1, divided by 2013 - which is an integer.. On Tue, Jul 9, 2013 at 10:17 AM, giozh gi...@yahoo.it wrote: ok, it works. But why on error message i had that two unknown data type? if was an error on date type, why it don't signal that? --

Re: [GENERAL] Force ssl connection

2013-07-09 Thread Jeff Janes
On Tue, Jul 9, 2013 at 10:02 AM, Muhammad Bashir Al-Noimi mbno...@gmail.com wrote: So may you please be more specific, what's wrong in my configurations? My pg_hba.conf content is: local all postgrespeer local all all

[GENERAL] Dump/Reload pg_statistic to cut time from pg_upgrade?

2013-07-09 Thread Jerry Sievers
Originally posted on pg_admin but got no bites there... Admins; Planning to pg_upgrade some large (3TB) clusters using hard link method. Run time for the upgrade itself takes around 5 minutes. Nice!! Origin version 8.4 and destination version 9.1. Unfortunately the post-upgrade analyze of the

Re: [GENERAL] pg 9.2.4 dblink

2013-07-09 Thread Merlin Moncure
On Tue, Jul 9, 2013 at 8:55 AM, Peter Kroon plakr...@gmail.com wrote: Hi, I want to talk to multiple db's in one session. Is dblink the best solution or is there another way without installing dblink? why not use dblink? fdw is getting there but I still find dblink to be the way to go as

Re: [GENERAL] Force ssl connection

2013-07-09 Thread Muhammad Bashir Al-Noimi
On 07/09/2013 07:54 PM, Jeff Janes wrote: On Tue, Jul 9, 2013 at 10:02 AM, Muhammad Bashir Al-Noimi mbno...@gmail.com wrote: So may you please be more specific, what's wrong in my configurations? My pg_hba.conf content is: local all postgrespeer

Re: [GENERAL] Force ssl connection

2013-07-09 Thread Jeff Janes
On Tue, Jul 9, 2013 at 1:55 PM, Muhammad Bashir Al-Noimi mbno...@gmail.com wrote: On 07/09/2013 07:54 PM, Jeff Janes wrote: On Tue, Jul 9, 2013 at 10:02 AM, Muhammad Bashir Al-Noimi mbno...@gmail.com wrote: So may you please be more specific, what's wrong in my configurations? My

Re: [GENERAL] Force ssl connection

2013-07-09 Thread Adrian Klaver
On 07/09/2013 01:55 PM, Muhammad Bashir Al-Noimi wrote: On 07/09/2013 07:54 PM, Jeff Janes wrote: On Tue, Jul 9, 2013 at 10:02 AM, Muhammad Bashir Al-Noimi mbno...@gmail.com wrote: So may you please be more specific, what's wrong in my configurations? My pg_hba.conf content is: local all

Re: [GENERAL] Force ssl connection

2013-07-09 Thread Jeff Janes
On Tue, Jul 9, 2013 at 1:55 PM, Muhammad Bashir Al-Noimi mbno...@gmail.com wrote: On 07/09/2013 07:54 PM, Jeff Janes wrote: On Tue, Jul 9, 2013 at 10:02 AM, Muhammad Bashir Al-Noimi mbno...@gmail.com wrote: So may you please be more specific, what's wrong in my configurations? My

[GENERAL] plpgsql plan caching allowing invalid data to enter table?

2013-07-09 Thread Joe Van Dyk
It's looking like I can use a plpgsql function to insert data into a table that violates a domain constraint. Is this a known problem? Session 1: create domain my_domain text check (length(value) 2); create table my_table (name my_domain); create function f(text) returns void as $$ declare

Re: [GENERAL] plpgsql plan caching allowing invalid data to enter table?

2013-07-09 Thread Joe Van Dyk
As you can see, I have data in my_table that violates the check constraint. # select * from my_table; name ── test (1 row) # \d+ my_table Table public.my_table Column │ Type│ Modifiers │ Storage │ Stats target │ Description

Re: [GENERAL] plpgsql plan caching allowing invalid data to enter table?

2013-07-09 Thread Adrian Klaver
On 07/09/2013 04:05 PM, Joe Van Dyk wrote: It's looking like I can use a plpgsql function to insert data into a table that violates a domain constraint. Is this a known problem? Session 1: create domain my_domain text check (length(value) 2); create table my_table (name my_domain); create

Re: [GENERAL] plpgsql plan caching allowing invalid data to enter table?

2013-07-09 Thread Joe Van Dyk
On Tue, Jul 9, 2013 at 4:29 PM, Adrian Klaver adrian.kla...@gmail.comwrote: On 07/09/2013 04:05 PM, Joe Van Dyk wrote: It's looking like I can use a plpgsql function to insert data into a table that violates a domain constraint. Is this a known problem? Session 1: create domain my_domain

Re: [GENERAL] plpgsql plan caching allowing invalid data to enter table?

2013-07-09 Thread Tom Lane
Joe Van Dyk j...@tanga.com writes: It's looking like I can use a plpgsql function to insert data into a table that violates a domain constraint. Is this a known problem? I think it's not really plpgsql's fault but domain_in's --- there's no provision for flushing the latter's cached info about

Re: [GENERAL] My question about autonomous transaction

2013-07-09 Thread 高健
Thank you ! Best Regards 2013/7/9 Adrian.Vondendriesch adrian.vondendrie...@credativ.de Hello, Am 09.07.2013 11:29, schrieb 高健: Hello: I have found the following wiki about autonomous transaction: https://wiki.postgresql.org/wiki/Autonomous_subtransactions But when I

[GENERAL] Reply: [GENERAL] ?????? [GENERAL] Can't create plpython language

2013-07-09 Thread guxiaobo1982
I am using PostgreSQL 9.3 beta 2 [postgres@lix Multicorn-master]$ psql psql (9.3beta2) Type help for help. postgres=# It does not work with ActivePython3.2(ActivePython-3.2.2.3-linux-x86_64.tar.gz), Which version of PostgreSQL are you running? Regards, Xiaobo Gu

Re: [GENERAL] Support for Foreign keys with arrays

2013-07-09 Thread Michael Paquier
On Tue, Jul 9, 2013 at 6:26 PM, itishree sukla itishree.su...@gmail.com wrote: Hello Every one, I have a requirement for support for foreign keys with arrays, which is not there in postgresql 9.2, however it is in development for 9.3, i can see there is some thread saying patch is available,