[GENERAL] metadata on a table

2010-05-18 Thread Malm Paul
Hi, I'm trying to read the metadata from table to create the same sort of table in another database, using java. This is how I do it today quwstion = "SELECT * FROM table" stmnt = dbConnection.prepareStatement(question); rs = stmnt.executeQuery(); ResultSetMetaData rsMetaData = rs.getMetaData

Re: [GENERAL] default ordering of query result - are they always guarantee

2010-05-18 Thread Guillaume Lelarge
Le 19/05/2010 05:06, Yan Cheng CHEOK a écrit : > I have the following table : > > CREATE TABLE measurement_1 > ( > measurement_id serial NOT NULL, > fk_unit_id int NOT NULL, > "value" double precision, > measurement_type text NOT NULL, >

[GENERAL] default ordering of query result - are they always guarantee

2010-05-18 Thread Yan Cheng CHEOK
I have the following table : CREATE TABLE measurement_1 ( measurement_id serial NOT NULL, fk_unit_id int NOT NULL, "value" double precision, measurement_type text NOT NULL, measurement_unit text NOT NULL ); When I want to r

Re: [GENERAL] Connection lost

2010-05-18 Thread Joshua Tolley
On Tue, May 18, 2010 at 1:18 PM, Hernan Danielan wrote: > Hello! I am using postgress 8.4. I am trying to save to my DB a Large Binary > Object, in localhost, let's say 1.4MB. I read that LargeObjectAPI should be > used. > I have a problem that sometimes i can store the file and some others i get

Re: [GENERAL] ERROR: unrecognized time zone name: "UTC"

2010-05-18 Thread Brad Ediger
On Tue, May 18, 2010 at 8:15 PM, Brad Ediger wrote: > I am experiencing this error trying to set the connection time zone to > UTC on PostgreSQL 8.4.4: > >    postgres=# set time zone 'UTC'; >    ERROR:  unrecognized time zone name: "UTC" Answered my own question -- it was my Prefix Portage insta

Re: [GENERAL] use of IN() with literals

2010-05-18 Thread Dennis Gearon
Yep bad scraping from one site to another. Probably encoding. Thanks for telling me what (should) have been obvious about the two INs. The gobbledy gook was bad encoding between the two web pages. select Dennis Gearon Signature Warning EARTH has a Right To Life,   otherwise we

[GENERAL] ERROR: unrecognized time zone name: "UTC"

2010-05-18 Thread Brad Ediger
I am experiencing this error trying to set the connection time zone to UTC on PostgreSQL 8.4.4: postgres=# set time zone 'UTC'; ERROR: unrecognized time zone name: "UTC" I have read the documentation for timezone_abbreviations, and everything looked in order, at least as far as my limite

Re: [GENERAL] How to return an Int4 when subtracting dates/timestamps

2010-05-18 Thread Tim Landscheidt
Andre Lopes wrote: > I need to return an Int4 when I do this king of select > [code] > select CURRENT_DATE - '2009-12-31' from tbl_sometable > [/code] > This select returns an Interval. How can I return an Integer? Like '138' That expression returning an interval would be contradictory to the

[GENERAL] How to return an Int4 when subtracting dates/timestamps

2010-05-18 Thread Andre Lopes
Hi, I need to return an Int4 when I do this king of select [code] select CURRENT_DATE - '2009-12-31' from tbl_sometable [/code] This select returns an Interval. How can I return an Integer? Like '138' Sorry my bad english. Best Regards,

[GENERAL] Connection lost

2010-05-18 Thread Hernan Danielan
Hello! I am using postgress 8.4. I am trying to save to my DB a Large Binary Object, in localhost, let's say 1.4MB. I read that LargeObjectAPI should be used. I have a problem that sometimes i can store the file and some others i get an exception of >>org.postgresql.util.PSQLException: An I/O erro

Re: [GENERAL] use of IN() with literals

2010-05-18 Thread David W Noon
On Tue, 18 May 2010 10:05:49 -0700 (PDT), Dennis Gearon wrote about [GENERAL] use of IN() with literals: >I'm trying to use the following script: (to give command line ability >to change grant on all tables in public in a database) > >psql -t -c “SELECT ‘GRANT $1 ON public.’ || t.relname || ‘ TO $

Re: [GENERAL] use of IN() with literals

2010-05-18 Thread Thomas Kellerer
Dennis Gearon wrote on 18.05.2010 19:05: select * from pg_class where relkind IN IN (‘r’, ‘v’, ‘S’); ^^ ^ ^ You repeated the keyword IN, and you are using the wrong quotes (unless this is a copy & paste problem of a broken email client) select * fr

[GENERAL] use of IN() with literals

2010-05-18 Thread Dennis Gearon
I'm trying to use the following script: (to give command line ability to change grant on all tables in public in a database) psql -t -c “SELECT ‘GRANT $1 ON public.’ || t.relname || ‘ TO $2;’ from pg_class t, pg_namespace s WHERE t.relkind IN (‘r’, ‘v’, ‘S’) AND t.relnamespace=s.oid AND s.nspna

Re: [GENERAL] pg_restore to log file

2010-05-18 Thread Scott Mead
On Tue, May 18, 2010 at 12:15 PM, Thom Brown wrote: > On 18 May 2010 17:11, akp geek wrote: > > pg_restore -h 10.xx.xx.xxx -d dbName -n schemaName -v -U postgres > > testDB_20100414.txt-f outputifile > > > > I got the following error "pg_restore: options -d/--dbname and -f/--file > > cann

Re: [GENERAL] pg_restore to log file

2010-05-18 Thread akp geek
Thanks a lot pg_restore -all options >output.txt 2>&1 worked Regards On Tue, May 18, 2010 at 12:15 PM, Scott Mead wrote: > > On Tue, May 18, 2010 at 12:11 PM, akp geek wrote: > >> pg_restore -h 10.xx.xx.xxx -d dbName -n schemaName -v -U postgres >> testDB_20100414.txt-f outputifile >>

Re: [GENERAL] pg_restore to log file

2010-05-18 Thread Scott Mead
On Tue, May 18, 2010 at 12:11 PM, akp geek wrote: > pg_restore -h 10.xx.xx.xxx -d dbName -n schemaName -v -U postgres > testDB_20100414.txt-f outputifile > > > I got the following error "pg_restore: options -d/--dbname and -f/--file > cannot be used together" > I think you would either ca

Re: [GENERAL] pg_restore to log file

2010-05-18 Thread Thom Brown
On 18 May 2010 17:11, akp geek wrote: > pg_restore -h 10.xx.xx.xxx  -d dbName  -n schemaName -v -U postgres >  testDB_20100414.txt    -f outputifile > > I got the following error "pg_restore: options -d/--dbname and -f/--file > cannot be used together" > > Regards > That's odd. I can't see why t

Re: [GENERAL] pg_restore to log file

2010-05-18 Thread akp geek
pg_restore -h 10.xx.xx.xxx -d dbName -n schemaName -v -U postgres testDB_20100414.txt-f outputifile I got the following error "pg_restore: options -d/--dbname and -f/--file cannot be used together" Regards On Tue, May 18, 2010 at 12:07 PM, Thom Brown wrote: > On 18 May 2010 17:03, a

Re: [GENERAL] pg_restore to log file

2010-05-18 Thread Thom Brown
On 18 May 2010 17:03, akp geek wrote: > Hi All - >                 Is there a way to direct the message generated during > pg_restore to a log file? > Regards > I think you can use "-f outputfile". Regards Thom -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make chan

[GENERAL] pg_restore to log file

2010-05-18 Thread akp geek
Hi All - Is there a way to direct the message generated during pg_restore to a log file? Regards

Re: [GENERAL] creating a table based on a table in stored in another database

2010-05-18 Thread Scott Mead
On Tue, May 18, 2010 at 4:45 AM, Malm Paul wrote: > I can add that I would like to do this in my java application. > E.i. just create an empty table in database1 which has the same column > names and types as a table stored in database2. > > I tried this for a start: > stmnt = dbConnection.prepa

Re: [GENERAL] Workqueue performance

2010-05-18 Thread Tom Lane
Jason Armstrong writes: > 1. NOTIFY/LISTEN was causing performance to degrade badly over time. I > have reworked my code to poll the database instead. FWIW, you need to ensure pg_listener gets vacuumed pretty aggressively in order to prevent degradation in a high-traffic NOTIFY application. PG 9

Re: [GENERAL] postgreSQL enquiry

2010-05-18 Thread Craig Ringer
On 18/05/2010 4:42 PM, Charo Carino wrote: Hi I was on your website trying to look up information on PostgreSQL and the information that I needed was hard to get or just couldnt find it. Can you please clarify whether these requirements are covered by postgreSQL product It sounds to me like you

Re: [GENERAL] Workqueue performance

2010-05-18 Thread Jason Armstrong
Thank-you for the tips about this issue. I found two things: 1. NOTIFY/LISTEN was causing performance to degrade badly over time. I have reworked my code to poll the database instead. 2. There was a further function trigger that I didn't include in the description. I wanted to keep a status of t

Re: [GENERAL] postgreSQL enquiry

2010-05-18 Thread Thom Brown
On 18 May 2010 09:42, Charo Carino wrote: > Hi > I was on your website trying to look up information on PostgreSQL and the > information that I needed was hard to get or just couldnt find it. Can you > please clarify whether these requirements are covered by postgreSQL product: > > - data stored i

Re: [GENERAL] postgreSQL enquiry

2010-05-18 Thread சிவகுமார் மா
On Tue, May 18, 2010 at 2:12 PM, Charo Carino wrote: > - data stored in the database includes text, numbers, pictures and even > video clips > - avoids vendor 'lock ins' --> open DBMS > - allows for a web-based end (web 2.0) >    - fully searchable by anyone from anywhere and allows for heavy traf

Re: [GENERAL] postgres installation

2010-05-18 Thread Thom Brown
On 18 May 2010 08:00, VIRENDRA MAGDUM wrote: > respected sir/mam, >                      i am having laptop TOSHIBA satellite L505 which is of >  64 bit and i am not able to install postgres on that. i think their is >  problem of selecting ENCODING parameter. >                      so please help

[GENERAL] postgres installation

2010-05-18 Thread VIRENDRA MAGDUM
respected sir/mam, i am having laptop TOSHIBA satellite L505 which is of 64 bit and i am not able to install postgres on that. i think their is problem of selecting ENCODING parameter. so please help me out as early as possible. thanks virendra -- Se

[GENERAL] postgreSQL enquiry

2010-05-18 Thread Charo Carino
Hi I was on your website trying to look up information on PostgreSQL and the information that I needed was hard to get or just couldnt find it. Can you please clarify whether these requirements are covered by postgreSQL product: - data stored in the database includes text, numbers, pictures an

Re: [GENERAL] creating a table based on a table in stored in another database

2010-05-18 Thread Malm Paul
I can add that I would like to do this in my java application. E.i. just create an empty table in database1 which has the same column names and types as a table stored in database2. I tried this for a start: stmnt = dbConnection.prepareStatement("select dblink_connect('myconn', 'dbname=gemaps')

Re: [GENERAL] creating a table based on a table in stored in another database

2010-05-18 Thread A. Kretschmer
In response to Malm Paul : > Hi list, > in a database I have different kind of tables. I would like to take the meta > data from one of those tables and create the same type of table (but empty) > in another database. > Can anyone, please, tell me how to do this? Create a schema-only dump and r

[GENERAL] creating a table based on a table in stored in another database

2010-05-18 Thread Malm Paul
Hi list, in a database I have different kind of tables. I would like to take the meta data from one of those tables and create the same type of table (but empty) in another database. Can anyone, please, tell me how to do this? Kind regards, Paul -- Sent via pgsql-general mailing list (pgsql-