Table msysconf

Started by Siuda Paweł DI Centralaover 25 years ago11 messagesgeneral
Jump to latest
#1Siuda Paweł DI Centrala
P.Siuda@gbg.com.pl

Hi !!!

I am novice to Linux and PostgreSQL, so it is possible my question is
stupid.
Exactly I have 2 problems:

1) From time to time I have following info:

ERROR: Table msysconf does not exist

Is it any system table?
Is it important?
My database seems to be OK.

Additional info:
Postgres 6.4 on Redhat 6.0
postmaster -i -B 60 -o '-S 4096'
Intel Celeron 433, 64MB RAM, HDD 10,2GB

PostgreSQL is used as some kind of Data Mart (one of the table have over
4,000,000 tuples)
Max. 20 users (but max. 10 in one time).

2) ODBC driver on Win95 (I know what You say -:))

I have problems when using ODBC drivers to PostgreSQL on Win95 (VisualBasic
6.0 application).
When I make SELECT everyfing works fine, bat I can't make any UPDATES or
INSERTS.

There is a flag Read-only in Options of a ODBC driver but it doesn't matter
if it is on or off.
I always have error info.

Any help is welcome.
Pawel.

#2José Soares
jose@sferacarta.com
In reply to: Siuda Paweł DI Centrala (#1)
Re: Table msysconf

Siuda Pawe� DI Centrala wrote:

Hi !!!

I am novice to Linux and PostgreSQL, so it is possible my question is
stupid.
Exactly I have 2 problems:

1) From time to time I have following info:

ERROR: Table msysconf does not exist

Is it any system table?
Is it important?
My database seems to be OK.

I supose you are using MS-Access -->ODBC-->PostgreSQL
because M$-Access checks for a table named msysconf
you can optionally create this table on PostgreSQL
to configure the connection between Access->PostgreSQL,
if you don't have this table Access uses the default values.

Jose'

#3Michael Davis
mdavis@sevainc.com
In reply to: José Soares (#2)
RE: Table msysconf

Is there any documentation on what can be configured between PostgreSQL and Access?

-----Original Message-----
From: Jose Soares [SMTP:jose@sferacarta.com]
Sent: Thursday, January 04, 2001 3:59 AM
To: Siuda Pawe? DI Centrala
Cc: 'pgsql-general@postgresql.org'
Subject: Re: Table msysconf

Siuda Pawe? DI Centrala wrote:

Hi !!!

I am novice to Linux and PostgreSQL, so it is possible my question is
stupid.
Exactly I have 2 problems:

1) From time to time I have following info:

ERROR: Table msysconf does not exist

Is it any system table?
Is it important?
My database seems to be OK.

I supose you are using MS-Access -->ODBC-->PostgreSQL
because M$-Access checks for a table named msysconf
you can optionally create this table on PostgreSQL
to configure the connection between Access->PostgreSQL,
if you don't have this table Access uses the default values.

Jose'

#4Soma Interesting
dfunct@telus.net
In reply to: Michael Davis (#3)
Test for existence of Table

Can I test for an existing table before issuing the "CREATE TABLE" command?

IF EXISTS employees{
DROP TABLE employees
}
CREATE TABLE employees

Can you provide an example of this. I couldn't find this in the manual or
Bruce's book - did I not look hard enough ? :)

- - - - - - -
- - - -
WARNING: Some experts believe that use of any keyboard may cause
serious injury. Consult Users Guide.
dfunct@telus.net

#5Craig L. Ching
cching@mqsoftware.com
In reply to: Soma Interesting (#4)
RE: Test for existence of Table

Yeah,

DROP TABLE employees
CREATE TABLE employees

;-)

Craig

-----Original Message-----
From: Soma Interesting [mailto:dfunct@telus.net]
Sent: Thursday, January 04, 2001 1:40 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] Test for existence of Table

Can I test for an existing table before issuing the "CREATE TABLE" command?

IF EXISTS employees{
DROP TABLE employees
}
CREATE TABLE employees

Can you provide an example of this. I couldn't find this in the manual or
Bruce's book - did I not look hard enough ? :)

- - - - - - -
- - - -
WARNING: Some experts believe that use of any keyboard may cause
serious injury. Consult Users Guide.

dfunct@telus.net

#6Gregory Wood
gregw@com-stock.com
In reply to: Craig L. Ching (#5)
Re: Test for existence of Table

DROP TABLE employees

Error: ERROR: Relation 'employees' does not exist

And execution halts.... which is I believe why he wanted to check for the
existence before trying to DROP. I'd love to know if this exists as well...
would come in very handy during development time.

Greg

Yeah,

DROP TABLE employees
CREATE TABLE employees

;-)

Craig

-----Original Message-----
From: Soma Interesting [mailto:dfunct@telus.net]
Sent: Thursday, January 04, 2001 1:40 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] Test for existence of Table

Can I test for an existing table before issuing the "CREATE TABLE"

command?

Show quoted text

IF EXISTS employees{
DROP TABLE employees
}
CREATE TABLE employees

Can you provide an example of this. I couldn't find this in the manual or
Bruce's book - did I not look hard enough ? :)

- - - - - - -
- - - -
WARNING: Some experts believe that use of any keyboard may cause
serious injury. Consult Users Guide.

dfunct@telus.net

#7Anthony E . Greene
agreene@pobox.com
In reply to: Gregory Wood (#6)
Re: Test for existence of Table

On Thu, 04 Jan 2001 22:11:31 Gregory Wood wrote:

DROP TABLE employees

Error: ERROR: Relation 'employees' does not exist

And execution halts.... which is I believe why he wanted to check for the
existence before trying to DROP. I'd love to know if this exists as well...
would come in very handy during development time.

Greg

I just tested this with "psql < script.sql" and execution did not stop.
There may be contexts where this error causes execution to stop but it works
at the command line with psql. That implies that it works within psql using
"\i script.sql", which I have also found to be true.

Tony
--
Anthony E. Greene <agreene@pobox.com> <http://www.pobox.com/~agreene/&gt;
PGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26 C484 A42A 60DD 6C94 239D
Chat: AOL/Yahoo: TonyG05 ICQ: 91183266
Linux. The choice of a GNU Generation. <http://www.linux.org/&gt;

#8Craig L. Ching
cching@mqsoftware.com
In reply to: Anthony E . Greene (#7)
RE: Re: Test for existence of Table

-----Original Message-----
From: Gregory Wood [mailto:gregw@com-stock.com]
Sent: Thursday, January 04, 2001 9:12 PM
To: PostgreSQL-General
Subject: [GENERAL] Re: Test for existence of Table

DROP TABLE employees

Error: ERROR: Relation 'employees' does not exist

And execution halts.... which is I believe why he wanted to check for the
existence before trying to DROP. I'd love to know if this exists as well...
would come in very handy during development time.

Execution does not halt, it continues and creates the table. I rely on this
functionality, so I know it works. Good luck!

Greg

Cheers,
Craig

#9Gregory Wood
gregw@com-stock.com
In reply to: Craig L. Ching (#8)
Re: Re: Test for existence of Table

DROP TABLE employees

Error: ERROR: Relation 'employees' does not exist

And execution halts.... which is I believe why he wanted to check for the
existence before trying to DROP. I'd love to know if this exists as

well...

would come in very handy during development time.

Execution does not halt, it continues and creates the table. I rely on

this

functionality, so I know it works. Good luck!

Well, that is a quote from the database tool I use, and execution does
indeed halt. I can only assume you are using psql, which someone confirmed
that that does work. Also, if you wrap your queries in an explicit
transaction (I don't like to leave anything to Auto-Commit), it will also
fail:

NOTICE: current transaction is aborted, queries ignored until end of
transaction block

What would be nice is if there were a way to only DROP a table if it exists.
But I would consider this to be rather low priority.

Greg

#10Ed Loehr
eloehr@austin.rr.com
In reply to: Craig L. Ching (#8)
Re: Re: Re: Test for existence of Table

Gregory Wood wrote:

What would be nice is if there were a way to only DROP a table if it exists.
But I would consider this to be rather low priority.

This might help...

CREATE FUNCTION table_exists(TEXT) RETURNS BOOLEAN AS
'DECLARE
tablename ALIAS FOR $1;
temp RECORD;
BEGIN
SELECT INTO temp *
FROM pg_class c
WHERE c.relname = tablename
AND c.relkind = ''r'';

if found then
return ''t''::BOOLEAN;
else
return ''f''::BOOLEAN;
end if;
END;'
LANGUAGE 'plpgsql';

-- test table
CREATE TABLE realtable (id INTEGER);

-- test example
SELECT table_exists('realtable'::TEXT);
SELECT table_exists('faketable'::TEXT);

-- clean up
DROP TABLE realtable;
DROP FUNCTION table_exists(TEXT);

It'd be even nicer if you could drop the table from within the PL/pgSQL
function, but I found that does not work in 7.0.0.

#11Siuda Paweł DI Centrala
P.Siuda@gbg.com.pl
In reply to: Michael Davis (#3)
RE: Table msysconf

Thanks for Your help.
After creating table msysconf (with attribiutes: Config,nValue) everyfing
seems to be ok.
After creating table without attribute Config, there was still error info,
that attribiute 'config' not exists.

Do You exactly know what for is table msysconf used or where can I find
information about it?

Pawel.