[SQL] linux. ossp-uuid

2010-12-21 Thread Николай Ижиков
Hi, guys.

I have linux server. Package uuid installed

I build and install postgresql from source with --with-ossp-uuid flag.

After installation I try to execute:

===
create or replace function uuid_generate_v1() returns uuid as
'$libdir/uuid-ossp', 'uuid_generate_v1' volatile strict language C
===

and got error

"could not load libraty /usr/lib/postgresql/uuid-ossp.so":
/usr/lib/postgresql/uuid-ossp.so: undefined symbol: uuid_error"

How I can fix it?


-- 
С уважением, Николай Ижиков
[email protected]


Re: [SQL] linux. ossp-uuid

2010-12-21 Thread Trinath Somanchi
Hi-
Do u want to add UUID support to postgresql
follow this link

http://raveica.comdurav.com/blog/personal/how-do-i-add-uuid-to-postgresql/

or for UUID-OSSP, here is the documentation
http://www.postgresql.org/docs/8.3/static/uuid-ossp.html

2010/12/21 Николай Ижиков 

> Hi, guys.
>
> I have linux server. Package uuid installed
>
> I build and install postgresql from source with --with-ossp-uuid flag.
>
> After installation I try to execute:
>
> ===
> create or replace function uuid_generate_v1() returns uuid as
> '$libdir/uuid-ossp', 'uuid_generate_v1' volatile strict language C
> ===
>
> and got error
>
> "could not load libraty /usr/lib/postgresql/uuid-ossp.so":
> /usr/lib/postgresql/uuid-ossp.so: undefined symbol: uuid_error"
>
> How I can fix it?
>
>
> --
> С уважением, Николай Ижиков
> [email protected]
>



-- 
Regards,
--
Trinath Somanchi,


[SQL] data import

2010-12-21 Thread Viktor Bojović
Hi,

can anyone recommend me a windows and linux free tools for importing data
into postgre.
Source files are CSV or excel.

Thanx in advance
-- 
---
Viktor Bojović
---
Wherever I go, Murphy goes with me


Re: [SQL] data import

2010-12-21 Thread Pavel Stehule
Hello

2010/12/21 Viktor Bojović :
> Hi,
>
> can anyone recommend me a windows and linux free tools for importing data
> into postgre.
> Source files are CSV or excel.

PostgreSQL can read a CVS files via a COPY statement. You can use a
\copy metacommand too from psql

Regards

Pavel Stehule

> Thanx in advance
> --
> ---
> Viktor Bojović
> ---
> Wherever I go, Murphy goes with me
>

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


[SQL] converting type and function in postgresql ?

2010-12-21 Thread Amar Dhole
Hi,

 

I am new to postgesql.

 

I have oracle type and function, which I needs to converting it into
postgresql .

 

I am using postgresql 9.x

 

Type : 

CREATE OR REPLACE

TYPE INST

AS TABLE OF VARCHAR2(255)

 

How this type can be written in postgresql ??

 

 

Oracle Function:

 

CREATE OR REPLACE function in_list ( p_string in varchar2 ) return INST

as

l_stringlong default p_string || ',';

l_data  INST := INST();

n   number;

begin

  loop

  exit when l_string is null;

  n := instr( l_string, ',' );

 l_data.extend;

 l_data(l_data.count) := ltrim( rtrim( substr( l_string, 1, n-1
) ) );

 l_string := substr( l_string, n+1 );

end loop;

 

return l_data;

  end;

 

how this function can be rewritten in postgresql ?

 

your help will help me a lot.

 

Thanks
Amar 



Re: [SQL] converting type and function in postgresql ?

2010-12-21 Thread Trinath Somanchi
Try this

http://ora2pg.darold.net/

On Tue, Dec 21, 2010 at 5:03 PM, Amar Dhole  wrote:

>  Hi,
>
>
>
> I am new to postgesql.
>
>
>
> I have oracle type and function, which I needs to converting it into
> postgresql .
>
>
>
> I am using postgresql 9.x
>
>
>
> Type :
>
> CREATE OR REPLACE
>
> TYPE INST
>
> AS TABLE OF VARCHAR2(255)
>
>
>
> How this type can be written in postgresql ??
>
>
>
>
>
> Oracle Function:
>
>
>
> CREATE OR REPLACE function in_list ( p_string in varchar2 ) return INST
>
> as
>
> l_stringlong default p_string || ',';
>
> l_data  INST := INST();
>
> n   number;
>
> begin
>
>   loop
>
>   exit when l_string is null;
>
>   n := instr( l_string, ',' );
>
>  l_data.extend;
>
>  l_data(l_data.count) := ltrim( rtrim( substr( l_string, 1, n-1 )
> ) );
>
>  l_string := substr( l_string, n+1 );
>
> end loop;
>
>
>
> return l_data;
>
>   end;
>
>
>
> how this function can be rewritten in postgresql ?
>
>
>
> your help will help me a lot.
>
>
>
> Thanks
> Amar
>



-- 
Regards,
--
Trinath Somanchi,


Re: [SQL] data import

2010-12-21 Thread Achilleas Mantzios
Στις Tuesday 21 December 2010 13:36:58 ο/η Pavel Stehule έγραψε:
> Hello
> 
> 2010/12/21 Viktor Bojović :
> > Hi,
> >
> > can anyone recommend me a windows and linux free tools for importing data
> > into postgre.
> > Source files are CSV or excel.
> 

Openoffice can do this job, populating a table from an excel data source,
but every time i do it (which is not often) it is like reinventing the wheel 
again.
The way to do it, IIRC, is to "create" a database based on your existing excel 
data source.
After that you can copy data from this "excel-powered" database to your normal 
pgsql database, fairly easily.
It is easy actually, just not so straight forward as most people would want.

> PostgreSQL can read a CVS files via a COPY statement. You can use a
> \copy metacommand too from psql
> 
> Regards
> 
> Pavel Stehule
> 
> > Thanx in advance
> > --
> > ---
> > Viktor Bojović
> > ---
> > Wherever I go, Murphy goes with me
> >
> 



-- 
Achilleas Mantzios

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] data import

2010-12-21 Thread Chris Ruprecht
If your file is TAB delimited, you can simply do:

\copy tablename from 'some file'

To get details in psql, do:
psql mydatabase
and at the prompt:
\h copy



On Dec 21, 2010, at 06:34 , Viktor Bojović wrote:

> Hi,
> 
> can anyone recommend me a windows and linux free tools for importing data 
> into postgre.
> Source files are CSV or excel.
> 
> Thanx in advance
> -- 
> ---
> Viktor Bojović
> ---
> Wherever I go, Murphy goes with me


-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] linux. ossp-uuid

2010-12-21 Thread Basil Bourque
As documented here:
http://www.postgresql.org/docs/9.0/interactive/uuid-ossp.html

Rather than assuming the host operating system has an implementation of UUID, 
Postgres depends on the presence of a specific implementation of UUID 
generation & handling. This open-source implementation is called "OSSP uuid", 
found here:
http://www.ossp.org/pkg/lib/uuid/

My guess:
You compiled the code necessary for Postgres to reach out to this UUID 
implementation. But you are missing the actual UUID implementation.

The OneClick installer from EnterpriseDB.com placed this on my Mac, which I 
assume is the UUID implementation:
/Library/PostgreSQL/9.0/lib/postgresql/uuid-ossp.so

In addition I found what I assume is the code that enables Postgres to reach 
out and call that implementation.
/Library/PostgreSQL/9.0/lib/libuuid.dylib
/Library/PostgreSQL/9.0/lib/libuuid.la

Lastly I found this SQL script which I ran to enable the already-complied code:
/Library/PostgreSQL/9.0/share/postgresql/contrib/uuid-ossp.sql

I'm no expert, but I hope that helps.

--Basil Bourque

> I have linux server. Package uuid installed
> 
> I build and install postgresql from source with --with-ossp-uuid flag.
> 
> After installation I try to execute:
> 
> ===
> create or replace function
>  uuid_generate_v1()
> 
> returns
>  uuid
> 
> as '$libdir/uuid-ossp', 'uuid_generate_v1'
> 
> volatile strict language C
> 
> ===
> 
> and got error
> 
> "could not load libraty /usr/lib/postgresql/uuid-ossp.so": 
> /usr/lib/postgresql/uuid-ossp.so: undefined symbol: uuid_error"
> 
> How I can fix it?



-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql