Re: [GENERAL] Transparent i18n?

2005-07-02 Thread Greg Stark
David Pratt [EMAIL PROTECTED] writes: It was suggested that I look at an array. I think that was me. I tried not to say there's only one way to do it. Only that I chose to go this way and I think it has worked a lot better for me. Having the text right there in the column saves a *lot* of

Re: [GENERAL] Transparent i18n?

2005-07-02 Thread Karsten Hilbert
SELECT language_text[1][1] AS language_code, language[1][2] AS text FROM language_text; They way we do that in GNUmed: select lookup_val, _(lookup_val) from lookup_table where ...; If you want to know how see here:

[GENERAL] returning multiple records - URGENT

2005-07-02 Thread Ramapriya N
HELLO, How to retrieve the 1 row as well as multiple rows from a table using functions. Is there any data type that returns entire row. I tried cursors, but the problem is when i try to run this function from java it returns only the first row. Please HELP ME! bye ram

[GENERAL] wrong sort order

2005-07-02 Thread Alejandro D. Burne
Hi, maybe there is a problem with sorting latin10? Seems to be like spaces don't exists just sorting. Version() -PostgreSQL 8.0.2 on i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3) SELECT nombreasociado, codigoasociado FROM Asociados WHERE nombreasociado

Re: [GENERAL] Get Query in Statement Level Trigger?

2005-07-02 Thread Derry Bryson
--- Michael Fuhr [EMAIL PROTECTED] wrote: On Thu, Jun 30, 2005 at 10:56:21AM -0700, Derry Bryson wrote: Is it possible to get the text of the query that caused the trigger within a statement level trigger? Not as far as I know -- somebody please correct me if I'm mistaken.

Re: [GENERAL] wrong sort order

2005-07-02 Thread Tom Lane
Alejandro D. Burne [EMAIL PROTECTED] writes: Hi, maybe there is a problem with sorting latin10? Seems to be like spaces don't exists just sorting. The guys who write the locale specifications think that's a feature, not a bug ;-) If you don't want it, either use C locale or create your own

Re: [GENERAL] wrong sort order

2005-07-02 Thread Alejandro D. Burne
Maybe I'm wrong, but this feature I don't see it in any other rdbms ;-) 2005/7/2, Tom Lane [EMAIL PROTECTED]: Alejandro D. Burne [EMAIL PROTECTED] writes: Hi, maybe there is a problem with sorting latin10? Seems to be like spaces don't exists just sorting. The guys who write the locale

Re: [GENERAL] wrong sort order

2005-07-02 Thread Martijn van Oosterhout
On Sat, Jul 02, 2005 at 11:28:12AM -0300, Alejandro D. Burne wrote: Hi, maybe there is a problem with sorting latin10? Seems to be like spaces don't exists just sorting. It's not the encoding, it's the locale. For example, the en_US sorts in dictionary order (ignore spaces and case). Hope this

Re: [GENERAL] How to uninstall PostGreSql from linux

2005-07-02 Thread Stephane Bortzmeyer
On Fri, Jul 01, 2005 at 06:09:37PM +0530, Ajay Dalvi [EMAIL PROTECTED] wrote a message of 14 lines which said: Please tell me the procedure to uninstall PostGreSql You did not indicate the operating system, just its kernel (Linux). If the operating system is Debian: apt-get remove

[GENERAL] Which record causes referential integrity violation on delete

2005-07-02 Thread Andrus
In Postgres 8 I tried commad DELETE FROM customer WHERE id=123 but got an error ERROR: update or delete on customer violates foreign key constraint invoice_customer_fkey on invoice' How to determine the primary key of invoice table which causes this error in generic way ? Why Postgres does

Re: [GENERAL] Hot to restrict access to subset of data

2005-07-02 Thread Gregory Youngblood
I believe you can probably use views to accomplish this. You create a view that is populated based on their username. Then you remove access to the actual table, and grant access to the view. When people look at the table, they will only see the data in the view and will not have access to

Re: [GENERAL] Hot to restrict access to subset of data

2005-07-02 Thread Andrus
Michael Fuhr [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Fri, Jul 01, 2005 at 01:56:41PM +0300, Andrus wrote: I want to restrict access to this table based on the user name, document type and access level. I have 3 levels: no access, view only, modify access. Example:

Re: [GENERAL] Which record causes referential integrity violation on delete

2005-07-02 Thread Tom Lane
Andrus [EMAIL PROTECTED] writes: ERROR: update or delete on customer violates foreign key constraint invoice_customer_fkey on invoice' How to determine the primary key of invoice table which causes this error in generic way ? There is no generic way to do that, because the question makes

Re: [GENERAL] Advice on structure /sequence / trigger

2005-07-02 Thread Greg Stark
David Pratt [EMAIL PROTECTED] writes: Hi Greg. Sorry for getting back to you so late on this. I think your idea on the design is spot on since it will give me referential integrity with my other and the multi-language will just be a simple two field table with id and multi-dimensional

Re: [GENERAL] Which record causes referential integrity violation on delete

2005-07-02 Thread Dawid Kuroczko
On 7/1/05, Andrus [EMAIL PROTECTED] wrote: In Postgres 8 I tried commad DELETE FROM customer WHERE id=123 but got an error ERROR: update or delete on customer violates foreign key constraint invoice_customer_fkey on invoice' How to determine the primary key of invoice table which

Re: [GENERAL] Which record causes referential integrity violation on delete

2005-07-02 Thread Dawid Kuroczko
On 7/2/05, Dawid Kuroczko [EMAIL PROTECTED] wrote: On 7/1/05, Andrus [EMAIL PROTECTED] wrote: In Postgres 8 I tried commad DELETE FROM customer WHERE id=123 but got an error ERROR: update or delete on customer violates foreign key constraint invoice_customer_fkey on invoice'

Re: [GENERAL] Hot to restrict access to subset of data

2005-07-02 Thread Michael Fuhr
On Fri, Jul 01, 2005 at 09:43:34PM +0300, Andrus wrote: My application connects to Postgres always as superuser, using user name postgres. Postgres server as only one user. Does the application really need superuser privileges or is that just a convenience? It's usually a good idea to

Re: [GENERAL] Transparent i18n?

2005-07-02 Thread David Pratt
Many thanks Karsten for some insight into how you are handling this. Regards, David On Saturday, July 2, 2005, at 06:08 AM, Karsten Hilbert wrote: SELECT language_text[1][1] AS language_code, language[1][2] AS text FROM language_text; They way we do that in GNUmed: select lookup_val,

Re: [GENERAL] Transparent i18n?

2005-07-02 Thread David Pratt
Hi Greg. Well I'm kind of half way but I think what I am doing could work out. I have an iso_languages table, a languages table for languages used and a multi_language table for storing values of my text fields. I choose my language from iso_languages. Any table that needs a

Re: [GENERAL] Which record causes referential integrity violation on delete

2005-07-02 Thread Martin Boese
On Friday 01 July 2005 19:49, you wrote: In Postgres 8 I tried commad DELETE FROM customer WHERE id=123 (snip) ---(end of broadcast)--- TIP 8: explain analyze is your friend Automatically answered?! :-) explain analyze DELETE FROM customer

[GENERAL] plpythonu and bytea

2005-07-02 Thread Greg Steffensen
Hey, I'm trying to write some plpython procedures that read binary data from images on the disk and store it in bytea fields. I'm basically trying to write a plpython procedure that accepts a varchar and returns a bytea, with these procedure contents: data = ""> return data (The actual procedure