Re: [SQL] UNNEST result order vs Array data

2013-06-20 Thread Achilleas Mantzios
. -- Achilleas Mantzios -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Correct implementation of 1:n relationship with n>0?

2013-05-08 Thread Achilleas Mantzios
ing without getting under the hood. > >;-> > > After all, this should be really an ultra-classic-standard FAQ item. > > I'm definitely not the first database user in the world who needs to > have a 1:n relationship with n>0 and integrity enforced by the > d

Re: [SQL] Correct implementation of 1:n relationship with n>0?

2013-05-06 Thread Achilleas Mantzios
ing without getting under the hood. > >;-> > > After all, this should be really an ultra-classic-standard FAQ item. > > I'm definitely not the first database user in the world who needs to > have a 1:n relationship with n>0 and integrity enforced by the > data

Re: [SQL] Correct implementation of 1:n relationship with n>0?

2013-04-30 Thread Achilleas Mantzios
arrant data integrity under all > circumstances. Such as concurrent update, insert, delete etc. > I think your best bet is a trigger. use RAISE EXCEPTION to indicate an erroneous situation so as to make the transaction abort. (there is nothing wrong in getting your hands dirty with pl/pgsql

Re: [SQL] bug in 9.2.2 ? subquery accepts wrong column name : upd

2013-03-15 Thread Achilleas Mantzios
Thanx Tom. On Πεμ 14 Μαρ 2013 12:17:46 Tom Lane wrote: > Achilleas Mantzios writes: > > dynacom=# SELECT DISTINCT ON (qry.setid) qry.setid, qry.arragg[1:2] FROM > > (select distinct sst.setid,(array_agg(vsl.name) OVER (PARTITION BY > > sst.setid ORDER BY char

[SQL] bug in 9.2.2 ? subquery accepts wrong column name : upd

2013-03-14 Thread Achilleas Mantzios
setid does not exist LINE 1: ...gth(qry.arragg,1)>1 AND qry.setid NOT IN (SELECT soc.setid ... ^ dynacom=# postgresql corerctly identifies and throws the error. - Achilleas Mantzios IT DEV IT DEPT Dynacom Tankers Mgmt -- Sent vi

Re: [SQL] find sudstring on text (data type) field failure

2012-11-12 Thread Achilleas Mantzios
'. I use the query below SELECT id FROM table WHERE name LIKE '% foo %'; Sometimes the query return with nTuples=0 but there are matching rows. On retry, the query return with expected results. Any ideas; (postgres ver 9.2, libpq - C Library) - Achilleas Mantzios IT DEPT

Re: [SQL] Insane behaviour in 8.3.3

2012-06-19 Thread Achilleas Mantzios
On Τετ 20 Ιουν 2012 07:08:09 Craig Ringer wrote: > On 06/19/2012 05:17 PM, Achilleas Mantzios wrote: > > We had another corruption incident on the very same machine, this time in > > the jboss subsystem (a "jar cvf" produced corrupted .jar). IMHO this > > means fault

Re: [SQL] Insane behaviour in 8.3.3

2012-06-19 Thread Achilleas Mantzios
. > > > > On Fri, Jun 15, 2012 at 9:32 AM, Achilleas Mantzios > > > > wrote: > > > On Παρ 15 Ιουν 2012 18:03:26 Scott Marlowe wrote: > > >> Not talking about going to something after 8.3.19, just updating to > > >> the latest 8.3 version.

Re: [SQL] Insane behaviour in 8.3.3

2012-06-18 Thread Achilleas Mantzios
On Σαβ 16 Ιουν 2012 03:22:16 you wrote: > On Fri, Jun 15, 2012 at 3:06 AM, Achilleas Mantzios < > > ach...@matrix.gatewaynet.com> wrote: > > On Παρ 15 Ιουν 2012 12:29:38 Samuel Gendler wrote: > > > On Fri, Jun 15, 2012 at 2:28 AM, Samuel Gendler > > > >

Re: [SQL] Insane behaviour in 8.3.3

2012-06-18 Thread Achilleas Mantzios
> sudo apt-get upgrade > >> > >> or similar and sit back and watch. > > > > Thanx, unfortunately we dont have TCP/IP connectivity to (most of) the > > ships, and AFAIK apt-get does not yet work over advanced > > UUCP/minicom/kermit or other equivalen

Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Achilleas Mantzios
ave TCP/IP connectivity to (most of) the ships, and AFAIK apt-get does not yet work over advanced UUCP/minicom/kermit or other equivalent hich-tech dial up connection. just joking :) > > On Fri, Jun 15, 2012 at 2:24 AM, Achilleas Mantzios > > wrote: > > On Παρ 15 Ιουν 2012

Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Achilleas Mantzios
On Παρ 15 Ιουν 2012 12:29:38 Samuel Gendler wrote: > On Fri, Jun 15, 2012 at 2:28 AM, Samuel Gendler > > wrote: > > On Fri, Jun 15, 2012 at 1:24 AM, Achilleas Mantzios < > > > > ach...@matrix.gatewaynet.com> wrote: > >> And i forgot to mention,

Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Achilleas Mantzios
On Παρ 15 Ιουν 2012 12:28:21 Samuel Gendler wrote: > On Fri, Jun 15, 2012 at 1:24 AM, Achilleas Mantzios < > > ach...@matrix.gatewaynet.com> wrote: > > And i forgot to mention, minicom term emulation quality sucks, even > > giving simple > > shell commands is

Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Achilleas Mantzios
On Παρ 15 Ιουν 2012 10:28:20 Scott Marlowe wrote: > You do realize you're missing four years of bug fixes right? On Πεμ 14 Ιουν 2012 11:39:35 Achilleas Mantzios wrote: > Unfortunately the remote installations are neither physically accessible > nor by TCP/IP accesible (comms are don

Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Achilleas Mantzios
On Παρ 15 Ιουν 2012 09:34:16 Richard Huxton wrote: > On 14/06/12 09:39, Achilleas Mantzios wrote: > > dynacom=# SELECT id from items_tmp WHERE id=1261319 AND xid=61972; > > > > id > > > > - > > > > 1261319 > > > > (1 row)

[SQL] Insane behaviour in 8.3.3

2012-06-14 Thread Achilleas Mantzios
d | bigint | not null Indexes: "it_tmp_pk" PRIMARY KEY, btree (id, xid) Foreign-key constraints: "items_tmp_xid_fkey" FOREIGN KEY (xid) REFERENCES xadmin(xid) - Achilleas Mantzios IT DEPT -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] array dimensions, pg_catalog.pg_attribute and the \d command

2012-02-06 Thread Achilleas Mantzios
On Παρ 03 Φεβ 2012 22:21:49 Dmitriy Igrishin wrote: > Hey Achilleas, > > 2012/2/3 Achilleas Mantzios > > > Hello, > > just a question regarding multidimensional arrays. > > When i create an array, its number of dimensions is recorded in > > pg_catalog.pg_at

[SQL] array dimensions, pg_catalog.pg_attribute and the \d command

2012-02-03 Thread Achilleas Mantzios
Hello, just a question regarding multidimensional arrays. When i create an array, its number of dimensions is recorded in pg_catalog.pg_attribute (attndims), but they are not enforced upon insertion, nor is this presented by \d command. (i didn't see any attndims column showing up in the logs)

Re: [SQL] Retrieve the column values of a record without knowing the names

2011-02-18 Thread Achilleas Mantzios
8.n5.nabble.com/Retrieve-the-column-values-of-a-record-without-knowing-the-names-tp3387935p3387935.html > Sent from the PostgreSQL - sql mailing list archive at Nabble.com. > -- Achilleas Mantzios -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] SQL gotcha

2011-02-14 Thread Achilleas Mantzios
SQL standard requires. http://www.postgresql.org/docs/8.3/interactive/sql-select.html "The AS Key Word In the SQL standard, the optional key word AS is just noise and can be omitted without affecting the meaning. The PostgreSQL parser requires this key word when renaming output columns

Re: [SQL] data import

2010-12-21 Thread Achilleas Mantzios
oo from psql > > Regards > > Pavel Stehule > > > Thanx in advance > > -- > > --- > > Viktor Bojović > > --- > > Wherever I go, Murphy goes with me > > > -- Achilleas Mantzios -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] Full Text search differences from 8.3 to 8.4.6

2010-12-17 Thread Achilleas Mantzios
'fuel':20 'hour':27 'inspect':57 'job':9,30 'kind':43 'main':1,16 'master/cheng':4 'note':6 'opportun':54 'overlook':41 'pleas':5 'pms':62 'pump':21 'report':55 'request':44 'respect':49 'result':58 'shock':22,50 'sinc':28 'tech.dept':64 'tks/brgds':63 'vessel':14,38 'vma':61 'vma-pm':60 (1 row) and (the important command in 8.4.6) dynacom=# SELECT idxfti @@ to_tsquery('overlooked') from vmanews where id=28717; ?column? -- f (1 row) So, searching for "overlooked" which the original word in the text, in 8.3 idxfti @@ to_tsquery('overlooked') returns true while in 8.4.6 idxfti @@ to_tsquery('overlooked') returns false. Is there anything i am missing? -- Achilleas Mantzios -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Deleting entries from multiple tables

2010-11-30 Thread Achilleas Mantzios
8.n5.nabble.com/Deleting-entries-from-multiple-tables-tp3285654p3285654.html > > Sent from the PostgreSQL - sql mailing list archive at Nabble.com. > > > > -- > > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > > To make changes to your subscription: > &g

Re: [SQL] PostgreSQL array, recursion and more

2010-11-17 Thread Achilleas Mantzios
Στις Wednesday 17 November 2010 15:22:34 ο/η Ferruccio Zamuner έγραψε: > > /* How to get access to its items then? > */ select (mesh_split('A01.378.610.250.300.792.380')::text[])[1]; -- Achilleas Mantzios -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)

Re: [SQL] PostgreSQL ontop of FreeBSD jails, maybe there is still hope!

2010-07-21 Thread Achilleas Mantzios
Στις Wednesday 21 July 2010 10:57:45 ο/η Dave Page έγραψε: > On Wed, Jul 21, 2010 at 7:47 AM, Achilleas Mantzios > wrote: > > It seems there are certain projects running at the moment that will > > eventually make possible > > to run PostgreSQL on FreeBSD's jail

[SQL] PostgreSQL ontop of FreeBSD jails, maybe there is still hope!

2010-07-21 Thread Achilleas Mantzios
s, even easier and more robustly than it is the case now. Lets hope those guys will deliver smth good. -- Achilleas Mantzios -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Table Design for Hierarchical Data

2010-04-12 Thread Achilleas Mantzios
Στις Thursday 08 April 2010 17:59:01 ο/η Rob Sargent έγραψε: > The "parent" node in a genealogy is the mother-father tuple, so given > that as a singularity it still fits a tree. No, because the child and parent node would be of different schema. > > On 04/08/2010 12:56

Re: [SQL] Table Design for Hierarchical Data

2010-04-08 Thread Achilleas Mantzios
Στις Wednesday 07 April 2010 23:33:07 ο/η Yeb Havinga έγραψε: > Achilleas Mantzios wrote: > > Στις Wednesday 07 April 2010 11:06:44 ο/η Yeb Havinga έγραψε: > > > >> Achilleas Mantzios wrote: > >> > >>> You could also consider the genealogical ap

Re: [SQL] Table Design for Hierarchical Data

2010-04-07 Thread Achilleas Mantzios
Στις Wednesday 07 April 2010 11:06:44 ο/η Yeb Havinga έγραψε: > Achilleas Mantzios wrote: > > You could also consider the genealogical approach, e.g. > > > > > > The parents of any node to the root, i.e. the path of any node to the root > > are depicted as

Re: [SQL] Table Design for Hierarchical Data

2010-04-07 Thread Achilleas Mantzios
nkedin.com/in/grayhemp / > JID/GTalk: gray...@gmail.com / Skype: gray-hemp / ICQ: 29353802 > -- Achilleas Mantzios -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Table Design for Hierarchical Data

2010-04-07 Thread Achilleas Mantzios
Στις Wednesday 07 April 2010 10:53:00 ο/η silly sad έγραψε: > On 04/07/10 11:00, Achilleas Mantzios wrote: > > > Column | Type| Modifiers > > -+---+--

Re: [SQL] Table Design for Hierarchical Data

2010-04-07 Thread Achilleas Mantzios
lly I'd like to know if this should be a single table or should > there be a separate table for each level of the hierarchy (four in all)? If > one table, should the digits be broken into separate columns? Should parent > ids be stored in each node? > > More generally, what quest

Re: [SQL] join with an array

2010-02-24 Thread Achilleas Mantzios
--+- 1 | 5 day eastern carribean cruise | {1,5} 2 | 5 day western carribean cruise | {2,6} 3 | 5 day eastern carribean cruise | {3,7} 4 | 5 day western carribean cruise | {4,8} (4 rows) EXERCISE: Why cant we excl

Re: [SQL] very frustrating feature-bug

2010-02-17 Thread Achilleas Mantzios
ER; CREATE FUNCTION dynacom=# dynacom=# > > regards, tom lane > -- Achilleas Mantzios -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Find periods for a given... action set?

2009-06-12 Thread Achilleas Mantzios
e BEGIN - there is no period there, because I don't > have and endpoint. Similarly, user_id 1 has BEGIN as the last action - > just two periods for user_id 1, because last BEGIN denotes 'period in > progress'. > > Also, user_id 1 has following actions happened, time o

Re: [SQL] Array: comparing first N elements?

2009-05-12 Thread Achilleas Mantzios
then you would do that with: intset(parid) ~ parents For the above to be efficient you should create an index on parents. Prefer method "gin" with opclass "gin__int_ops" Well thats how i implemented trees in postgresql anyway. > > In other words, testing against the fi

Re: [SQL] Postgres entering zombie state once a week in production evnvironment

2009-04-14 Thread Achilleas Mantzios
you able to start psql and do some simple command? Have you ruled out the possibility of the application being locked for other reasons? (limits, network failure,etc) -- Achilleas Mantzios -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] cast bool/int

2009-03-23 Thread Achilleas Mantzios
T 't'::boolean::int; int4 -- 1 (1 row) and SELECT 'f'::boolean::int; int4 -- 0 (1 row) work in 8.3 > Any ideas? Thanks. > > Zdravko > > -- Achilleas Mantzios -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make chan

Re: [SQL] cast bool/int

2009-03-23 Thread Achilleas Mantzios
Στις Monday 23 March 2009 09:59:12 ο/η Zdravko Balorda έγραψε: > > Hi, > I need a casting operator from boolean to integer, > tu put in ALTER TABLE statment after USING. > How about CASE WHEN 't' THEN 1 ELSE 0 END > Any ideas? Thanks. > > Zdravko > >

Re: [SQL] alter table on a large db

2009-03-19 Thread Achilleas Mantzios
r what could possibly alter > table be doing all this time. Which version of postgresql do you use? Also you might consider editing the SQL dump to alter the DDL statements prior to loading it in your db. batch editing sed, awk, perl, could help you on that... > > Regards, Zdravko. &

Re: [SQL] Array iterator

2009-01-27 Thread Achilleas Mantzios
Στις Tuesday 27 January 2009 14:40:29 ο/η Raj Mathur έγραψε: > select regexp_split_to_array('string with tokens', '[^A-Za-z0-9]'); > maybe select regexp_split_to_table('string with tokens', '[^A-Za-z0-9]'); would help? -- Achilleas Mantzios

[SQL] array index access outside range

2008-12-04 Thread Achilleas Mantzios
t? Is there any thoughts/needs/discussions of changing this behaviour in a future version thus breaking my program? Thanx a lot -- Achilleas Mantzios -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] array variables

2008-11-13 Thread Achilleas Mantzios
LECT p FROM idx)])[i][j]; 1<=i<=2 1<=j<=select count(*) from idx > > regards > mk > -- Achilleas Mantzios -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] returning count(*) when it is > 1, else -1

2008-10-17 Thread Achilleas Mantzios
t; ) AS raw_total > > > Pavel, Richard, you got it dudes! I have to say, that kinda 'reference > before assingment' of "total" doesnt look logical to me. > Then, both you and your boss need some SQL courses :) (no offense) > Thanks again!! > Gerardo

Re: [SQL] order of rows in update

2008-09-03 Thread Achilleas Mantzios
Στις Wednesday 03 September 2008 15:28:04 ο/η Richard Broersma έγραψε: > On Tue, Sep 2, 2008 at 11:56 PM, Achilleas Mantzios > <[EMAIL PROTECTED]> wrote: > > I am using my version of DB mirror to do some kind of "Conditional row > > grained + FK dependency oriente

Re: [SQL] order of rows in update

2008-09-02 Thread Achilleas Mantzios
Στις Tuesday 02 September 2008 17:24:05 ο/η Richard Broersma έγραψε: > On Tue, Sep 2, 2008 at 2:58 AM, Achilleas Mantzios > <[EMAIL PROTECTED]> wrote: > > is there an (implicit) way to make a multirow update execute on some rows > > prior to other rows? > > It is ne

[SQL] order of rows in update

2008-09-02 Thread Achilleas Mantzios
there anything reliable to achieve this without making poor assumptions of the future versions, or should i just "SELECT ... ORDER BY ..." and then perform individual UPDATEs? Thanx -- Achilleas Mantzios -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make chang

Re: [SQL] dbmirror - migration to 8.3 from 7.4

2008-05-07 Thread Achilleas Mantzios
valid) in the where clause above? > > Do you use oid? We had an issue where old code relied on oid and when > we tested 8.2 we had issues with oid being used but not available. The > fix was easy and only required a id-column of type serial. > No, we dont use OID as primary keys.

[SQL] dbmirror - migration to 8.3 from 7.4

2008-05-07 Thread Achilleas Mantzios
i had to add PG_DETOAST_DATUM on any array Datum. The code seems to work however i'd like your comments if i miss something. Thanks a lot. -- Achilleas Mantzios -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Update PK Violation

2008-01-16 Thread Achilleas Mantzios
mp set num = 1 + num/1000 where num >= 6; -- Achilleas Mantzios ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] Calling functions from within pl/pgsql

2007-12-04 Thread Achilleas Mantzios
Στις Tuesday 04 December 2007 14:59:43 ο/η Pavel Stehule έγραψε: > On 04/12/2007, Achilleas Mantzios <[EMAIL PROTECTED]> wrote: > > I noticed that in pl/pgsql simply > > result := funcname(func,args,...); > > just works. > > Should i rely on it or take it a

[SQL] Calling functions from within pl/pgsql

2007-12-04 Thread Achilleas Mantzios
I noticed that in pl/pgsql simply result := funcname(func,args,...); just works. Should i rely on it or take it as a coincidence? :) -- Achilleas Mantzios ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] show value of backslashes in string array argument

2007-11-12 Thread Achilleas Mantzios
hes. > > Sabin I would recommend: a) Move to Unix b) Subscribe to [EMAIL PROTECTED] > > > > ---(end of broadcast)------- > TIP 7: You can help support the PostgreSQL project by donating at > > http://www.postgresql.

Re: [SQL] show value of backslashes in string array argument

2007-11-12 Thread Achilleas Mantzios
If you do SELECT "colVarchar","colVarcharArray"[1] FROM test; you will see that you get identical values. -- Achilleas Mantzios ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] ISO time zone format

2007-09-05 Thread Achilleas Mantzios
ow(); from within psql, output in your system? > > TIA, > Sabin > > > > ---(end of broadcast)--- > TIP 9: In versions below 8.0, the planner will ignore your desire to >choose an index scan if your

Re: [SQL] strange result for select * from table where id=random()*900

2007-07-27 Thread Achilleas Mantzios
n > _ > In 5 Schritten zur eigenen Homepage. Jetzt Domain sichern und gestalten! > Nur 3,99 EUR/Monat! http://www.maildomain.web.de/?mc=021114 > > > ---(end of

Re: [SQL] Having the sum of two queries

2007-07-16 Thread Achilleas Mantzios
e same > status... It should also be UNION ALL, just in case some status'es are common in the 2 subqueries. > > ---(end of broadcast)--- > TIP 7: You can help support the PostgreSQL project by donating at > >

Re: [SQL] Where clause

2007-06-26 Thread Achilleas Mantzios
g t2 where t2.click and t2.cid=tglob.cid) as countclicks from tracking tglob; ? > Mike > > ---(end of broadcast)--- > TIP 6: explain analyze is your friend -- Achilleas Mantzios ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] yet another simple SQL question

2007-06-26 Thread Achilleas Mantzios
you think that criticizing was better than staying silent? Anyway, Joshua already took some very enlightening answers enuf to get him going. -- Achilleas Mantzios ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate

Re: [SQL] query to select a linked list

2007-05-09 Thread Achilleas Mantzios
roadcast)--- > TIP 1: if posting/reading through Usenet, please send an appropriate >subscribe-nomail command to [EMAIL PROTECTED] so that your >message can get through to the mailing list cleanly -- Achilleas Mantzios -

Re: [SQL] We all are looped on Internet: request + transport = invariant

2007-04-20 Thread Achilleas Mantzios
a little bit. -- Achilleas Mantzios ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [SQL] reindex database

2007-03-14 Thread Achilleas Mantzios
so that your > message can get through to the mailing list cleanly -- Achilleas Mantzios ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] can someone explain confusing array indexing nomenclature

2007-02-19 Thread Achilleas Mantzios
ng,presentation}}' as text[][]))[1:1][1000]; text --- {{meeting,lunch}} (1 row) dynacom=# > > Achilleas Mantzios wrote: > > Στις Πέμπτη 15 Φεβρουάριος 2007 18:55, ο/η chrisj έγραψε: > >> Thanks Achilleas, > >> > &g

Re: [SQL] can someone explain confusing array indexing nomenclature

2007-02-16 Thread Achilleas Mantzios
the other case it means "1:2") and the context is > determined by the format of indexes on other dimensions. > > I believe I understandbut incredibly confusing. > Now that i think about it again, i speculate that the [2] is discarded. > - chris > > Achilleas Mantz

Re: [SQL] can someone explain confusing array indexing nomenclature

2007-02-15 Thread Achilleas Mantzios
M sal_emp WHERE name = 'Bill'; you would still get {{meeting,lunch}} as a result. (Right or wrong is another story). Anyway the first time you query for a "text", the second time you query for a "text[]", so you should expect different results. -- Achilleas Mantzios -

Re: [SQL] Seeking quick way to clone a row, but give it a new pk.

2007-02-07 Thread Achilleas Mantzios
l violate the unique primary key constraint: > > insert into xx_plan_rule select * from xx_plan_rule where rule_id=9; > ERROR: duplicate key violates unique constraint "xx_plan_rule_pkey" If you have that requirement often i would recommend writing a program taking the tablename

Re: [SQL] Intersection of two date interval

2007-01-26 Thread Achilleas Mantzios
7;21.01.2007'::date); time_intersect > --- > ("13.01.2007 00:00:00 CET","20.01.2007 00:00:00 CET") > (1 row) > > > test=*# select *, t2-t1 from time_intersect('10.01.2007'::date, > '20.01.

Re: [SQL] Query a select that returns....

2006-12-19 Thread Achilleas Mantzios
ique Iazzetti Santos > Compels Inform�tica > Santa Rita do Sapuca� - MG > www.compels.net > > > > > > > ___ > O Yahoo! est� de cara nova. Venha conferir! > http://br.yahoo.com -- Achilleas Mantzios ---(end of broadcast)--- TIP 1: i

Re: [SQL] Numbers

2006-11-24 Thread Achilleas Mantzios
ll take forever. > the larger database etc ? > > > Regards... -- Achilleas Mantzios ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [SQL] delete on cascade

2006-10-23 Thread Achilleas Mantzios
> Thanks, > Luca > > ---(end of broadcast)--- > TIP 3: Have you checked our extensive FAQ? > >http://www.postgresql.org/docs/faq -- Achilleas Mantzios ---(end of broadcast)--- TIP 9: In ver

Re: [SQL] delete on cascade

2006-10-23 Thread Achilleas Mantzios
--(end of broadcast)--- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not >match -- Achilleas Mantzios ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Fwd: Re: [SQL] [GENERAL] How to split a table?

2006-10-17 Thread Achilleas Mantzios
From: Achilleas Mantzios <[EMAIL PROTECTED]> To: pgsql-sql@postgresql.org Στις Τρίτη 17 Οκτώβριος 2006 11:34, ο/η Andreas Kretschmer έγραψε: > Felix Zhang <[EMAIL PROTECTED]> schrieb: > > Hi, > > > > I want to split a table to 2 small tables. The 1st one contains 6

Re: [SQL] [GENERAL] How to split a table?

2006-10-17 Thread Achilleas Mantzios
is number to your "range" like this: let your number be r. let your table's cardinality be N. then let R=(N*r/(2^31))+1 select a source row from your table like: select * from srctable order by pk offset , and then insert this row to your desttable. > > > Andreas

Re: [SQL] i have table

2006-10-05 Thread Achilleas Mantzios
Στις Πέμπτη 05 Οκτώβριος 2006 16:31, ο/η Tom Lane έγραψε: > Achilleas Mantzios <[EMAIL PROTECTED]> writes: > > Alright, you could play with something like: > > > > UPDATE pg_attribute SET attnum = where > > attrelid= and attname=''; > > That'

Re: [SQL] i have table

2006-10-05 Thread Achilleas Mantzios
27; thing. It's just a matter of aesthetic preference. Alright, you could play with something like: UPDATE pg_attribute SET attnum = where attrelid= and attname=''; but do some research of possible bad side effects. -- Achilleas Mantzios ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] i have table

2006-10-03 Thread Achilleas Mantzios
ential or exempt from disclosure > under applicable law. If you are not the intended recipient or it appears > that this mail has been forwarded to you without proper authority, you are > notified that any use or dissemination of this information in any manner is > strictly prohibited. In such cases, please notify us immediately at > [EMAIL PROTECTED] and delete this email from your records. -- Achilleas Mantzios ---(end of broadcast)--- TIP 6: explain analyze is your friend