Re: [GENERAL] COPY TO duplicates "\" signs

2008-11-05 Thread Ivan Sergio Borgonovo
; D:\\Program Files\\BMC Software\\CONTROL-D\\wa/reports > == ==== == try to play with the ESCAPE AS and set it as '' if you really want to skip \. http://www.postgresql.org/docs/8.1/static/sql-copy.html -- Ivan Sergio Borgonovo http://www.webthatwork

Re: [GENERAL] gin creation and previous history of server

2008-11-05 Thread Ivan Sergio Borgonovo
On Tue, 04 Nov 2008 10:33:26 -0500 Tom Lane <[EMAIL PROTECTED]> wrote: > Ivan Sergio Borgonovo <[EMAIL PROTECTED]> writes: > > It seems that gin creation is triggering something nasty in the > > server that depends on previous history of the server. > > Can you p

Re: [GENERAL] gin creation and previous history of server

2008-11-05 Thread Ivan Sergio Borgonovo
On Wed, 05 Nov 2008 10:53:38 -0500 Tom Lane <[EMAIL PROTECTED]> wrote: > Ivan Sergio Borgonovo <[EMAIL PROTECTED]> writes: > > Tom Lane <[EMAIL PROTECTED]> wrote: > >> Can you put together a self-contained test case that illustrates > >> this? &g

Re: [GENERAL] Specifying text to substitute for NULLs in selects

2008-11-07 Thread Ivan Sergio Borgonovo
drop cascades to table test.test DROP SCHEMA everything clearly explained in the COPY manual: http://www.postgresql.org/docs/8.1/static/sql-copy.html -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Specifying text to substitute for NULLs in selects

2008-11-07 Thread Ivan Sergio Borgonovo
d input syntax for integer: "NA" furthermore... even if c1 was text you may end up in output like: 'NA' that will be hard to be discerned from a "normal" string. BTW I just discovered that COPY doesn't work on view. -- Ivan Sergio Borgonovo http://www.webthatwork

Re: [GENERAL] Specifying text to substitute for NULLs in selects

2008-11-07 Thread Ivan Sergio Borgonovo
;', and all NULLs will from then on be output as NA. > > The COPY option is closest to a generic setting, but doesn't work > with a select query, just a table dump. \copy (select ) to ... works. As written in my 2nd post. -- Ivan Sergio Borgonovo http://www.webthatworks.it

[GENERAL] options for launching sql script asynchronously from web app

2008-11-07 Thread Ivan Sergio Borgonovo
I'd like to launch some sql script asynchronously from a web app and have some kind of feedback later. Some form of authentication would be a plus. Is there anything ready? -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-ge

Re: [GENERAL] options for launching sql script asynchronously from web app

2008-11-08 Thread Ivan Sergio Borgonovo
s. I don't like it... but I've done it before and I'm still alive. I just have to trigger an event that run asynchronously, avoid other events of the same kind are triggered while one is running and report back event status. thanks -- Ivan Sergio Borgonovo http://www.webthatworks.i

Re: [GENERAL] Fulltext index

2008-11-08 Thread Ivan Sergio Borgonovo
deas? Multicolumn indexes should get into 8.4. You may add a column tsvector and compute it with a trigger that chose the correct language when generating the tsvector. Then you'll have to pick up the correct language when you generate the tsquery in your search. http://www.sigaev.ru/gin/fastin

[GENERAL] psql exit code

2008-11-10 Thread Ivan Sergio Borgonovo
I'm running: ON_ERROR_STOP="on" PGPASSFILE="/somewhere" psql dbname username -f script.sql (or alternatively http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] psql exit code

2008-11-10 Thread Ivan Sergio Borgonovo
On Mon, 10 Nov 2008 10:56:57 + Richard Huxton <[EMAIL PROTECTED]> wrote: > Ivan Sergio Borgonovo wrote: > > I'm running: > > > > ON_ERROR_STOP="on" PGPASSFILE="/somewhere" psql dbname username > > -f script.sql > > (or alt

[GENERAL] still gin index creation takes forever

2008-11-11 Thread Ivan Sergio Borgonovo
ns mysteriously even when there is no process stealing CPU cycles. Anyway when I'm creating a gin index CPU use is very high staying constantly near 100%. Any suggestion about how to track down the problem? thanks [1] temporary but not strictly temp tables -- Ivan Sergio Borgonovo http:/

Re: [GENERAL] still gin index creation takes forever

2008-11-12 Thread Ivan Sergio Borgonovo
On Tue, 11 Nov 2008 22:02:17 -0500 Tom Lane <[EMAIL PROTECTED]> wrote: > Ivan Sergio Borgonovo <[EMAIL PROTECTED]> writes: > > Any suggestion about how to track down the problem? > > What you are describing sounds rather like a > use-of-uninitialized-memory problem

[GENERAL] sequence not restarting in a for loop (actually semi-random numbers)

2008-11-12 Thread Ivan Sergio Borgonovo
#x27;) from biglist join mylist on biglist.id=mylist order by biglist.something limit 3; end loop; drop sequence tmp_seq; I'd expect something like 1,1 1,2 1,3 127,1 127,2 127,3 but I get something like 1,5 1,6 1,7 127,55 127,56 127,57 152,6 152,7 152,8 what should I do to obtain the r

Re: [GENERAL] sequence not restarting in a for loop (actually semi-random numbers)

2008-11-12 Thread Ivan Sergio Borgonovo
On Wed, 12 Nov 2008 11:17:03 -0500 Tom Lane <[EMAIL PROTECTED]> wrote: > Ivan Sergio Borgonovo <[EMAIL PROTECTED]> writes: > > insert into mytop (id,n) select id, nextval('tmp_seq') > > from biglist join mylist on biglist.id=mylist > > order b

Re: [GENERAL] still gin index creation takes forever

2008-11-13 Thread Ivan Sergio Borgonovo
ue if his table contains > large numbers of repeated GIN keys. Ivan, is that what your data > looks like? Well if by GIN keys you mean lexemes it could be. But I wouldn't say this circumstance is uncommon among users of tsearch. I'd expect other people had used tsearch2 to search

Re: [GENERAL] still gin index creation takes forever

2008-11-13 Thread Ivan Sergio Borgonovo
>> if the problem goes away. > > > Test suit to reproduce the problem: > > I don't doubt that you're describing a real effect, I'm just not > sure yet that it's the same thing Ivan is seeing. He seems to be > talking about more than 4x differences.

Re: [GENERAL] still gin index creation takes forever

2008-11-18 Thread Ivan Sergio Borgonovo
>> if the problem goes away. > > > Test suit to reproduce the problem: > > I don't doubt that you're describing a real effect, I'm just not > sure yet that it's the same thing Ivan is seeing. He seems to be > talking about more than 4x diffe

[GENERAL] tracking down a warning

2008-11-19 Thread Ivan Sergio Borgonovo
t how can I find the statement? Which is the right log config to tweak to get enough info to be able to use grep on my code base without producing 2Gb logs in 5min? BTW can this log config be tweaked dynamically? by connection etc... or just in postgres.conf? thanks -- Ivan S

Re: [GENERAL] transaction_read_only effects on performance, actual meaning (was: How to reduce impact of a query)

2008-11-20 Thread Ivan Sergio Borgonovo
UES ('oats'), ('wheat'), ('beans'); > > SET transaction_read_only = 1; > > SELECT * FROM a; > > COMMIT; > > > > but it does. Interesting. Thank you for pointing it out. -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] long vacuum full, gin index and unusually long delete

2008-11-21 Thread Ivan Sergio Borgonovo
problems... for all the other activities the box seems to behave happily... including some other heavy weight activities where postgresql is involved. -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make chan

[GENERAL] case when evaluating else condition anyway?

2008-11-26 Thread Ivan Sergio Borgonovo
string to null and everything else to a timestamp. Is there any cleaner functional way that doesn't involve prepared statement etc... since the whole exercise is caused by an null-impaired DB API (aka MySQLish). -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via p

Re: [GENERAL] case when evaluating else condition anyway?

2008-11-26 Thread Ivan Sergio Borgonovo
On Wed, 26 Nov 2008 14:18:44 + Sam Mason <[EMAIL PROTECTED]> wrote: > On Wed, Nov 26, 2008 at 02:53:07PM +0100, Ivan Sergio Borgonovo > wrote: > > case when ''=extinput then null else extinput::timestamp end > > I'd tend to use nullif(extinput,'&

Re: [GENERAL] pk vs unique not null differences between 8.3.4 and 8.3.8

2009-11-02 Thread Ivan Sergio Borgonovo
On Mon, 02 Nov 2009 09:53:06 -0500 Tom Lane wrote: > Ivan Sergio Borgonovo writes: > > This statement succede in 8.3.8 > > alter table shop_commerce_gift drop constraint > > shop_commerce_gift_pkey; > > but failed in 8.3.4. > > Uh, that doesn't seem to mat

[GENERAL] xml import/export tools and performance

2009-11-05 Thread Ivan Sergio Borgonovo
thing that is more like a tagged csv. Currently I'm mostly looking around to see where it would be convenient to move the boundaries of the problem. I'd be curious about what kind of performance impact they may have compared to COPY. thanks -- Ivan Sergio Borgonovo http://www.webthatwo

[GENERAL] knowing which table/schema is going to be chosen

2009-11-12 Thread Ivan Sergio Borgonovo
; In this case test.mytable will be chosen. Is there a way to ask postgresql the schema of the table that will be chosen? -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] knowing which table/schema is going to be chosen

2009-11-12 Thread Ivan Sergio Borgonovo
On Thu, 12 Nov 2009 10:38:27 + Richard Huxton wrote: > Ivan Sergio Borgonovo wrote: > > I have a search_path that may not just consist of $user, public. > > eg. > > $user, public, test, import > > > > I'd like to know which table is going to be chos

[GENERAL] impersonating a user/ownership problems

2009-11-17 Thread Ivan Sergio Borgonovo
ainful. create sequence alter table ... owner to alter sequence ... owned by ... alter table ... set default ... Is there a less painful approach? -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to yo

Re: [GENERAL] passing parameters to multiple statements

2009-11-18 Thread Ivan Sergio Borgonovo
. That's shooting yourself in the head without even knowing the reason. -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] passing parameters to multiple statements

2009-11-18 Thread Ivan Sergio Borgonovo
On Wed, 18 Nov 2009 11:38:46 +0100 Pavel Stehule wrote: > 2009/11/18 Ivan Sergio Borgonovo : > > On Tue, 17 Nov 2009 20:16:36 -0800 > > David Fetter wrote: > > > >> On Tue, Nov 17, 2009 at 09:33:05AM -0700, Konstantin Izmailov > >> wrote: > >>

[GENERAL] advocating pgsql was:passing parameters to multiple statements

2009-11-18 Thread Ivan Sergio Borgonovo
accent on the "social" part of it and on the fall back on our beloved DB. I think there are far more people knowing just one DB and badly than companies with such strict (insane) policies and... well PostgreSQL is very standard compliant. I'd beat another horse ;) -- Ivan Sergi

[GENERAL] duplicating a schema

2009-11-29 Thread Ivan Sergio Borgonovo
roach? -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] duplicating a schema

2009-12-01 Thread Ivan Sergio Borgonovo
On Tue, 1 Dec 2009 11:39:06 +0900 Schwaighofer Clemens wrote: > On Sun, Nov 29, 2009 at 21:21, Ivan Sergio Borgonovo > wrote: > > I need to create a new schema with all the content in an existing > > one, just with a new name. > > The way I've found is: > >

Re: [GENERAL] duplicating a schema

2009-12-01 Thread Ivan Sergio Borgonovo
On Tue, 1 Dec 2009 09:53:12 +0100 Ivan Sergio Borgonovo wrote: > On Tue, 1 Dec 2009 11:39:06 +0900 > Schwaighofer Clemens wrote: > > > On Sun, Nov 29, 2009 at 21:21, Ivan Sergio Borgonovo > > wrote: > > > I need to create a new schema with all the content in an &

Re: [Bacula-users] [GENERAL] Catastrophic changes to PostgreSQL 8.4

2009-12-03 Thread Ivan Sergio Borgonovo
system that has a different locale from the one the backup was made on? Can I use regexp? Can accents be ignored during searches? -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] flagging first row inserted for each "group" of key

2009-12-17 Thread Ivan Sergio Borgonovo
to move to 8.4 shortly, so no windowing functions that will make reporting easier/faster. -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] flagging first row inserted for each "group" of key

2009-12-17 Thread Ivan Sergio Borgonovo
On Thu, 17 Dec 2009 10:38:32 +0100 "A. Kretschmer" wrote: > In response to Ivan Sergio Borgonovo : > > I've a web application. > > > > I'm logging data related to the landing page and subsequent > > selected hits. > > > > create ta

[GENERAL] pg_dump excluding tables content but not table schema

2009-12-28 Thread Ivan Sergio Borgonovo
I've some tables that are just cache. I'd like to just dump the table schema without dumping the table contend. I think I could do it in 2 steps but I'd like to avoid it. Is there a way? thanks -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-gener

Re: [GENERAL] pg_dump excluding tables content but not table schema

2009-12-28 Thread Ivan Sergio Borgonovo
On Mon, 28 Dec 2009 19:39:36 + Raymond O'Donnell wrote: > On 28/12/2009 18:41, Ivan Sergio Borgonovo wrote: > > > I'd like to just dump the table schema without dumping the table > > contend. > pg_dump -s -t My fault. I was not clear enough. I'd

Re: [GENERAL] pg_dump excluding tables content but not table schema

2009-12-31 Thread Ivan Sergio Borgonovo
On Mon, 28 Dec 2009 21:20:17 +0100 Ivan Sergio Borgonovo wrote: > pg_dump -Fc -Z9 -s -t *.cache* -d mydb > schema_only.bak > pg_dump -Fc -Z9 -T *.cache* -d mydb > nearly_full.bak > cat nearly_full.bak schema_only.bak | pg_restore -1 -d mydb > It seems it is working... I

Re: [GENERAL] Optimized Select Statement

2010-01-06 Thread Ivan Sergio Borgonovo
Is that what you were looking for? -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] how much left for restore?

2010-01-08 Thread Ivan Sergio Borgonovo
tweak in pg config to make it faster? For dev only... could I just stop the dev server, copy the *files* on flash and mount them on the notebook? thanks -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes

[GENERAL] aggregate over tables in different schema

2010-01-09 Thread Ivan Sergio Borgonovo
r than building dynamically the statement as a list of union or building up a view is there any other way? -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] R: aggregate over tables in different schema

2010-01-11 Thread Ivan Sergio Borgonovo
ore the children should have their own pk and not share them. thanks -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] how much left for restore?

2010-01-11 Thread Ivan Sergio Borgonovo
On Mon, 11 Jan 2010 12:30:45 -0500 Francisco Reyes wrote: > Ivan Sergio Borgonovo writes: > > > Is there a way to know/estimate how much is left to complete a > > restore? > > Not sure on plain ASCII files but if your pg_dump used Fc then at > restore you can pass

Re: [GENERAL] how much left for restore?

2010-01-11 Thread Ivan Sergio Borgonovo
On Mon, 11 Jan 2010 18:36:18 + Sam Mason wrote: > On Fri, Jan 08, 2010 at 11:28:15AM +0100, Ivan Sergio Borgonovo > wrote: > > Is there a way to know/estimate how much is left to complete a > > restore? > maybe something like "pv" would help? > http:

[GENERAL] OR tsquery

2010-01-16 Thread Ivan Sergio Borgonovo
7;orange' The only thing I can think of is looping on ts_lexize that looks not very efficient in plpgsql. Am I missing something? thanks -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] OR tsquery

2010-01-16 Thread Ivan Sergio Borgonovo
On Sat, 16 Jan 2010 19:10:45 +0300 (MSK) Oleg Bartunov wrote: > Ivan, > did you ever read official documentation ? > http://www.postgresql.org/docs/8.4/static/textsearch-controls.html Yes but I still can't find something that works like plainto_tsquery but with | or any example

[GENERAL] ranking how "similar" are tsvectors was: OR tsquery

2010-01-17 Thread Ivan Sergio Borgonovo
cess to elements of a tsvector will completely solve the problem since tsvectors store positions too, but it will be a step forward in making easier to compare documents to find similar ones. An operator that check the intersection of tsvectors would come handy. Adding a ts_rank(tsvector, tsvecto

Re: [GENERAL] ranking how "similar" are tsvectors was: OR tsquery

2010-01-17 Thread Ivan Sergio Borgonovo
On Sun, 17 Jan 2010 20:19:59 +0300 (MSK) Oleg Bartunov wrote: > Ivan, > > You can write function to get lexemes from tsvector: > CREATE OR REPLACE FUNCTION ts_stat(tsvector, weights text, OUT > word text, OUT ndoc integer, OUT nentry integer) > RETURNS SETOF record AS

[GENERAL] C: extending text search: from where to start

2010-01-18 Thread Ivan Sergio Borgonovo
I'd like to extend full text search so that I can transform tvectors in tquery and have direct access to a tvector as a record/array. I'm on Debian. This is my first experience with pg source code. I'd appreciate any pointer that will quickly put me on the right track. thanks

Re: [GENERAL] C: extending text search: from where to start

2010-01-20 Thread Ivan Sergio Borgonovo
On Tue, 19 Jan 2010 10:12:21 +0100 Dimitri Fontaine wrote: > Ivan Sergio Borgonovo writes: > > I'd appreciate any pointer that will quickly put me on the right > > track. > > I'd guess you begin here: > http://wiki.postgresql.org/wiki/Developer_FAQ With

[GENERAL] more docs on extending postgres in C

2010-01-20 Thread Ivan Sergio Borgonovo
onment and best practices on Debian, something that could help me to compile, install, test easily on Debian. thanks -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www

Re: [GENERAL] more docs on extending postgres in C

2010-01-20 Thread Ivan Sergio Borgonovo
On Wed, 20 Jan 2010 16:56:04 +0100 Dimitri Fontaine wrote: > Ivan Sergio Borgonovo writes: > > I haven't been able to find anything better than the online > > manual and pg source code to learn how to write extensions. > > Maybe this will help: > ht

Re: [GENERAL] more docs on extending postgres in C

2010-01-20 Thread Ivan Sergio Borgonovo
e once during the first call of the function. I grep throu contrib and I wasn't able to find anything that really enlighted me about BlessTupleDesc. I'll try to see if tomorrow things will look clearer. thanks -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-gener

Re: [GENERAL] PgSQL problem: How to split strings into rows

2010-01-21 Thread Ivan Sergio Borgonovo
; moe http://www.postgresql.org/docs/current/static/functions-array.html string_to_array select (string_to_array('tano pino gino', ' '))[i] from generate_series(1, 3) s(i); You'd get the idea... to get the length of the array you've array_length. -- Ivan Sergio Borgonov

Re: [GENERAL] more docs on extending postgres in C

2010-01-22 Thread Ivan Sergio Borgonovo
On Wed, 20 Jan 2010 17:43:27 +0100 Adrian von Bidder wrote: > On Wednesday 20 January 2010 15.42:14 Ivan Sergio Borgonovo wrote: > > I'd also appreciate some suggestion about dev environment and > > best practices on Debian, something that could help me to > > compil

Re: [GENERAL] more docs on extending postgres in C

2010-01-22 Thread Ivan Sergio Borgonovo
On Fri, 22 Jan 2010 11:02:46 -0500 Tom Lane wrote: > Ivan Sergio Borgonovo writes: > > If I had to build stuff in the pg source tree I'd just clone a > > contrib directory and change the makefile [1]. What am I > > supposed to do if I'd like to create a contrib

[GENERAL] not officially documented use of setweight??

2010-01-25 Thread Ivan Sergio Borgonovo
of this use in official postgres docs. The docs just says: setweight(vector tsvector, weight "char") returns tsvector Am I missing them? Is that use "supported" in future versions? -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing l

Re: [GENERAL] not officially documented use of setweight??

2010-01-25 Thread Ivan Sergio Borgonovo
On Mon, 25 Jan 2010 12:01:04 +0100 Ivan Sergio Borgonovo wrote: > I think I've learned how to use pg text search from Oleg and Teodor > documentation since I've found on my code this use of setweight: > > query := query && > setweight(configuration, 'ban

Re: [GENERAL] FTS uses "tsquery" directly in the query

2010-01-25 Thread Ivan Sergio Borgonovo
7;ll have to use | I expect a lot of returned rows) to make efficient use of the gin index and avoid to compute ts_rank for too many rows. Don't hold your breath waiting... but let me know if you're interested so I don't have to be the only one posting newbies questions on p

Re: [GENERAL] FTS uses "tsquery" directly in the query

2010-01-25 Thread Ivan Sergio Borgonovo
t a couple of functions that: - will return a tsvector as a weight int, pos int[], lexeme text record - will turn a tsvector + operator into a tsquery 'orange':A1,2,3 'banana':B4,5 'tomato':C6,7 -> 'orange':A | 'banana':B | 'tomato

[GENERAL] tsvector minimum match using index

2010-01-28 Thread Ivan Sergio Borgonovo
the rank for each of them. -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] is this the correct result for ts_rewrite? reducing tsquery to improve performance?

2010-01-28 Thread Ivan Sergio Borgonovo
#x27;java':ABC (1 row) test=# select 'java:A | java:B | java:C'::tsquery; tsquery ( 'java':A | 'java':B ) | 'java':C (1 row) I did try to pass them through nodetree... but the result keeps on being different. --

Re: [GENERAL] How to generate unique hash-type id?

2010-01-29 Thread Ivan Sergio Borgonovo
th something like: http://www.webthatworks.it/d1/node/page/pseudo_random_sequences_postgresql -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] reducing result set of tsvector @@ tsquery avoiding to use ts_rank

2010-02-01 Thread Ivan Sergio Borgonovo
ing on ts_rank... especially suggestions that will exploit the index. So any suggestion that could reduce the result set before filtering on rank is welcome and I'll try to put them in practice in some C functions that taken a tsvector build up a tsquery to be used to find similar do

Re: [GENERAL] Query to find list of dates between two dates

2010-02-05 Thread Ivan Sergio Borgonovo
e this select date '2008-05-01' + i from generate_series(0, (date '2009-12-10' - date '2008-05-01')) s(i); -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your sub

[GENERAL] turning a tsvector without position in a weighted tsvector

2010-02-08 Thread Ivan Sergio Borgonovo
sitions to tsvectors without positions? Is there any use-case? -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] turning a tsvector without position in a weighted tsvector

2010-02-08 Thread Ivan Sergio Borgonovo
On Mon, 8 Feb 2010 23:01:45 +0300 (MSK) Oleg Bartunov wrote: > Ivan, > > what's wrong with: > > postgres=# select 'abc:1'::tsvector; > tsvector > -- > 'abc':1 Yes you're right. I think I misplaced some quotes. But still,

Re: [GENERAL] How do I delete duplicate rows in a table?

2010-02-08 Thread Ivan Sergio Borgonovo
On Mon, 8 Feb 2010 15:32:51 -0800 "Wang, Mary Y" wrote: > Hi, > > I have a table that have that duplicate rows. How do I find them > and delete them? http://www.webthatworks.it/d1/node/page/eliminating_duplicates_place_without_oid_postgresql Most likely I've l

[GENERAL] border case ::tsvector vs. to_tsvector was turning a tsvector without position in a weighted tsvector

2010-02-09 Thread Ivan Sergio Borgonovo
meaningful positions if you'd like to assign a weight to a tsvector with no positions. I still wonder if it would be reasonable to write a function that forcefully assign a position and a weight to vectors to be used with ts_rank. I've some ideas about possible use cases but I'

[GENERAL] LIKE a set of pattern generated from a table

2010-02-09 Thread Ivan Sergio Borgonovo
7; || field2 from origin where ... union select 'constB,' || field1 || ',' || field2 from origin where ... ); -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] C function to create tsquery not working

2010-02-11 Thread Ivan Sergio Borgonovo
'java:1A,2B tano:3C,4D', '|', 'ABC', 100) -> java:AB | tano:C I've made some improvement compared to previous version I've posted but still it returns an empty tsquery. Things that works: - tsvector_tsquery_size returns reasonable total length of strings

[GENERAL] [SOLVED] C function to create tsquery not working

2010-02-12 Thread Ivan Sergio Borgonovo
On Thu, 11 Feb 2010 20:11:54 +0100 Ivan Sergio Borgonovo wrote: > I'm still having trouble making this work: > http://pgsql.privatepaste.com/14a6d3075e Finally I got it working, not the above version anyway... CREATE OR REPLACE FUNCTION tsvector_to_tsquery(IN tsv tsvector, o

[GENERAL] errmsg and multi-byte strings.

2010-02-18 Thread Ivan Sergio Borgonovo
How am I supposed to output multibyte strings in an errmsg (and Co.) as in errmsg("operator not permitted '%s'", mbstring) thanks -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes

[GENERAL] C function manipulating tsquery doesn't work with -O2

2010-02-24 Thread Ivan Sergio Borgonovo
0x00536458 in ExecProcNode () #6 0x00534337 in ExecutorRun () #7 0x005d6b2b in ?? () #8 0x005d8339 in PortalRun () #9 0x005d2de9 in ?? () #10 0x005d4624 in PostgresMain () #11 0x005a6c68 in ?? () #12 0x005a7b30 in PostmasterMain

Re: [GENERAL] C function to create tsquery not working

2010-02-25 Thread Ivan Sergio Borgonovo
On Thu, 11 Feb 2010 20:11:54 +0100 Ivan Sergio Borgonovo wrote: > I'm still having trouble making this work: > > http://pgsql.privatepaste.com/14a6d3075e I tried to play with item->operator.left to see if reshuffling the expression could make any difference. item->operat

Re: [GENERAL] C function to create tsquery not working

2010-02-26 Thread Ivan Sergio Borgonovo
k debian lenny install. I'll try to compile the debian lenny version in a new virtual machine. Meanwhile if someone could give a glimpse to the source it would be really appreciated. http://www.webthatworks.it/d1/files/ts_utilities.tar.bz2 -- Ivan Sergio Borgonovo http://www.webthatworks

[GENERAL] bug in function arguments "recognition"

2010-03-03 Thread Ivan Sergio Borgonovo
is no other function named catalog_relateditems I'm on 8.3.9 debian lenny -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] bug in function arguments "recognition"

2010-03-03 Thread Ivan Sergio Borgonovo
On Wed, 3 Mar 2010 16:05:29 +0100 Ivan Sergio Borgonovo wrote: > I've a function defined as: > > create or replace function catalog_relateditems(__itemid bigint, > families int[]... Forget about it... there was a typo (missed out) that mixed in/out parameters. Sorry for the

Re: [GENERAL] bug in function arguments "recognition"

2010-03-03 Thread Ivan Sergio Borgonovo
On Wed, 03 Mar 2010 10:22:31 -0500 Tom Lane wrote: > Ivan Sergio Borgonovo writes: > > I've a function defined as: > > create or replace function catalog_relateditems(__itemid bigint, > > families int[]... > > If you want any useful comments, you're going

[GENERAL] make available C extensions to others

2010-03-10 Thread Ivan Sergio Borgonovo
I've finished to write an extension to manipulate tsvectors and tsquery in C. I think it could be useful for someone else and I think I may take advantage at someone else looking at the code too. What would be the right place where to publish the code and how? -- Ivan Sergio Borgonovo

[GENERAL] explicit cast for null::bigint

2010-03-13 Thread Ivan Sergio Borgonovo
e text LINE 1: insert into catalog_related (itemid, related_itemid, rank) ^ HINT: You will need to rewrite or cast the expression. PostgreSQL 8.3.4 on x86_64-pc-linux-gnu -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

[GENERAL] HW and performances

2010-04-02 Thread Ivan Sergio Borgonovo
e a vserver (2.6.26-2-vserver-amd64) that looks it can handle both jobs (apache and pg) at a reasonable speed (roughly twice faster than needed) but that is still a bit slower than what I'd like on catalogue updates. -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via p

Re: [GENERAL] restore multiple tables postgres

2010-04-14 Thread Ivan Sergio Borgonovo
line of: http://www.webthatworks.it/d1/node/page/excluding_some_tables_data_backup_including_their_schema -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org

[GENERAL] function doesn't see change in search_path

2011-11-07 Thread Ivan Sergio Borgonovo
;a')" PL/pgSQL function "test_insert" line 3 at SQL statement PostgreSQL 8.3.14 what's going on? -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] function doesn't see change in search_path

2011-11-07 Thread Ivan Sergio Borgonovo
On Mon, 7 Nov 2011 19:07:29 +0100 Pavel Stehule wrote: > 2011/11/7 Ivan Sergio Borgonovo : > > On Mon, 7 Nov 2011 17:55:11 +0100 > > Pavel Stehule wrote: > > > >> Hello > >> > >> this is know bug/feature based on caching plans > > >

Re: [GENERAL] how to drop function?

2011-11-15 Thread Ivan Sergio Borgonovo
urn true; END; $$ LANGUAGE plpgsql; drop function process_table ( action TEXT, v_table_name varchar(100) ); commit; BEGIN CREATE FUNCTION DROP FUNCTION COMMIT test=# Repeat just the input parameters. -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mai

Re: [GENERAL] how to drop function?

2011-11-16 Thread Ivan Sergio Borgonovo
t you wrote to make it succede. What does it mean "get hung on the comma and extra set of parenthesis"? ivan@dawn:~$ psql -h lan test -c 'drop function process_table (action TEXT, v_table_name varchar(100));' DROP FUNCTION ivan@dawn:~$ the psql command all on the same line

Re: [GENERAL] how to drop function?

2011-11-16 Thread Ivan Sergio Borgonovo
On Wed, 16 Nov 2011 09:17:45 +0100 Thomas Kellerer wrote: > Ivan Sergio Borgonovo, 16.11.2011 01:01: > > test=# begin; > > create or replace function process_table ( > > action TEXT, v_table_name varchar(100) > > ) RETURNS BOOLEAN > > AS $$ > > DE

[GENERAL] fsync default setting and version

2012-03-12 Thread Ivan Sergio Borgonovo
Where can I check in which version the default setting for fsync was changed? thanks -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql

[GENERAL] create table as vs. create table like

2008-12-12 Thread Ivan Sergio Borgonovo
I just noticed something I found "unexpected". CREATE TABLE LIKE let you specify DEFAULT and Co. CREATE TABLE AS doesn't. Is there a one step way to clone a table? -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@pos

Re: [GENERAL] create table as vs. create table like

2008-12-12 Thread Ivan Sergio Borgonovo
On Fri, 12 Dec 2008 13:25:07 +0100 "A. Kretschmer" wrote: > In response to Ivan Sergio Borgonovo : > > I just noticed something I found "unexpected". > > > > CREATE TABLE LIKE let you specify DEFAULT and Co. > > CREATE TABLE AS doesn'

[GENERAL] from 2 keys to serial

2008-12-14 Thread Ivan Sergio Borgonovo
#x27;d bet that the problem of transforming 2 keys into a serial is pretty common and I'm asking for any alternative more elegant way than the above. thanks -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql

[SOLVED] Re: [GENERAL] from 2 keys to serial

2008-12-15 Thread Ivan Sergio Borgonovo
On Sun, 14 Dec 2008 20:16:35 +0100 Ivan Sergio Borgonovo wrote: The cleanest solution I was able to find was to redefine the addresses_temp table so that it uses the same sequence as the _dest table. Some general design advices would be still welcome. > I've to import something whos

[GENERAL] design & available tricks: traversing heterogeneous tree (table-level + linked list)

2008-12-22 Thread Ivan Sergio Borgonovo
e future. So a nested set (mptt) to represent the hierarchy may not be optimal and wring a safe and *fast* import function may not be trivial. I was wondering if there is some cool feature or cool contrib (8.3) that could make the choice much easier to take or just some suggestion. tha

Re: [GENERAL] How to Import Excel Into PostgreSQL database

2008-12-24 Thread Ivan Sergio Borgonovo
le. If this doesn't come to a satisfactory end [1] you may try with odbc/dblink. [1] a) you may need to do it programmatically without manually opening the excel sheet and pressing buttons b) you may discover they dropped proper csv export between releases as it happened to me moving from MS S

[GENERAL] return query and function result type must be real because of OUT parameters

2008-12-24 Thread Ivan Sergio Borgonovo
and I get ERROR: function result type must be real because of OUT parameters ** Error ** ERROR: function result type must be real because of OUT parameters SQL state: 42P13 same with text etc... -- Ivan Sergio Borgonovo http://www.webthatworks.it -- Sent via pgsql-general ma

[GENERAL] count (DISTINCT expression [ , ... ] ) and documentation

2008-12-26 Thread Ivan Sergio Borgonovo
expression) Still I'm using 8.3 and select count(distinct c1, c2) from table1; report: No function matches the given name and argument types. You might need to add explicit type casts. What should I write in spite of? select count(distinct c1, c2) from table1; -- Ivan Sergio Borgonovo

Re: [GENERAL] count (DISTINCT expression [ , ... ] ) and documentation

2008-12-26 Thread Ivan Sergio Borgonovo
st values(1,0); insert into test.dist values(1,0); insert into test.dist values(1,1); insert into test.dist values(0,0); select count(*) from (select distinct a,b from test.dist ) a; but still I can't think of anything that would work with aggregate(distinct a,b) not just count. -- Ivan Ser

<    1   2   3   4   5   6   7   8   >