Re: [SQL] Unique index VS unique constraint

2013-10-05 Thread Sergey Konoplev
will be created automatically when you add the constraint. -- Kind regards, Sergey Konoplev PostgreSQL Consultant and DBA http://www.linkedin.com/in/grayhemp +1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979 gray...@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make

Re: [SQL] Can I simplify this somehow?

2013-09-27 Thread Sergey Konoplev
: http://www.postgresql.org/docs/9.3/static/tablefunc.html Particularly look at the crostab(text, text) function. -- Kind regards, Sergey Konoplev PostgreSQL Consultant and DBA http://www.linkedin.com/in/grayhemp +1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979 gray...@gmail.com -- Sent

Re: [SQL] Unique index and unique constraint

2013-07-26 Thread Sergey Konoplev
if it is constraint, and can not it it is unique index. Correct? http://www.postgresql.org/docs/9.2/static/sql-set-constraints.html -- Kind regards, Sergey Konoplev PostgreSQL Consultant and DBA Profile: http://www.linkedin.com/in/grayhemp Phone: USA +1 (415) 867-9984, Russia +7 (901) 903-0499, +7 (988) 888-1979

Re: [SQL] execute

2013-04-25 Thread Sergey Konoplev
On Thu, Apr 25, 2013 at 9:17 AM, Mauricio Cruz c...@sygecom.com.br wrote: execute 'aCad:=aCad array[['||var1||','||var2||']]' What are you going to do using this construction aCad:=aCad array[['||var1||','||var2||']] ? I can not understand the meaning. -- Kind regards, Sergey Konoplev

Re: [SQL] Volatile functions in WITH

2013-02-20 Thread Sergey Konoplev
a single table scan, so no optimizations can be made. So they are guaranteed to behave as you need in your last example. What about optimizing it out in WITH - I would like to listen to hackers' opinion, because for me it looks like a bug. -- Sergey Konoplev Database and Software Architect http

Re: [SQL] Volatile functions in WITH

2013-02-20 Thread Sergey Konoplev
. Optimizer guarantees a stable result but not the way it is reached. -- Sergey Konoplev Database and Software Architect http://www.linkedin.com/in/grayhemp Phones: USA +1 415 867 9984 Russia, Moscow +7 901 903 0499 Russia, Krasnodar +7 988 888 1979 Skype: gray-hemp Jabber: gray...@gmail.com

Re: [SQL] Volatile functions in WITH

2013-02-19 Thread Sergey Konoplev
pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql -- Sergey Konoplev Database and Software Architect http://www.linkedin.com/in/grayhemp Phones: USA +1 415 867 9984 Russia, Moscow +7 901 903 0499 Russia

Re: [SQL] upsert doesn't seem to work..

2013-02-13 Thread Sergey Konoplev
=0.00..0.78 rows=39 width=0) Output: loadoltp.st_item_insert.item_id Can anyone see what I'm doing wrong? wkr, Bert -- Sergey Konoplev Database and Software Architect http://www.linkedin.com/in/grayhemp Phones: USA +1 415 867 9984 Russia, Moscow +7 901 903 0499 Russia

Re: [SQL] select on many-to-many relationship

2012-11-27 Thread Sergey Konoplev
-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql -- Sergey Konoplev Database and Software Architect http://www.linkedin.com/in/grayhemp Phones: USA +1 415 867 9984 Russia, Moscow +7 901 903 0499 Russia, Krasnodar +7 988 888 1979 Skype: gray

Re: [SQL] generate_series() with TSTZRANGE

2012-09-13 Thread Sergey Konoplev
subscription: http://www.postgresql.org/mailpref/pgsql-sql -- Sergey Konoplev a database and software architect http://www.linkedin.com/in/grayhemp Jabber: gray...@gmail.com Skype: gray-hemp Phone: +79160686204 -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] returning values from dynamic SQL to a variable

2012-09-10 Thread Sergey Konoplev
about EXECUTE in plpgsql. http://www.postgresql.org/docs/9.1/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN -- Sergey Konoplev a database and software architect http://www.linkedin.com/in/grayhemp Jabber: gray...@gmail.com Skype: gray-hemp Phone: +79160686204 -- Sent via

Re: [SQL] Question regarding modelling for time series

2012-09-05 Thread Sergey Konoplev
; reporting: 2011/08/01; value: 4 That are the series I want to get from the db. --Alex -- Sergey Konoplev a database and software architect http://www.linkedin.com/in/grayhemp Jabber: gray...@gmail.com Skype: gray-hemp Phone: +79160686204 -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] Question regarding modelling for time series

2012-09-04 Thread Sergey Konoplev
distribution however it can be done later. Thank you very much! --Alex -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql -- Sergey Konoplev a database and software architect http

Re: [SQL] DELETE using an outer join

2012-07-20 Thread Sergey Konoplev
. However it works. DELETE FROM some_table USING some_table AS s WHERE some_table.col1 = s.col1 AND some_table.col2 = s.col2 AND some_table.id s.id; -- Sergey Konoplev a database and software architect http://www.linkedin.com/in/grayhemp Jabber: gray...@gmail.com Skype: gray-hemp

Re: [SQL] DELETE using an outer join

2012-07-20 Thread Sergey Konoplev
, but there are complications. However it works. DELETE FROM some_table USING some_table AS s WHERE some_table.col1 = s.col1 AND some_table.col2 = s.col2 AND some_table.id s.id; But that's not an outer join Oh, yes. I just lost the discussion line. Sorry. -- Sergey Konoplev a database architect

Re: [SQL] DELETE using an outer join

2012-07-20 Thread Sergey Konoplev
would be understood to mean the target table. Right now this is an error case because of duplicate table aliases. Yes, the OP has already pointed me to it. Thank you for your explanation. -- Sergey Konoplev a database architect, software developer at PostgreSQL-Consulting.com http

Re: [SQL] DELETE using an outer join

2012-07-19 Thread Sergey Konoplev
and NOT IN. ps. May be this example is worth to append to the documentation? -- Sergey Konoplev a database architect, software developer at PostgreSQL-Consulting.com http://www.postgresql-consulting.com Jabber: gray...@gmail.com Skype: gray-hemp Phone: +79160686204 -- Sent via pgsql-sql mailing

Re: [SQL] How to use hstore

2012-06-05 Thread Sergey Konoplev
by Jan Eskilsson  for any loss or damage arising in any way from receipt or use thereof. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql -- Sergey Konoplev a database and software architect http

Re: [SQL] Using PL/pgSQL text argument in 'IN (INT,INT,...)' clause [re-post]

2010-10-25 Thread Sergey Konoplev
@ chaos claudius -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql -- Sergey Konoplev Blog: http://gray-hemp.blogspot.com / Linkedin: http://ru.linkedin.com/in/grayhemp / JID/GTalk: gray

Re: [SQL] unique fields

2010-09-23 Thread Sergey Konoplev
@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql -- Sergey Konoplev Blog: http://gray-hemp.blogspot.com / Linkedin: http://ru.linkedin.com/in/grayhemp / JID/GTalk: gray...@gmail.com / Skype: gray-hemp / ICQ: 29353802 -- Sent via pgsql-sql mailing

Re: [SQL] Use CREATE USER in plpgsql function

2010-09-15 Thread Sergey Konoplev
mean creds.userName)? Show the whole function please. Thanks -- -- Alexander -- Sergey Konoplev Blog: http://gray-hemp.blogspot.com / Linkedin: http://ru.linkedin.com/in/grayhemp / JID/GTalk: gray...@gmail.com / Skype: gray-hemp / ICQ: 29353802 -- Sent via pgsql-sql mailing list

Re: [SQL] Use CREATE USER in plpgsql function

2010-09-15 Thread Sergey Konoplev
; END; 2010/9/15 Sergey Konoplev gray...@gmail.com Hi, On 15 September 2010 08:05, Tatarnikov Alexander cank...@gmail.com wrote: Hello! I have function wich check user credentials and if test passed function must create new user with generated username and password. Language

Re: [SQL] plpgsql out parameter with select into

2010-08-18 Thread Sergey Konoplev
What is your PG version? 2010/8/18 Horváth Imre horvath.i...@blemidon.hu: It don't work... Only select into status * from... works. Imre Horvath 2010. 08. 18, szerda keltezéssel 09.42-kor Sergey Konoplev ezt írta: Hi, SELECT column_name INTO var_name FROM ... 2010/8/17 Horváth Imre

Re: [SQL] plpgsql out parameter with select into

2010-08-18 Thread Sergey Konoplev
via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql -- Sergey Konoplev Blog: http://gray-hemp.blogspot.com / Linkedin: http://ru.linkedin.com/in/grayhemp / JID/GTalk: gray...@gmail.com / Skype: gray-hemp / ICQ

Re: [SQL] plpgsql out parameter with select into

2010-08-17 Thread Sergey Konoplev
testfunc1(); $BODY$ language plpgsql; testfunc2 works, testfunc3 not. Thanks in advance: Imre Horvath -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql -- Sergey Konoplev Blog: http://gray

Re: [SQL] Question about POSIX Regular Expressions performance on large dataset.

2010-08-17 Thread Sergey Konoplev
Camargo -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql -- Sergey Konoplev Blog: http://gray-hemp.blogspot.com / Linkedin: http://ru.linkedin.com/in/grayhemp / JID/GTalk: gray...@gmail.com / Skype

Re: [SQL] Difference between these two queries ?

2010-06-06 Thread Sergey Konoplev
/docs/8.4/interactive/queries-table-expressions.html#QUERIES-FROM What is the first type of join called ? CROSS JOIN and is it possible that they have different execution times ? AFAIK planner would choose the same execution plan in your situation so it is not. -- Sergey Konoplev Blog: http

Re: [SQL] Table Design for Hierarchical Data

2010-04-07 Thread Sergey Konoplev
? From the description of ltree: This module implements a data type ltree for representing labels of data stored in a hierarchical tree-like structure. http://www.postgresql.org/docs/8.4/interactive/ltree.html -- Sergey Konoplev Blog: http://gray-hemp.blogspot.com / Linkedin: http://ru.linkedin.com

Re: [SQL] Week to date function

2010-03-26 Thread Sergey Konoplev
incorrect week specified. -- Sergey Konoplev Blog: http://gray-hemp.blogspot.com / Linkedin: http://ru.linkedin.com/in/grayhemp / JID/GTalk: gray...@gmail.com / Skype: gray-hemp / ICQ: 29353802 -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] Week to date function

2010-03-25 Thread Sergey Konoplev
 2010-01-07  2010-01-08  2010-01-09  2010-01-10 (7 rows) -- Sergey Konoplev Blog: http://gray-hemp.blogspot.com / Linkedin: http://ru.linkedin.com/in/grayhemp / JID/GTalk: gray...@gmail.com / Skype: gray-hemp / ICQ: 29353802 -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org