Re: [SQL] dynamically loaded functions

2005-07-12 Thread Michael Fuhr
On Mon, Jul 11, 2005 at 08:16:17PM -0700, TJ O'Donnell wrote: > > CREATE or REPLACE FUNCTION cansmiles(varchar) RETURNS varchar >AS 'gnova', 'oe_cansmiles' LANGUAGE 'c' IMMUTABLE STRICT; > requires preloading of oe_chem.so to work. > > Is there any way I can associate oe_cansmiles with 2 .so's

[SQL] dynamically loaded functions

2005-07-12 Thread TJ O'Donnell
I've written some c-functions which depend on my code (gnova.so) as well as a third-party library of functions (oe_chem.so). Up until now, I've been preloading (in postgresql.conf) both .so's and it all works fine. To make it easier for my users to install my stuff, I'd like to avoid the preloadi

[SQL] How to store and retrieve data with special characters (\n, \r, \f, \t) in the same format

2005-07-12 Thread Dinesh Pandey
How to store and retrieve data with special characters (\n, \r, \f, \t) in the same format, because while storing \f treats data in strange way.   Example: ‘This is sample data \n \root\files.txt, \root\text.txt’   Sol: One way replaces \ with \\   Thanks Dinesh

Re: [SQL] Copy user privileges

2005-07-12 Thread Michael Fuhr
On Tue, Jul 12, 2005 at 03:12:50PM -0400, Tom Lane wrote: > "Graham Vickrage" <[EMAIL PROTECTED]> writes: > > I want to keep all the privileges but assign them to a new user. > > > What is the best way of doing this? > > How about just renaming the old user to a new name? > > I don't think we h

Re: [SQL] Copy user privileges

2005-07-12 Thread Tom Lane
"Graham Vickrage" <[EMAIL PROTECTED]> writes: > I want to keep all the privileges but assign them to a new user. > What is the best way of doing this? How about just renaming the old user to a new name? I don't think we have an ALTER command for that, but an UPDATE on pg_shadow would get the jo

Re: [SQL] PostgreSQL - ERROR: Cannot cast type character varying to

2005-07-12 Thread Christoph Haller
Under PostgreSQL 7.3 it was necessary to use an intermediate cast to text when converting from varchar to int4. sum( unidades::text::int4 ) should do. Regards, Christoph Mauricio Fernandez wrote: > > Hello I´m new in the list, and I want to learn a lot about postgresql, now > I´m working i

Re: [SQL] PostgreSQL - ERROR: Cannot cast type character varying to integer

2005-07-12 Thread Mauricio Fernandez
thanks for the answer. i get it too as sum(int4(unidades::text)) Maybe somebody will need this answer too, so i want to add some info I get from other list: We can know wich CAST we have in our DB with this view: create view showcasts as select t.typname as source, t1.typname as target, p

[SQL] Copy user privileges

2005-07-12 Thread Graham Vickrage
Hi All, I have dumped a database with no data and restored it with a new db name. I want to keep all the privileges but assign them to a new user. What is the best way of doing this? Is it to alter the system tables directly in which case which ones. TIA, Graham ---(