[GENERAL] tsearch2 index missing

2007-02-17 Thread Toby Tremayne
I'm using tsearch 2 - added a column named vectors to a table, updated it according to the documentation, created an index. So far it's all worked fine. Problem is I decided to include a new column in the contents of vectors, so I added the column, deleted my index, re-updated the vector

Re: [GENERAL] Addons

2007-02-17 Thread Joshua D. Drake
David Legault wrote: > I can't seem to be able to change/add builtin contrib items using the > installer after it's been installed already. Is there another way to access > those modules and install them manually ? There will be installer scripts in $PGDATA/share/ It sounds like you are running W

Re: [GENERAL] Addons

2007-02-17 Thread David Legault
I can't seem to be able to change/add builtin contrib items using the installer after it's been installed already. Is there another way to access those modules and install them manually ? Thanks On 2/17/07, Joshua D. Drake <[EMAIL PROTECTED]> wrote: David Legault wrote: > Hello, > > I can't fi

Re: [GENERAL] Problem with index not always being used

2007-02-17 Thread Rob Tester
Thanks for the thoughts, certainly I will look into what you have explained. However, the behavior that you expressed isn't what is occuring. In the 12, 16 example 12 does have more rows than 16. However, there are many cases when this isn't true, that is other states have more rows than 12 and th

[GENERAL] CodeGear working on a new DB access layer for Delphi, but.....

2007-02-17 Thread Tony Caduto
It seems they are not going to include support for PostgreSQL (just the "big" 4), which would be a big mistake if you ask me. Here is the link to the lead developer's blog who is working on this new technology http://blogs.codegear.com/SteveShaughnessy/archive/2007/02/16/31865.aspx?Pending=tr

Re: [GENERAL] user input during runtime

2007-02-17 Thread Joshua D. Drake
Bruce Momjian wrote: > Magnus Hagander wrote: >> Win32 will deal with the backticks Ok, but not the read && echo part. >> You can set it to the output of a variable, for example >> \set x `echo foo` >> >> but I haven't been able to trick it into actually reading something. One >> would think someth

Re: [GENERAL] user input during runtime

2007-02-17 Thread Bruce Momjian
Magnus Hagander wrote: > Win32 will deal with the backticks Ok, but not the read && echo part. > You can set it to the output of a variable, for example > \set x `echo foo` > > but I haven't been able to trick it into actually reading something. One > would think something like: > \set x `set /p Z

Re: [GENERAL] Small request re error message

2007-02-17 Thread Bruce Momjian
Scott Ribe wrote: > > Oh. Yea, I can see that, but even if the endian-ness is the same, it > > still might not work. Even a different compiler flag will cause a > > failure to run properly. > > Sure. You can't flag every possible error. But my Intel & PPC Macs look > identical, and I compile wit

[GENERAL] User-interfaces with transaction support

2007-02-17 Thread Anastasios Hatzis
Hello, I'm looking for a UI concept for my model-driven development tool which works with Python and PostgreSQL, and a thin ORM layer between. On the application and database layer it supports transactions (just wrapped the PostgreSQL features). Now I want to add also UI support to the proto

Re: [GENERAL] Problem with index not always being used

2007-02-17 Thread Tom Lane
"Rob Tester" <[EMAIL PROTECTED]> writes: > SELECT * FROM STUFF WHERE state=12; --causes a seq scan of the table > where > SELECT * FROM STUFF WHERE state=16 --Uses the index. This behavior is intended and appropriate, if there are lots of rows with state=12 and not many with state=16. As an ex

Re: [GENERAL] requests / suggestions to help with backups

2007-02-17 Thread Bruno Wolff III
On Thu, Feb 15, 2007 at 22:39:13 -0500, Lou Duchez <[EMAIL PROTECTED]> wrote: > > 1) "grant select on database ..." or, hypothetically, "grant select on > cluster". The goal would be to create a read-only PostgreSQL user, one > who can read the contents of an entire database (or even the entire

Re: [GENERAL] Help with an index and the optimizer

2007-02-17 Thread Rob Tester
I am using pg 8.1.4, I have a table with 1.1 million rows of data (see below for table definition). One field state is numeric and has an index. The index is not always picked up when searching the table by state only and I can't figure out why. So: SELECT * FROM STUFF WHERE state=12; --causes

Re: [GENERAL] Problem with index not always being used

2007-02-17 Thread Rob Tester
I am using pg 8.1.4, I have a table with 1.1 million rows of data (see below for table definition). One field state is numeric and has an index. The index is not always picked up when searching the table by state only and I can't figure out why. So: SELECT * FROM STUFF WHERE state=12; --causes

Re: [GENERAL] [ANNOUNCE] Advisory on possibly insecure security definer functions

2007-02-17 Thread Michael Fuhr
On Sat, Feb 17, 2007 at 03:15:25PM +0100, Karsten Hilbert wrote: > On Sat, Feb 17, 2007 at 01:26:34PM +0900, Tatsuo Ishii wrote: > > But if we insert a set schema search_path command in an SQL function, > > the caller will be affected by it. Doing reset search_path before > > returning to caller mi

Re: [GENERAL] How would you handle updating an item and related stuff all at once?

2007-02-17 Thread Walter Vaughan
Rick Schumeyer wrote: Completely off topic, (but not worth a separate post) I have been forced to use a little bit of mysql lately...did you know that if you use transaction and foreign key syntax with myisam tables, it does not complain...it just silently ignores your requests for transaction

Re: [GENERAL] Addons

2007-02-17 Thread Joshua D. Drake
David Legault wrote: > Hello, > > I can't find a list of addons on the website. I'd like to view the list of > addons like pgcrypto and download/install some of them into my installation > so I can use some of the functions. There is www.pgfoundry.org and there is the built in contrib. The built

Re: [GENERAL] How do I use returning in a view?

2007-02-17 Thread Tom Lane
"Karen Hill" <[EMAIL PROTECTED]> writes: > I have an updateable view (using rules) that I'm trying to improve by > using 8.2's RETURNING feature to place the result of one insert into > the next. That's not what it's for. RETURNING in an insert rule is to define what to return if someone does an

Re: [GENERAL] user input during runtime

2007-02-17 Thread Magnus Hagander
David Fetter wrote: > On Fri, Feb 16, 2007 at 08:23:48PM -0500, Bruce Momjian wrote: >> Ashish Karalkar wrote: >>> Hello All, >>> I want to prompt user to input some value and do some action on that value >>> in runtime of a sql script. >>> Is there any psql command to do this ?? >>> I can use \ec

Re: [GENERAL] user input during runtime

2007-02-17 Thread David Fetter
On Fri, Feb 16, 2007 at 08:23:48PM -0500, Bruce Momjian wrote: > Ashish Karalkar wrote: > > Hello All, > > I want to prompt user to input some value and do some action on that value > > in runtime of a sql script. > > Is there any psql command to do this ?? > > I can use \echo do display massage

[GENERAL] Addons

2007-02-17 Thread David Legault
Hello, I can't find a list of addons on the website. I'd like to view the list of addons like pgcrypto and download/install some of them into my installation so I can use some of the functions. And is there any advanced docs on the PL/PGSQL language like how to manipulate strings (string replace

Re: [GENERAL] Anticipatory privileges

2007-02-17 Thread John D. Burger
Tom Lane wrote: How dangerous is it to UPDATE pg_class directly, perhaps copying the relacl column for a table that I've done by hand with GRANT. You can do it, and it will seem to work. However, unless you also make entries in pg_shdepend, bad things will happen if you later drop any of

Re: [GENERAL] Small request re error message

2007-02-17 Thread Scott Ribe
> Oh. Yea, I can see that, but even if the endian-ness is the same, it > still might not work. Even a different compiler flag will cause a > failure to run properly. Sure. You can't flag every possible error. But my Intel & PPC Macs look identical, and I compile with identical flags. So it would

[GENERAL] How do I use returning in a view?

2007-02-17 Thread Karen Hill
CREATE RULE ins_productionlog AS ON INSERT TO vwProductionlog DO INSTEAD ( INSERT INTO PRODUCTIONLOG (machine_name,product_serial_id,production_time,product_number,id) VALUES (new.machine_name, new.product_serial_id, new.production_time,new.product_number, DEFAULT) RETURNING productionlog

Re: [GENERAL] Anticipatory privileges

2007-02-17 Thread Tom Lane
"John D. Burger" <[EMAIL PROTECTED]> writes: > How dangerous is it to UPDATE pg_class > directly, perhaps copying the relacl column for a table that I've > done by hand with GRANT. You can do it, and it will seem to work. However, unless you also make entries in pg_shdepend, bad things will h

Re: [GENERAL] Anticipatory privileges

2007-02-17 Thread John D. Burger
Alvaro Herrera wrote: If I am reading the (7.4) docs correctly, privileges can be granted only with respect to tables that exist at the time the GRANT command is given Yes. In fact, I have to individually grant access to each table, and any associated sequences, yes? How dangerous is it

Re: [GENERAL] Cast record as text SOLVED

2007-02-17 Thread Mikko Partio
Mikko Partio wrote: I agree that the ability to restore changes is quite nice, but my primary goal is to record changes from many tables into one table, and I think tablelog does not offer that. Do you know any way of casting a record to text, or perhaps a different way altogether to audit to

Re: [GENERAL] pg_tablespace.spcacl

2007-02-17 Thread Alvaro Herrera
Alexi Gen wrote: > Hello, > > pg_tablespace contains information about all the tablespaces available on > the system. > The [spcacl] column for a particular record - contains a string value of > the names of users that have permissions on the tablespace. > I'm looking for any info as to why this

Re: [GENERAL] [ANNOUNCE] Advisory on possibly insecure security definer functions

2007-02-17 Thread Karsten Hilbert
On Sat, Feb 17, 2007 at 01:26:34PM +0900, Tatsuo Ishii wrote: > But if we insert a set schema search_path command in an SQL function, > the caller will be affected by it. Doing reset search_path before > returning to caller might solve some of problems, but it will not > recover caller's special s

[GENERAL] pg_tablespace.spcacl

2007-02-17 Thread Alexi Gen
Hello, pg_tablespace contains information about all the tablespaces available on the system. The [spcacl] column for a particular record - contains a string value of the names of users that have permissions on the tablespace. I'm looking for any info as to why this approach was taken? Can some

Re: [GENERAL] Cast record as text

2007-02-17 Thread Mikko Partio
A. Kretschmer wrote: My original idea was to log changes from different tables to one audit table, and I think tablelog uses separate audit tables for each monitored table? Yes, but with tablelog it is possible to restore any changes, you can restore a table. A blog-entry from Andreas Sch

Re: [GENERAL] Problem writing sql statement....

2007-02-17 Thread Bjørn T Johansen
These seems to work, thx... :) BTJ On Fri, 16 Feb 2007 09:23:44 -0600 "Adam Rich" <[EMAIL PROTECTED]> wrote: > > Or, if you need the whole row: > > SELECT at1.* FROM a_table as at1 > WHERE EXISTS ( > SELECT 1 FROM a_table as at2 > WHERE at2.my_date = at1.my_date > AND at2.prod_id = at1.p