Re: [SQL] matching a timestamp field

2012-09-22 Thread BACHELART PIERRE (CIS/SCC)
aaa | | 000c | mmcb | e | ef03 | b1 | plce#xfx | 2012-09-20 11:50:02 | H| a1 and5032t | and5032t | 01a0313 | 21407932 | abca | | 000c | mcud | e | ef03 | b1 | plce#xfx | 2012-09-20 11:50:02 | H| a1 (5 rows) But I still can not find this in the doc. From: BACHELART PIERR

[SQL] matching a timestamp field

2012-09-22 Thread BACHELART PIERRE (CIS/SCC)
type(s). You might need to add explicit type casts. ansroc=# Pierre. +32 471 68 12 23 * Disclaimer * http://www.belgacom.be/maildisclaimer

Re: [SQL] [PERFORM] SQL Query Performance - what gives?

2009-08-19 Thread Pierre Frédéric Caillau d
The bitmask allows the setting of multiple permissions but the table definition doesn't have to change (well, so long as the bits fit into a word!) Finally, this is a message forum - the actual code itself is template-driven and the bitmask permission structure is ALL OVER the templates; gettin

Re: [SQL] Formatting an Interval

2005-01-02 Thread Pierre-Frédéric Caillaud
Note that there will be a loss of precision as an interval of 1 month, for instance, does not mean any specific number of days, as : 1 february + 1 month = 1 march (1 month = 28 or 29 days) 1 december + 1 month = 1 january(1 month = 31 days) Same for years etc. -

Re: [SQL] Making dirty reads possible?

2004-12-07 Thread Pierre-Frédéric Caillaud
You can always use contribs/dblink, or a plperlu/plpythonu function which writes to a file... So, summarising: - Nested transactions is not (yet) supported - READ UNCOMMITTED isolation level is not (yet) supported - EXECUTE does not circumvent the transaction Is there a way around this? Regard

Re: [SQL] Way to stop recursion?

2004-11-26 Thread Pierre-Frédéric Caillaud
You have to do this with a trigger. The problem is that the rule is expanded inline like a macro, so you can't prevent the behaviour you're seeing. True, but you can get out of the hole in another way : - Change the name of your table to "hidden_table" - Create a view which is a duplicate of

Re: [SQL] Recursive SETOF function

2004-11-22 Thread Pierre-Frédéric Caillaud
SELECT INTO cid count(*) FROM providers WHERE uid =child_provider; Hey, hey. Better : SELECT blablah FROM providers WHERE uid = child_provider LIMIT 1; IF NOT FOUND THEN exit with error ELSE do your stuff Why scan more than 1 row when you just need existence

Re: [SQL] finding gaps in dates

2004-11-16 Thread Pierre-Frédéric Caillaud
I have a logging application that should produce an entry in the database every minute or so, give or take a few seconds. I'm interested in finding out a: what minutes don't have a record and b: periods where the gap exceeded a certain amount of time. Is this not the same question ? An

Re: [SQL] tree structure photo gallery date quiery

2004-11-16 Thread Pierre-Frédéric Caillaud
I'm looking at the possibility of implementing a photo gallery for my web site with a tree structure, something like: You don't really want a tree structure, because one day you'll want to put the same photo in two galleries. Suppose you take a very interesting photo of celery during your tri

Re: [SQL] Comparing two (largish) tables on different servers

2004-11-09 Thread Pierre-Frédéric Caillaud
Idea : Write a program which connects on the two databases, creates a cursor on each to return the rows in order, then compare them as they come (row 1 from cursor 1 == row 1 from cursor 2, etc). Fetch in batchs. If there's a difference you can then know which row. I hope you have an index

Re: [SQL] need query advice

2004-10-19 Thread Pierre-Frédéric Caillaud
argh, you could use contribs/intarray with a gist index... instead of N columns use an integer[] and gist-index it, then write the equivalent of : where (intersection of the search array with the data array) has at least 5 elements (or 4 elements) (or at least 4 elements order by

Re: [SQL] Export tab delimited from mysql to postgres.

2004-10-12 Thread Pierre-Frédéric Caillaud
A tested example in Python : Basically it counts the \t and accumulates the lines until it has enough and then prints the line. Note : as an exercise you could add a test so that there are exactly (columns-1) delimiters and not >=(columns-1). def grouplines( in_stream, columns, delimiter ):

Re: [SQL] Howto turn an integer into an interval?

2004-10-05 Thread Pierre-Frédéric Caillaud
try : resend_interval * '1 seconds'::interval this will convert your seconds into an interval. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] degradation in performance

2004-09-21 Thread Pierre-Frédéric Caillaud
6000 inserts, each in its own transaction, will be very long. Group your inserts in one transaction and it'll be faster (maybe 1-2 minutes). Have your program generate a tab-delimited text file and load it with COPY, you should be down to a few seconds. On Tue, 21 Sep 2004 13:27:43 +0200,

Re: [SQL] Storing properties in a logical way.

2004-09-05 Thread =?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?=
But after looking closely at the list of a possible properties, i found out that some of them depend on others. For example, if item is a PDF document, it can have an index. But a document can also have an index with links. Logically, a properties like 'index with links' don't belong to the verific

Re: [SQL] Make a column case insensitive

2004-08-08 Thread Pierre-Frédéric Caillaud
When I use UTF-8 encoding for my database. upper and lower() functions break (no longer process accented chars correctly). This is with the correct encoding [EMAIL PROTECTED] I think, for CTYPES et al. ---(end of broadcast)--- TIP 9: the planne

[SQL] timestamp conversion to unisgned long?

2001-06-22 Thread pierre
eas? Perhaps I'm using the wrong type? Pierre

[SQL] Table design issue....

2001-06-11 Thread pierre
ables with *_attr*[1] == FLAG return rows with VALUE" Ideas? Comments? Suggestions? Am I being crazy? Pierre

[SQL] Subqueries in from clause

2000-11-03 Thread Pierre Habraken
everything ! For this kind of usage I need most SQL92 features, at least for query expression. Thanks for any information or advice about this topics. Pierre -- Pierre HABRAKEN - mailto:[EMAIL PROTECTED] Tél: 04 76 82 72 48

Re: [SQL] shared memory leak in 7.0.2?

2000-08-28 Thread Pierre Padovani
. Here is the current output of that ipc command: [root@kahuna pierre]# ipcs -m -a -- Shared Memory Segments keyshmid owner perms bytes nattchstatus 0x0052e2ca 0 postgres 700 144 2 0x0052e2c1 1

[SQL] shared memory leak in 7.0.2?

2000-08-28 Thread pierre
l/data -i -S -o -F Pierre