[GENERAL] OR tsquery

2010-01-16 Thread Ivan Sergio Borgonovo
to_tsquery and plainto_tsquery produce AND tsquery 'apple banana orange' - 'apple' 'banana' 'orange' I can't see anything that will produce OR tsquery. 'apple banana orange' - 'apple' | 'banana' | 'orange' The only thing I can think of is looping on ts_lexize that looks not very efficient in

Re: [GENERAL] OR tsquery

2010-01-16 Thread Tom Lane
Ivan Sergio Borgonovo m...@webthatworks.it writes: to_tsquery and plainto_tsquery produce AND tsquery 'apple banana orange' - 'apple' 'banana' 'orange' Only the latter. Try to_tsquery again: regression=# select to_tsquery('foo bar'); ERROR: syntax error in tsquery: foo bar regression=#

Re: [GENERAL] OR tsquery

2010-01-16 Thread Oleg Bartunov
Ivan, did you ever read official documentation ? http://www.postgresql.org/docs/8.4/static/textsearch-controls.html Oleg On Sat, 16 Jan 2010, Ivan Sergio Borgonovo wrote: to_tsquery and plainto_tsquery produce AND tsquery 'apple banana orange' - 'apple' 'banana' 'orange' I can't see

Re: [GENERAL] Avoid transaction abot if/when constraint violated

2010-01-16 Thread Dimitri Fontaine
Gauthier, Dave dave.gauth...@intel.com writes: I have a long list of records I want to insert into a table in such a way as I can trap and report any/all constraint violations before rolling back (or opting to commit). Unfortunately, after I hit the first constraint violation, it aborts the

[GENERAL] Constraint exclusion issue

2010-01-16 Thread Mathieu De Zutter
Hi, I'm trying to make constraint exclusion work correctly in a query with only one parameter, but I have some issues. Please have a look at the scenario below and tell me how I can improve it. Thanks! -- I create an inheritance relationship with a check constraint in the child shs-dev=#

Re: [GENERAL] Constraint exclusion issue

2010-01-16 Thread Scott Marlowe
On Sat, Jan 16, 2010 at 11:02 AM, Mathieu De Zutter math...@dezutter.org wrote: Hi, I'm trying to make constraint exclusion work correctly in a query with only one parameter, but I have some issues. Please have a look at the scenario below and tell me how I can improve it. Thanks! -- I

[GENERAL] SELECT is causing a runtime error when used in stored functions: State=42601, Err=7, Msg=ERROR: query has no destination for result data;

2010-01-16 Thread Lothar Bongartz
It would be great, if you give me a hint on a problem I am having. When I am using SELECT in a prepared function called through ODBC / C++ interface, I am getting a runtime Error: State=42601, Err=7, Msg=ERROR: query has no destination for result data; Example: CREATE OR REPLACE

Re: [GENERAL] SELECT is causing a runtime error when used in stored functions: State=42601, Err=7, Msg=ERROR: query has no destination for result data;

2010-01-16 Thread Raymond O'Donnell
On 16/01/2010 13:47, Lothar Bongartz wrote: State=42601, Err=7, Msg=ERROR: query has no destination for result data; Example: CREATE OR REPLACE FUNCTION MyTest ( IN OUT v_1 int ) AS $$BEGIN SELECT v_1 = 1; END;$$ LANGUAGE plpgsql The error message says it all - in

Re: [GENERAL] Constraint exclusion issue

2010-01-16 Thread Mathieu De Zutter
On Sat, Jan 16, 2010 at 7:26 PM, Scott Marlowe scott.marl...@gmail.com wrote: On Sat, Jan 16, 2010 at 11:02 AM, Mathieu De Zutter math...@dezutter.org wrote: shs-dev=# explain select * from parent where (c,n) = '(b,0)'; ERROR:  input of anonymous composite types is not implemented Shouldn't

Re: [GENERAL] OR tsquery

2010-01-16 Thread Ivan Sergio Borgonovo
On Sat, 16 Jan 2010 19:10:45 +0300 (MSK) Oleg Bartunov o...@sai.msu.su 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

Re: [GENERAL] Collate order on Mac OS X, text with diacritics in UTF-8

2010-01-16 Thread Greg Stark
On Thu, Jan 14, 2010 at 6:15 AM, Craig Ringer cr...@postnewspapers.com.au wrote: Out of interest: Why not? There's plenty of discussion in the archives about it, but basically ICU would represent a pretty enormous dependency and would lock us in to having no other backend encoding but UTF8.

[GENERAL] Trouble connecting to database using PQconnectdb (C/libpq)

2010-01-16 Thread Joel Alpers
Hello - I am working on moving my WEB pages, which include searches in a PostgreSQL data base, through libpq. Old system: Red Hat Linux 9, PostgreSQL 7.4.6 New system: Fedora 11, PostgreSQL 8.4 When I re-compile the program (using updated gnu C++ compilers/libs), the new version --will--

Re: [GENERAL] Trouble connecting to database using PQconnectdb (C/libpq)

2010-01-16 Thread Tom Lane
Joel Alpers j...@jkalpers.com writes: New system: Fedora 11, PostgreSQL 8.4 Fedora 11 enables selinux by default ... *** Error - Can't connect to database photodb - could not connect to server: Permission denied Is the server running on host 192.168.111.7 and accepting TCP/IP

[GENERAL] Read only column ?

2010-01-16 Thread Gauthier, Dave
Is there a way to set a column to be read only? I have a table with several columns with values that are determined by triggers. I want users to be able to view, but never edit them. Thanks

Re: [GENERAL] Read only column ?

2010-01-16 Thread Tom Lane
Gauthier, Dave dave.gauth...@intel.com writes: Is there a way to set a column to be read only? As of 8.4 you could revoke insert/update permissions column-by-column ... I have a table with several columns with values that are determined by triggers. I want users to be able to view, but

Re: [GENERAL] Read only column ?

2010-01-16 Thread Gauthier, Dave
.. although, if you have triggers forcibly setting the columns, it hardly matters what the users try to put into them, no? U. We I guess you have a point there :-) Still, it would be nicer for the DB to tell them DON'T TOUCH THAT as opposed to a trigger silently overriding

Re: [GENERAL] Read only column ?

2010-01-16 Thread Tom Lane
Gauthier, Dave dave.gauth...@intel.com writes: .. although, if you have triggers forcibly setting the columns, it hardly matters what the users try to put into them, no? U. We I guess you have a point there :-) Still, it would be nicer for the DB to tell them DON'T TOUCH

Re: [GENERAL] Read only column ?

2010-01-16 Thread John R Pierce
Tom Lane wrote: Well, you could have the triggers throw errors instead of being silent about it. otoh, do you really want trigger code checking for permissions? ugh. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] Read only column ?

2010-01-16 Thread Gauthier, Dave
Triggers,throw errors? I didn't know they could do that. Other than via raise notice, how is this done? Could I capture such an error programatically (e.g. in perl/DBI)? -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Saturday, January 16, 2010 9:12 PM To:

Re: [GENERAL] Read only column ?

2010-01-16 Thread Gauthier, Dave
otoh, do you really want trigger code checking for permissions? ugh. Not really. I'd rather this be cought before it made it that far. I'll have to read the 8.4 release notes ! -Original Message- From: John R Pierce [mailto:pie...@hogranch.com] Sent: Saturday, January 16, 2010 9:18

Re: [GENERAL] Read only column ?

2010-01-16 Thread Tom Lane
Gauthier, Dave dave.gauth...@intel.com writes: Triggers,throw errors? I didn't know they could do that. Other than via raise notice, how is this done? Could I capture such an error programatically (e.g. in perl/DBI)? RAISE can do more than just notices ...

Re: [GENERAL] Trouble connecting to database using PQconnectdb (C/libpq)

2010-01-16 Thread Joel Alpers
Tom Lane wrote: Joel Alpers j...@jkalpers.com writes: New system: Fedora 11, PostgreSQL 8.4 Fedora 11 enables selinux by default ... *** Error - Can't connect to database photodb - could not connect to server: Permission denied Is the server running on host

Re: [GENERAL] Trouble connecting to database using PQconnectdb (C/libpq)

2010-01-16 Thread John R Pierce
Now the trick will be to find a way to make them play well together -- I'll check the postgres site where they have discussions archived... you'll probably get more help from a selinux site or list. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes

Re: [GENERAL] Trouble connecting to database using PQconnectdb (C/libpq)

2010-01-16 Thread Joel Alpers
John R Pierce wrote: Now the trick will be to find a way to make them play well together -- I'll check the postgres site where they have discussions archived... you'll probably get more help from a selinux site or list. Yes, after I sent that reply I recalled that I was --on-- a

Re: [GENERAL] Read only column ?

2010-01-16 Thread Craig Ringer
On 17/01/2010 10:18 AM, John R Pierce wrote: Tom Lane wrote: Well, you could have the triggers throw errors instead of being silent about it. otoh, do you really want trigger code checking for permissions? ugh. Before column permissions, it was all you could do :-( I'm LOVING col

[GENERAL] large string storage in Postgresql

2010-01-16 Thread AI Rumman
Hello all, I have to store 2 GB text in the database. Previously I was using Oracle database with CLOB data type. Could anyone please tell me how can I do it in Postgresql 8.0 or later?

Re: [GENERAL] large string storage in Postgresql

2010-01-16 Thread Craig Ringer
On 17/01/2010 1:51 PM, AI Rumman wrote: Hello all, I have to store 2 GB text in the database. Previously I was using Oracle database with CLOB data type. Do you mean individual text objects that are 2GB or larger each? Or do you mean you have a bunch of smaller (how big?) text objects that

Re: [GENERAL] large string storage in Postgresql

2010-01-16 Thread AI Rumman
I have an individual text string of 2 GB. I may use Postgresql 8.4 also. But what data type should I use to store this column value of 2GB? On Sun, Jan 17, 2010 at 12:08 PM, Craig Ringer cr...@postnewspapers.com.auwrote: On 17/01/2010 1:51 PM, AI Rumman wrote: Hello all, I have to store 2 GB

Re: [GENERAL] large string storage in Postgresql

2010-01-16 Thread Craig Ringer
On 17/01/2010 2:13 PM, AI Rumman wrote: I have an individual text string of 2 GB. OK. And what sorts of things do you do with that text in your current database? What queries do you do on it? Do you just need to read it? Update it? Update only selected parts of it? Search for text strings

Re: [GENERAL] large string storage in Postgresql

2010-01-16 Thread John R Pierce
AI Rumman wrote: I have an individual text string of 2 GB. I may use Postgresql 8.4 also. But what data type should I use to store this column value of 2GB? GB data objects ni a database is going to make backups, maintenance, etc a real pain normal data in postgres can not be over 1GB, so

Re: [GENERAL] large string storage in Postgresql

2010-01-16 Thread John R Pierce
Craig Ringer wrote: In any case, for objects 2GB you don't really have much choice except to use PostgreSQL's large object features. See: I thought LO were limited to = 2GB ? TOAST can handle up to 1GB. 2GB and you'll need to break it up into several LOs. -- Sent via pgsql-general

[GENERAL] pg_database_size

2010-01-16 Thread AI Rumman
What does pg_database_size resturs? Bytes or KB? Please tell.

Re: [GENERAL] pg_database_size

2010-01-16 Thread John R Pierce
AI Rumman wrote: What does pg_database_size resturs? Bytes or KB? those functions all return size in bytes. you can use pg_size_pretty(pg_database_size('dbname')) to pretty print it as MB or whatever is most appropriate. -- Sent via pgsql-general mailing list