[GENERAL] Problem in creating a table

2005-05-17 Thread Wen Guangcheng
Hi Gurus, (B (BWhen I try to create a table by a script I get a error as follows, (B# (B[EMAIL PROTECTED] pgsql]$ psql -d postgres -e -f (B/opt/rapisa/sql/TD_ACCESSCOUNT.sql (B (BCREATE TABLE TD_ACCESSCOUNT( (BAC_YEAR NUMBER(4,0)

Re: [GENERAL] Problem in creating a table

2005-05-17 Thread Klint Gore
On Tue, 17 May 2005 15:47:55 +0900, Wen Guangcheng [EMAIL PROTECTED] wrote: OFFICE_ID VARCHAR2(7)NOT NULL, This used to be oracle? drop the 2 from the varchar. klint. +---+-+ : Klint Gore: Non rhyming

Re: [GENERAL] Problem in creating a table

2005-05-17 Thread Richard Huxton
Wen Guangcheng wrote: (B Hi Gurus, (B (B When I try to create a table by a script I get a error as follows, (B # (B [EMAIL PROTECTED] pgsql]$ psql -d postgres -e -f (B /opt/rapisa/sql/TD_ACCESSCOUNT.sql (B (B CREATE TABLE

Re: [GENERAL] Problem in creating a table

2005-05-17 Thread Wen Guangcheng
Hi Klint, Thanks for your help. But the error message still exists even though the 2 was droped from the varchar. --Wen - Original Message - From: Klint Gore [EMAIL PROTECTED] To: Wen Guangcheng [EMAIL PROTECTED] Cc: pgsql-general@postgresql.org Sent: Tuesday, May 17, 2005 4:17 PM

Re: [GENERAL] Problem in creating a table

2005-05-17 Thread Klint Gore
On Tue, 17 May 2005 16:33:33 +0900, Wen Guangcheng [EMAIL PROTECTED] wrote: Hi Klint, Thanks for your help. But the error message still exists even though the 2 was droped from the varchar. try taking the double quotes out of the primary key (as richard said) and change number to numeric

Re: [GENERAL] Problem in creating a table

2005-05-17 Thread Robin Ericsson
Wen Guangcheng wrote: (B Hi Gurus, (B (BHi! (B (B CREATE TABLE TD_ACCESSCOUNT( (B AC_YEAR NUMBER(4,0)NOT NULL, (B AC_MONTHNUMBER(2,0)NOT NULL, (B AC_DAYS NUMBER(2,0)NOT NULL, (B OFFICE_ID VARCHAR2(7)NOT NULL, (B AC_COUNTNUMBER(6,0)

Re: [GENERAL] Problem in creating a table(Thanks)

2005-05-17 Thread Wen Guangcheng
Hello, Yes.it works. Thanks a lots to all of you. Cheers, --Wen - Original Message - From: Dan Black To: Wen Guangcheng Cc: pgsql-general@postgresql.org Sent: Tuesday, May 17, 2005 4:47 PM Subject: Re: [GENERAL] Problem in creating a table Try this CREATE TABLE

[GENERAL] psql -U user -l cive all db list

2005-05-17 Thread Margus Roo
Hey, For example, I have 10 postgres db created by postgres superuser postgres. when I login with postgres and do: psql -l I see all databases its OK. Now I create new user test_user and create new database with -O test_user - test_db. now I do under test_user: psql -U test_user -l and I see

Re: [GENERAL] psql -U user -l cive all db list

2005-05-17 Thread Richard Huxton
Margus Roo wrote: What I must change that non root user will see only own databases? You can't at the moment. There has been some discussion about this, but at present read access to the system catalogues is available to everyone. That doesn't mean they can connect to the database (that's

Re: [GENERAL] Distinguishing between connections in pg_hba.conf

2005-05-17 Thread Stephane Bortzmeyer
On Mon, May 16, 2005 at 03:31:27PM -0500, Scott Marlowe [EMAIL PROTECTED] wrote a message of 48 lines which said: but how do you assign it so that requests from apache appear on the db box as one IP address, and requests coming through stunnel appear as the second IP address? That's

[GENERAL] Password Encryption / PgAdmin

2005-05-17 Thread Patrick . FICHE
Hi, I set a PostgreSQL server with users who have Encrypted passwords. Is there a way to connect to the database using one of these users through pgAdmin ? Is there a way to tell pgAdmin to encrypt the password... Thanks Patrick

Re: [GENERAL] Password Encryption / PgAdmin

2005-05-17 Thread Tino Wildenhain
Am Dienstag, den 17.05.2005, 12:36 +0200 schrieb [EMAIL PROTECTED]: Hi, I set a PostgreSQL server with users who have Encrypted passwords. Is there a way to connect to the database using one of these users through pgAdmin ? Is there a way to tell pgAdmin to encrypt the password... You

Re: [GENERAL] plpython setof row

2005-05-17 Thread Sim Zacks
As far as I can tell it can't be done. Mage [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, how can I return setof rows in plpython language? I read the manual and couldn't find. Mage ---(end of

[GENERAL] Are these queries equivalent?

2005-05-17 Thread Martijn van Oosterhout
I'm trying to work out if the queries below will always produce identical results. The second is a lot faster. It seems logical to me that a correlated subquery involving an aggregate as below could in most cases be converted to a join (assuming the aggregate is stable). Put it another way, the

[GENERAL] PostgreSQL XA ?

2005-05-17 Thread FERREIRA, William (COFRAMI)
Title: stored procedures / C-Language hi at present my j2ee application use an Oracle database with XA transactions. i'm migrating Oracle to PostgreSQL, and i'm looking for a XAdriver for PostgreSQL. does it exist ? (i don't want to rewrite all my code) regards William Ferreira

Re: [GENERAL] Password Encryption / PgAdmin

2005-05-17 Thread Patrick . FICHE
Thanks, I forgot to mention md5 encryption in pg_hba.conf... --- Patrick Fiche email : [EMAIL PROTECTED] tél : 01 69 29 36 18

[GENERAL] Writing a join selectivity function

2005-05-17 Thread Angela Maduko
Hi, I am trying to write a join selectivity function for a user defined operator. The available documentation does not exactly specify how to go about this. Can anyone shed more light on this? Thanks in advance, Ify. ---(end of broadcast)--- TIP

[GENERAL] Newbie question on RULEs .. or .. bug ?

2005-05-17 Thread Leif Jensen
Hello, I have been working with a great database system called PostgreSQL for many years ;-) but never had to use any RULEs. I now have to use and update through a view and have written a few rules to make this possible as per the manual. My insert rules seems to work fine, but I

[GENERAL] Help - Urgent

2005-05-17 Thread ElayaRaja S
I am facing TCP IP connection refused. But i enbled the tcpip as true and i like to know the port number. becuase i like to enble the port number in my firewall. Please let me know Note: i can able to connect with my local ip address. The issue which i faced when i access through the public ip

Re: [GENERAL] Help - Urgent

2005-05-17 Thread Terry Fielder
Usually 5432 Its listed in postgresql.conf, which could be in /var/lib/pgsql/data/ or /usr/local/pgsql/data Terry ElayaRaja S wrote: I am facing TCP IP connection refused. But i enbled the tcpip as true and i like to know the port number. becuase i like to enble the port number in my firewall.

[GENERAL] table synonyms

2005-05-17 Thread Jayme Jeffman Filho
Hi, I would like to know if PostgreSQL has a similar database object to the Oracle synonym. Thanks a lot. Jayme Jeffman Filho GSEE-PUCRS +55 (51) 9112 3422 ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ?

Re: [GENERAL] Problem in creating a table

2005-05-17 Thread Robin Ericsson
Wen Guangcheng wrote: (B (BHi, (B (B TABLESPACE RAPIS; (B psql:/opt/rapisa/sql/TD_ACCESSCOUNT.sql:14: ERROR: syntax error at or near (B "(" at character 52 (B (B I really don't know what is wrong with it and do appreciate it if anyone would (B point out it. The version of Postgresql is

[GENERAL] Increasing number of postgres connections

2005-05-17 Thread Akash Garg
How do you recompile postgres to allow more than 1024 connections? Thanks, Akash ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] psql -U user -l cive all db list

2005-05-17 Thread Scott Marlowe
On Tue, 2005-05-17 at 04:52, Richard Huxton wrote: Margus Roo wrote: What I must change that non root user will see only own databases? You can't at the moment. There has been some discussion about this, but at present read access to the system catalogues is available to everyone.

Re: [GENERAL] Distinguishing between connections in pg_hba.conf

2005-05-17 Thread Scott Marlowe
On Tue, 2005-05-17 at 05:08, Stephane Bortzmeyer wrote: On Mon, May 16, 2005 at 03:31:27PM -0500, Scott Marlowe [EMAIL PROTECTED] wrote a message of 48 lines which said: but how do you assign it so that requests from apache appear on the db box as one IP address, and requests coming

Re: [GENERAL] psql -U user -l cive all db list

2005-05-17 Thread Tino Wildenhain
Am Dienstag, den 17.05.2005, 08:58 -0500 schrieb Scott Marlowe: On Tue, 2005-05-17 at 04:52, Richard Huxton wrote: Margus Roo wrote: What I must change that non root user will see only own databases? You can't at the moment. There has been some discussion about this, but at

Re: [GENERAL] psql -U user -l cive all db list

2005-05-17 Thread Scott Marlowe
On Tue, 2005-05-17 at 09:18, Tino Wildenhain wrote: Am Dienstag, den 17.05.2005, 08:58 -0500 schrieb Scott Marlowe: On Tue, 2005-05-17 at 04:52, Richard Huxton wrote: Margus Roo wrote: What I must change that non root user will see only own databases? You can't at the moment.

Re: [GENERAL] Increasing number of postgres connections

2005-05-17 Thread Stephane Bortzmeyer
On Mon, May 16, 2005 at 11:42:13AM -0700, Akash Garg [EMAIL PROTECTED] wrote a message of 12 lines which said: How do you recompile postgres to allow more than 1024 connections? Do you really need to recompile? I find in the man page: -N max-connections Sets the maximum

Re: [GENERAL] Increasing number of postgres connections

2005-05-17 Thread Scott Marlowe
On Tue, 2005-05-17 at 09:38, Stephane Bortzmeyer wrote: On Mon, May 16, 2005 at 11:42:13AM -0700, Akash Garg [EMAIL PROTECTED] wrote a message of 12 lines which said: How do you recompile postgres to allow more than 1024 connections? Do you really need to recompile? I find in the man

Re: [GENERAL] Writing a join selectivity function

2005-05-17 Thread Tom Lane
Angela Maduko [EMAIL PROTECTED] writes: I am trying to write a join selectivity function for a user defined operator. The available documentation does not exactly specify how to go about this. Can anyone shed more light on this? There isn't a lot of documentation, no :-(. I would suggest

[GENERAL] perl and insert

2005-05-17 Thread Hrishikesh Deshmukh
Hi All, Anybody knows how to use perl dbi to read a file line by line and insert into db! The books which i have tell you exclusively on running queries. Thanks, Hrishi ---(end of broadcast)--- TIP 2: you can get off all lists at once with the

Re: [GENERAL] Newbie question on RULEs .. or .. bug ?

2005-05-17 Thread Tom Lane
Leif Jensen [EMAIL PROTECTED] writes: CREATE RULE update_tasks2taskshead AS ON UPDATE TO tasks WHERE NEW.seq = 0 DO NOTHING ; That rule looks a bit useless ... CREATE RULE update_tasks2ganntinfo AS ON UPDATE TO tasks DO INSTEAD ( update ganntinfo set id = NEW.id, seq =

Re: [GENERAL] perl and insert

2005-05-17 Thread Rich Doughty
On 17 May 2005, Hrishikesh Deshmukh wrote: Hi All, Anybody knows how to use perl dbi to read a file line by line and insert into db! The books which i have tell you exclusively on running queries. it depends on what you need to achieve, but a good place to start would be something like:

[GENERAL] initdb: failed

2005-05-17 Thread Kathy Boyle
We are running Postgresql 7.4.7 on Redhat EL 4. Running /usr/bin/initdb command as user postgres fails before creating the views such as pg_user and pg_rules. It does create the database directories and databases. We can access them, add tables, and data. But pg_dump fails to do anything (no

[GENERAL] Cursor not getting all rows

2005-05-17 Thread Joseph Shraibman
I'm running: PostgreSQL 7.4.7 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5) I do this: BEGIN; SELECT count(*) FROM u, d WHERE u.id = d.id AND ... ; DECLARE cname CURSOR FOR SELECT u.field, d.field FROM u, d WHERE u.id = d.id AND ... ; At the end of the

Re: [GENERAL] Cursor not getting all rows

2005-05-17 Thread Scott Marlowe
On Tue, 2005-05-17 at 12:19, Joseph Shraibman wrote: I'm running: PostgreSQL 7.4.7 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5) I do this: BEGIN; SELECT count(*) FROM u, d WHERE u.id = d.id AND ... ; DECLARE cname CURSOR FOR SELECT u.field,

[GENERAL] TIP 9

2005-05-17 Thread Joseph Shraibman
Doesn't this need to be ammened to say before 8.0? ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match ---(end of

Re: [GENERAL] initdb: failed

2005-05-17 Thread Tom Lane
Kathy Boyle [EMAIL PROTECTED] writes: We are running Postgresql 7.4.7 on Redhat EL 4. Running /usr/bin/initdb command as user postgres fails before creating the views such as pg_user and pg_rules. This is a known problem caused by SELinux security enforcement. The quick and dirty solution is

Re: [GENERAL] Cursor not getting all rows

2005-05-17 Thread Joseph Shraibman
Scott Marlowe wrote: Only if you set transaction isolation to serializable. So am I getting data that was updated up until the time of the FETCH or the DECLARE CURSOR? ---(end of broadcast)--- TIP 2: you can get off all lists at once with the

Re: [GENERAL] Cursor not getting all rows

2005-05-17 Thread Tom Lane
Joseph Shraibman jks@selectacast.net writes: I do this: BEGIN; SELECT count(*) FROM u, d WHERE u.id = d.id AND ... ; DECLARE cname CURSOR FOR SELECT u.field, d.field FROM u, d WHERE u.id = d.id AND ... ; At the end of the fetching if the number of fetched does not equal the number from

Re: [GENERAL] Cursor not getting all rows

2005-05-17 Thread Scott Marlowe
On Tue, 2005-05-17 at 12:49, Joseph Shraibman wrote: Scott Marlowe wrote: Only if you set transaction isolation to serializable. So am I getting data that was updated up until the time of the FETCH or the DECLARE CURSOR? The data shouldn't change between the declare and the fetch, it's

[GENERAL] explicit cursor vs. for loop in pl/pgsql

2005-05-17 Thread David Parker
I need to process a large table a few "chunks" at a time, commiting in between chunks so that another process can pick up and start processing the data. I am using a pl/pgsql procedure with a "FOR rec in Select* from taborder by" statement. The chunksize is passed in to the procedure,

Re: [GENERAL] PostgreSQL XA ?

2005-05-17 Thread Kris Jurka
On Tue, 17 May 2005, FERREIRA, William (COFRAMI) wrote: hi at present my j2ee application use an Oracle database with XA transactions. i'm migrating Oracle to PostgreSQL, and i'm looking for a XA driver for PostgreSQL. does it exist ? No, postgresql does not support distributed

[GENERAL] Logs

2005-05-17 Thread Hrishikesh Deshmukh
Hi All, Where can i find more information on user actions, i.e. say a user logins in and does some querying via sql and then uses perl/c/c++ language to do some more querying. So how does postgresql keep track of user actions in a sequential order? Thanks, Hrishi ---(end

Re: [GENERAL] explicit cursor vs. for loop in pl/pgsql

2005-05-17 Thread Tom Lane
David Parker [EMAIL PROTECTED] writes: I know from the documentation that the FOR implicitly opens a cursor, but I'm wondering if there would be any performance advantages to explicitly declaring a cursor and moving through it with FETCH commands? AFAICS it'd be exactly the same. Might as

Re: [GENERAL] explicit cursor vs. for loop in pl/pgsql

2005-05-17 Thread David Parker
Thanks for the info. I've got an index, so I guess it's as good as it gets! The data is actually copied over from the slony transaction log table, and there's no way to know how many statements (=rows) there might be for any given transaction, so assigning an arbitrary limit seems too risky, and

[GENERAL] CSV delim quoting differences PgCOPY, Excel etc...

2005-05-17 Thread Jerry Sievers
Hello. I confess knowing nothing about MS Excel, don't run Windows, never use it. Anyway, I am often enough having to load Pg databases using SQL COPY from CSV output written by Excel, that I've had to write a script to change the quoting behavior from Excel's putting double quotes around a

Re: [GENERAL] PostgreSQL XA ?

2005-05-17 Thread Bruno Wolff III
On Tue, May 17, 2005 at 14:05:46 -0500, Kris Jurka [EMAIL PROTECTED] wrote: On Tue, 17 May 2005, FERREIRA, William (COFRAMI) wrote: hi at present my j2ee application use an Oracle database with XA transactions. i'm migrating Oracle to PostgreSQL, and i'm looking for a XA driver for

[GENERAL] Postgresql and logs

2005-05-17 Thread Hrishikesh Deshmukh
Hi All, My sincere apologies if this is a re-post. Where can i find more information on user actions, i.e. say a user logins in and does some querying via sql and then uses perl/c/c++ language to do some more querying. So how does postgresql keep track of user actions in a sequential order?

[GENERAL] unsubscribe

2005-05-17 Thread itamar
Itamar Reis Peixoto +55 (34) 3238 3845 e-mail : [EMAIL PROTECTED] http://vps.ispbrasil.com.br --- servidores linux ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do

[GENERAL] What should I do with this: invalid page header in block ... ?

2005-05-17 Thread Gianni Mariani
I suspect the error below is bad. - Running 8.0.1 on linux FC3 on AMD 64. septicide=# delete from sp_log where sp_log_time (now() - interval '7 days')::abstime; DELETE 215822 septicide=# vacuum full analyze; ERROR: invalid page header in block 5991 of relation sp_log_idx2 septicide=# vacuum

Re: [GENERAL] perl and insert

2005-05-17 Thread Harald Fuchs
In article [EMAIL PROTECTED], Rich Doughty [EMAIL PROTECTED] writes: On 17 May 2005, Hrishikesh Deshmukh wrote: Hi All, Anybody knows how to use perl dbi to read a file line by line and insert into db! The books which i have tell you exclusively on running queries. it depends on what you

Re: [GENERAL] CSV delim quoting differences PgCOPY, Excel etc...

2005-05-17 Thread Sven Willenberger
On Tue, 2005-05-17 at 15:58 -0400, Jerry Sievers wrote: Hello. I confess knowing nothing about MS Excel, don't run Windows, never use it. Anyway, I am often enough having to load Pg databases using SQL COPY from CSV output written by Excel, that I've had to write a script to change the

Re: [GENERAL] Postgresql and logs

2005-05-17 Thread Scott Marlowe
On Tue, 2005-05-17 at 15:39, Hrishikesh Deshmukh wrote: Hi All, My sincere apologies if this is a re-post. Where can i find more information on user actions, i.e. say a user logins in and does some querying via sql and then uses perl/c/c++ language to do some more querying. So how does

Re: [GENERAL] What should I do with this: invalid page header in block ... ?

2005-05-17 Thread Tom Lane
Gianni Mariani [EMAIL PROTECTED] writes: I suspect the error below is bad. - Running 8.0.1 on linux FC3 on AMD 64. septicide=# delete from sp_log where sp_log_time (now() - interval '7 days')::abstime; DELETE 215822 septicide=# vacuum full analyze; ERROR: invalid page header in block

[GENERAL] regarding IN clause

2005-05-17 Thread Surabhi Ahuja
Title: regarding IN clause I have a table where the primary key id is a serial key. now i have a query to this table where in, i have to get information related to a set of ids. This set contains around 130 ids. I was thinking that i can form a select statement of the form select * from

Re: [GENERAL] regarding IN clause

2005-05-17 Thread Dann Corbit
Title: regarding IN clause Probably, the sequential scan was faster. There is a big cost to jumping all over the place, loading both the index pages and the data pages. Typically, it is about 10% of the data volume for a file, but I dont know what the metric is for PostgreSQL. If