Re: [GENERAL] Get Unix timestamp from SQL timestamp through libpq

2010-01-10 Thread Vincenzo Romano
man 3 strftime 2010/1/11 Yan Cheng Cheok : > I try already. Neither of them can accept string parameter, and convert them > to unit timestamp (long). > > Thanks and Regards > Yan Cheng CHEOK > > > --- On Mon, 1/11/10, Vincenzo Romano wrote: > >> From: Vincenzo Romano >> Subject: Re: Get Unix t

Re: [GENERAL] Get Unix timestamp from SQL timestamp through libpq

2010-01-10 Thread Yan Cheng Cheok
I try already. Neither of them can accept string parameter, and convert them to unit timestamp (long). Thanks and Regards Yan Cheng CHEOK --- On Mon, 1/11/10, Vincenzo Romano wrote: > From: Vincenzo Romano > Subject: Re: Get Unix timestamp from SQL timestamp through libpq > To: "Yan Cheng Ch

Re: [GENERAL] Get Unix timestamp from SQL timestamp through libpq

2010-01-10 Thread Vincenzo Romano
Give a try to: man 2 time man 3 ctime 2010/1/11 Yan Cheng Cheok : > I know I can convert SQL timestamp to unix timestamp, using the following way. > > SELECT extract(epoch FROM now()); > > Now, I have a stored procedure function, which will directly return a table > row to the caller. One of th

Re: [GENERAL] pgsql2shp usage

2010-01-10 Thread Anisha Kaul
On Saturday 09 January 2010 19:03:59 Randall Thompson wrote: > The Attribute Tables for a shape file are stored in .DBF format which has a > restriction that field names are only ten characters long, so the warnings > are simply informing you that those field names that are longer than 10 > charact

[GENERAL] Get Unix timestamp from SQL timestamp through libpq

2010-01-10 Thread Yan Cheng Cheok
I know I can convert SQL timestamp to unix timestamp, using the following way. SELECT extract(epoch FROM now()); Now, I have a stored procedure function, which will directly return a table row to the caller. One of the row field is "timestamp" type. In my application, I am using libpq. I wish

Re: [GENERAL] Return Single Row Result After Inserting (Stored Procedure)

2010-01-10 Thread Yan Cheng Cheok
Thanks a lot. I solved my problem by using this. CREATE OR REPLACE FUNCTION create_lot(text, text, text) RETURNS lot AS $BODY$DECLARE configurationFile ALIAS FOR $1; operatorName ALIAS FOR $2; machineName ALIAS FOR $3; _lot lot; BEGIN INSERT INTO lot(configuration_file, oper

Re: [GENERAL] Return Single Row Result After Inserting (Stored Procedure)

2010-01-10 Thread Adrian Klaver
On Sunday 10 January 2010 5:49:38 pm Yan Cheng Cheok wrote: > Thanks! > > However, we prefer to stick with plpgsql, as rest of our functions are in > that language. We need some consistency. > > I try to modify my previous stored procedure to. > > CREATE OR REPLACE FUNCTION create_lot(text, text, t

Re: [GENERAL] Return Single Row Result After Inserting (Stored Procedure)

2010-01-10 Thread Yan Cheng Cheok
Thanks! However, we prefer to stick with plpgsql, as rest of our functions are in that language. We need some consistency. I try to modify my previous stored procedure to. CREATE OR REPLACE FUNCTION create_lot(text, text, text) RETURNS lot AS $BODY$DECLARE configurationFile ALIAS FOR $1

Re: [GENERAL] 8.4.1 & 8.4.2 require map=... for ident in the pg_hba.conf file, will this be the new way?

2010-01-10 Thread Peter Eisentraut
On tis, 2010-01-05 at 16:35 +0100, Claudio Eichenberger wrote: > Hello, > > In older PostgreSQL installations < 8.4 I used the following pg_hba.conf > syntax: > > local all pgsql ident PGSQL > > but 8.4.1 & 8.4.2 require the following syntax: > > local all pgsql

[GENERAL] 8.4.1 & 8.4.2 require map=... for ident in the pg_hba.conf file, will this be the new way?

2010-01-10 Thread Claudio Eichenberger
Hello, In older PostgreSQL installations < 8.4 I used the following pg_hba.conf syntax: local all pgsql ident PGSQL but 8.4.1 & 8.4.2 require the following syntax: local all pgsql ident map=PGSQL Will this be the new way for all future releases? Thanks in a

Re: [GENERAL] initdb has trouble finding the right ascii_and_mic.so

2010-01-10 Thread Maciej (Matchek) Blizinski
On Sun, Jan 10, 2010 at 4:05 PM, Tom Lane wrote: > "Maciej (Matchek) Blizinski" writes: >> There are 2 sets of libraries installed. >> /opt/csw/lib/postgresql/8.4/lib contains 32-bit libraries. >> /opt/csw/lib/postgresql/8.4/lib/64 contains the 64-bit set. > > You can't just make up some random l

Re: [GENERAL] initdb has trouble finding the right ascii_and_mic.so

2010-01-10 Thread Tom Lane
"Maciej (Matchek) Blizinski" writes: > There are 2 sets of libraries installed. > /opt/csw/lib/postgresql/8.4/lib contains 32-bit libraries. > /opt/csw/lib/postgresql/8.4/lib/64 contains the 64-bit set. You can't just make up some random layout for the libraries. Even if this could work, I don't

Re: [GENERAL] Optimistic locking with multiple rows

2010-01-10 Thread John T. Dow
On Sun, 10 Jan 2010 16:01:57 +0800, Craig Ringer wrote: >On 6/01/2010 10:53 PM, John T. Dow wrote: >> I posted this several days ago to pgsql-jdbc but have had no response. I am >> posting it here (with minor changes in the wording). >> >> I have developed some code that works, I'm just not sure

[GENERAL] initdb has trouble finding the right ascii_and_mic.so

2010-01-10 Thread Maciej (Matchek) Blizinski
Hello pgsql-general, I'm having trouble initializing the database cluster. Here's how it does: netra ~ # (cd /var/opt/csw/postgresql/8.4/pgdata; truss -f -o /var/tmp/initdb.truss su postgres -c "/opt/csw/lib/postgresql/8.4/bin/sparcv9/initdb -D /var/opt/csw/postgresql/8.4/pgdata -E utf-8") The f

Re: [GENERAL] postgres issue

2010-01-10 Thread Roderick A. Anderson
Craig Ringer wrote: On 9/01/2010 10:53 PM, Amy Smith wrote: How to use mount for differnt region. I do not understand this question. Can you explain what you mean a bit more? Probably wants tablespaces? \\||/ Rod -- -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org

Re: [GENERAL] An issue with max() and order by ... limit 1 in postgresql8.3-beta3

2010-01-10 Thread zxo102 ouyang
Thanks for your guys' help. I did not know the meaning of betas / alphas things before and just simply downloaded one to use. Now my 8.3 -beta3 version is really in production and get 100 rows of monitoring data per minutes. So far so good. Anyway, I will upgrade it to a latest stable version. With

Re: [GENERAL] postgres issue

2010-01-10 Thread Craig Ringer
On 9/01/2010 10:53 PM, Amy Smith wrote: all For dba, do you create a dba user and grant all privilege to 'dba user', so you can create table, etc ? For a team, do you create user for all team member and tie to a group ? Not sure the set up for postgres However you prefer, really. I prefer to c

Re: [GENERAL] postgres

2010-01-10 Thread Craig Ringer
On 9/01/2010 11:23 PM, Amy Smith wrote: all Any kind of parameter in solaris root section need to be checked before install postgres in Solaris Assuming you're asking if any kernel parameters need tuning before installing PostgreSQL on a solaris system: not really, no. However, you may need

[GENERAL] R: aggregate over tables in different schema

2010-01-10 Thread Vincenzo Romano
Try using inheritance. Il giorno 10 gen, 2010 2:30 m., "Ivan Sergio Borgonovo" < m...@webthatworks.it> ha scritto: I've tables in different schemas all with the same name and structure. I'd like to compute an aggregate on the union of those tables. I don't know the schemas in advance. The list of

[GENERAL] postgres issue

2010-01-10 Thread Amy Smith
all For dba, do you create a dba user and grant all privilege to 'dba user', so you can create table, etc ? For a team, do you create user for all team member and tie to a group ? Not sure the set up for postgres also what is best way to create a production and test region using the same databas

Re: [GENERAL] Optimistic locking with multiple rows

2010-01-10 Thread Craig Ringer
On 6/01/2010 10:53 PM, John T. Dow wrote: I posted this several days ago to pgsql-jdbc but have had no response. I am posting it here (with minor changes in the wording). I have developed some code that works, I'm just not sure I have the "best" solution. I have applications in which the user

[GENERAL] postgres

2010-01-10 Thread Amy Smith
all Any kind of parameter in solaris root section need to be checked before install postgres in Solaris thanks Amy