Re: [GENERAL] Object like pg_class.relkind = 's' or 'c' have on-disk file?

2005-03-16 Thread Tom Lane
"Qingqing Zhou" <[EMAIL PROTECTED]> writes: > Pg_xactlock is always there as a special relation. pg_xactlock isn't really a relation. The way I think about it is that it's a dummy entry in pg_class that exists to reserve a relation OID for a specific purpose --- namely, we can lock transaction ID

Re: [GENERAL] foreign key help

2005-03-16 Thread Qingqing Zhou
You may want to have a look at pg DOMAIN (also conforms to SQL standard). http://www.postgresql.org/docs/8.0/static/sql-createdomain.html Regards, Qingqing "Dale Sykora" <[EMAIL PROTECTED]> writes > I am building a database that has about 20 fields in various tables that > I would like to con

Re: [GENERAL] Object like pg_class.relkind = 's' or 'c' have on-disk file?

2005-03-16 Thread Qingqing Zhou
Pg_xactlock is always there as a special relation. It has no footprint on disk. Transactions will keep a record in pg_xactlock at the beginning and remove the record at the end. Once any conflicting update happens, the latter transaction will use this relation to wait for the former transaction's r

Re: [GENERAL] Best practices: Handling Daylight-saving time

2005-03-16 Thread Christopher Browne
Don't use DST. Use GMT/UTC. That makes the issue go away. -- (reverse (concatenate 'string "gro.mca" "@" "enworbbc")) http://cbbrowne.com/info/slony.html Signs of a Klingon Programmer #2: "You question the worthiness of my code? I should kill you where you stand!" ---(

Re: [DOCS] Fast major-version upgrade (was: [GENERAL] postgresql 8.0

2005-03-16 Thread Bruce Momjian
Jim C. Nasby wrote: > > > Has anyone tried moving a database from one location to another on the > > > HD? I'd like to use slony to minimize downtime, but I'd also like my > > > data to end up in the same place it is right now when I'm done. > > > > I used a straight copy of the filesystem with ru

Re: [GENERAL] help with plpgsql function called by trigger

2005-03-16 Thread Michael Fuhr
On Wed, Mar 16, 2005 at 02:34:48PM -0500, Heather Johnson wrote: > CREATE FUNCTION insert_bd_join_bd (integer) RETURNS opaque AS ' What version of PostgreSQL are you using? The "opaque" type has been deprecated since 7.3; recent versions should use "trigger". And trigger functions aren't declare

Re: [GENERAL] 3rd RFD: comp.databases.postgresql (was: comp.databases.postgresql.*)

2005-03-16 Thread Vern
Marc G. Fournier wrote in Msg <[EMAIL PROTECTED]>: > it can't *hurt* to have the group ... I respectfully disagree with you, Marc. :) The PGSQL* hierarchy is now well distributed, and there is no need for a comp.* group. If anything, the ungated comp.* group will confuse newbies into thinking

[GENERAL] New PostGreSQL Newsgroup - VOTE TO BEGIN

2005-03-16 Thread Vern
After all these months, the NAN Usenet team has lined up a vote taker for the comp.databases.postgresql new group proposal. Expect voting to begin within a few days. The PGSQL* hierarchy is now well distributed, and there is no need for a comp.* group. If anything, the useless comp.* group will

[GENERAL] Object like pg_class.relkind = 's' or 'c' have on-disk file?

2005-03-16 Thread Katsuhiko Okano
Hi. I'm writing backup guide and script. I will look up on-disk-filename should be backuped in a pg_class, like: >SELECT oid,relfilenode,relname,relkind FROM pg_class; it return like: > 17173 | 17173 | sql_packages| r > 17182 | 17182 | pg_toast_17178_index

[GENERAL] search_path, schemas and functions...

2005-03-16 Thread Andrew B. Lundgren
I have a large amount of data that I am managing using schemas. The previous owner of the DB wrote functions to automatically create new schemas on demand, and sets of funtions to interact with them. Rather than maintain a set of functions that are dynamically re-written with every new schema I w

[GENERAL] foreign key help

2005-03-16 Thread Dale Sykora
I am building a database that has about 20 fields in various tables that I would like to constrain to a small group (<=5) of choices. Rather that refer to 20 seperate tables, I would like to refer to 1 table that contained category and choice fields. for example choices table category | choic

Re: [GENERAL] psql file restore - problem with encoding (solved)

2005-03-16 Thread Miroslav Åulc
We have solved the problem. Maybe someone will face the same problem so just to close this thread, the problem was in php.ini where a default output character set was set which caused the "second" recoding problem (just for display using php). Miroslav Åulc wrote: Hi all, I have problem on one

Re: [GENERAL] Data Recovery

2005-03-16 Thread Lonni J Friedman
On Wed, 16 Mar 2005 16:05:16 -0500, Alex Turner <[EMAIL PROTECTED]> wrote: > Ok - I found the log messages: > > ERROR: duplicate key violates unique constraint "features_pkey" > STATEMENT: insert into features > (propid,dtmodified,proptype,groupid,featid,group_desc,feat_desc) > values (449356005

Re: [GENERAL] Data Recovery

2005-03-16 Thread Alex Turner
This is the message I get when I try to start the database: LOG: database system was interrupted while in recovery at 2005-03-16 16:07:58 EST HINT: This probably means that some data is corrupted and you will have to use the last backup for recovery. LOG: checkpoint record is at 2B/553CED30 LOG

Re: [GENERAL] Data Recovery

2005-03-16 Thread Alex Turner
Ok - I found the log messages: ERROR: duplicate key violates unique constraint "features_pkey" STATEMENT: insert into features (propid,dtmodified,proptype,groupid,featid,group_desc,feat_desc) values (449356005,'3/9/2005 12:03:59 AM',1,26,1,'Water','PublicWater') PANIC: right sibling's left-link

Re: [GENERAL] Data Recovery

2005-03-16 Thread Lonni J Friedman
On Wed, 16 Mar 2005 16:02:58 -0500, Alex Turner <[EMAIL PROTECTED]> wrote: > Fsync was off - we are using XFS and the Microcontroller on the RAID > card Crashed and took two filesystems offline at about 2 a.m. Did you run xfs_repair afterwards? > There were some error messages in the postgres log

Re: [GENERAL] Data Recovery

2005-03-16 Thread Alex Turner
Fsync was off - we are using XFS and the Microcontroller on the RAID card Crashed and took two filesystems offline at about 2 a.m. There were some error messages in the postgres log, something like Update failed - right part of branch is wrong (I'm guessing - I'm trying to find the exact error - b

Re: [GENERAL] Data Recovery

2005-03-16 Thread Lonni J Friedman
On Wed, 16 Mar 2005 15:46:16 -0500, Alex Turner <[EMAIL PROTECTED]> wrote: > It's postgresl 8.01 on AMD 64 Suse 9.2. The database didn't dump > succesfully for several days in a row so the backup is corrupted also. > > The controller card crashed and we think caused data corruption. I > rebooted

Re: [GENERAL] Data Recovery

2005-03-16 Thread Alex Turner
It's postgresl 8.01 on AMD 64 Suse 9.2. The database didn't dump succesfully for several days in a row so the backup is corrupted also. The controller card crashed and we think caused data corruption. I rebooted the system the following day, and it came back up, but all was not well, pg_dump all

Re: [GENERAL] Data Recovery

2005-03-16 Thread Lonni J Friedman
On Wed, 16 Mar 2005 14:43:09 -0500, Alex Turner <[EMAIL PROTECTED]> wrote: > I have a crashed database fileset, and I'm wondering if there is any > way to recover the data from a specific table. I know which table got > corrupted, and it's not the table I am trying to recover. > > I know this is

[GENERAL] Data Recovery

2005-03-16 Thread Alex Turner
I have a crashed database fileset, and I'm wondering if there is any way to recover the data from a specific table. I know which table got corrupted, and it's not the table I am trying to recover. I know this is a little vague, but I'm not really sure what information would be pertinent.. Any he

[GENERAL] help with plpgsql function called by trigger

2005-03-16 Thread Heather Johnson
Hello-- I need to make sure that every time a row is inserted into a table called "users" rows are automatically inserted into two other tables: "join_bd" and "behavior_demographics". The inserts on join_bd and behavior_demographics need to create rows that are keyed to the users table with an

Re: [GENERAL] generating statistics

2005-03-16 Thread Michael Fuhr
On Wed, Mar 16, 2005 at 06:27:43PM +, vinita bansal wrote: > > Did you uncomment the settings in addition to setting them to true? > > Did you restart the database after making the configuration changes? > > Yes, I did. > FYI- I am using Postgres 8 Have you used SHOW to verify that the variabl

Re: [GENERAL] plpython function problem workaround

2005-03-16 Thread Michael Fuhr
[I've changed the Subject back to the thread that started this discussion.] On Wed, Mar 16, 2005 at 05:52:02PM +0100, Marco Colombo wrote: > I'm against to any on-the-fly conversion, now. > I don't like the idea of PostgreSQL accepting input in one form > (\r\n) and providing output in a differe

[GENERAL] dataKiosk 0.6 released

2005-03-16 Thread Adam Treat
Hello, I have released dataKiosk version 0.6. DataKiosk is a JuK-like database interface tool for generic SQL databases. What does that mean? Essentially, DataKiosk provides a series of wizards (anyone familiar with Qt Designer's database wizards will find them familiar) that allow you to bui

Re: [GENERAL] New user: Windows, Postgresql, Python

2005-03-16 Thread Marco Colombo
On Wed, 16 Mar 2005, Michael Fuhr wrote: On Wed, Mar 16, 2005 at 04:17:51PM +0100, Marco Colombo wrote: aprogram = "x = 1\nprint x\n"; printf(aprogram); PyRun_SimpleString(aprogram); See? THIS program requires compile-time or run-time checks. You can't run it on Windows, or Mac:

Re: [GENERAL] 2 questions about types

2005-03-16 Thread Richard Huxton
Jason Tesser wrote: There's an example in the manuals - chapter "7.2.1.4. Table Functions" SELECT * FROM dblink('dbname=mydb', 'select proname, prosrc from pg_proc') AS t1(proname name, prosrc text) WHERE proname LIKE 'bytea%'; So basically, you need to supply the type definitions in

Re: [GENERAL] 2 questions about types

2005-03-16 Thread Jason Tesser
> > There's an example in the manuals - chapter "7.2.1.4. Table Functions" > > SELECT * > FROM dblink('dbname=mydb', 'select proname, prosrc from pg_proc') >AS t1(proname name, prosrc text) > WHERE proname LIKE 'bytea%'; > > So basically, you need to supply the type definition

Re: [GENERAL] plPerl subroutine

2005-03-16 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, "FERREIRA William (COFRAMI)" <[EMAIL PROTECTED]> writes: > CREATE OR REPLACE FUNCTION adoc.CREATE_XML_FILE(docId int4, eleId int4, evo > int4, fileName text, fileRelativeDir text) >   RETURNS int4 AS > $BODY$ >  my $theClob=''; >   >  my $params = 'select > adoc.GET_

Re: [GENERAL] New user: Windows, Postgresql, Python

2005-03-16 Thread Michael Fuhr
On Wed, Mar 16, 2005 at 04:17:51PM +0100, Marco Colombo wrote: > > aprogram = "x = 1\nprint x\n"; > printf(aprogram); > PyRun_SimpleString(aprogram); > > See? THIS program requires compile-time or run-time checks. You > can't run it on Windows, or Mac: it'll write garbage to the

Re: [GENERAL] plPerl subroutine

2005-03-16 Thread Tom Lane
"FERREIRA William (COFRAMI)" <[EMAIL PROTECTED]> writes: > but the CREATE_XML_FILE doesn't display 'totototototototototot' but > HASH(0xf03fa4) I think what you get back from spi_exec_query is always going to be a hash, even if it contains only one field. So you need to pick out the field val

Re: [GENERAL] 2 questions about types

2005-03-16 Thread Richard Huxton
Jason Tesser wrote: OK here is an example of a function where I had to create a type called login. How could I have written this function without having to create a type. CREATE OR REPLACE FUNCTION "public"."loginbyindidget" (integer) RETURNS SETOF "public"."login" AS' [snip] There's an example in

Re: [GENERAL] generating statistics

2005-03-16 Thread Tom Lane
"vinita bansal" <[EMAIL PROTECTED]> writes: > I have set the following variables in postgresql.conf to true: > stats_start_collector,stats_command_string, stats_row_level, > stats_reset_on_server_start. Is the statistics collector actually starting? Look in "ps auxww" output to see if the postm

Re: [GENERAL] psql file restore - problem with encoding

2005-03-16 Thread John DeSoi
On Mar 16, 2005, at 9:34 AM, Miroslav Šulc wrote: I have problem on one of our potentional client's linux server with data encoding. I have played with this for some time but with no success. Here is the problem: Maybe try setting the client side encoding explicitly at the top of the dump file:

Re: [GENERAL] psql file restore - problem with encoding

2005-03-16 Thread Miroslav Šulc
John DeSoi wrote: On Mar 16, 2005, at 9:34 AM, Miroslav Šulc wrote: I have problem on one of our potentional client's linux server with data encoding. I have played with this for some time but with no success. Here is the problem: Maybe try setting the client side encoding explicitly at the top

Re: [GENERAL] New user: Windows, Postgresql, Python

2005-03-16 Thread Marco Colombo
On Wed, 16 Mar 2005, Michael Fuhr wrote: On Wed, Mar 16, 2005 at 01:46:23PM +0100, Marco Colombo wrote: It seems python documentation is plain wrong, or I'm not able to read it at all: http://docs.python.org/ref/physical.html "A physical line ends in whatever the current platform's convention is fo

Re: [GENERAL] generating statistics

2005-03-16 Thread Michael Fuhr
On Wed, Mar 16, 2005 at 02:08:49PM +, vinita bansal wrote: > I have set the following variables in postgresql.conf to true: > stats_start_collector,stats_command_string, stats_row_level, > stats_reset_on_server_start. Did you uncomment the settings in addition to setting them to true? > I

Re: [GENERAL] plPerl subroutine

2005-03-16 Thread Sean Davis
My understanding is that pl/perl functions are simply anonymous coderefs, so they can't call each other. What is it that you REALLY want to do? (The code looks a bit like a toy example.) Sean On Mar 16, 2005, at 9:17 AM, FERREIRA William (COFRAMI) wrote: hi   is it possible to create subroutin

Re: [GENERAL] psql file restore - problem with encoding

2005-03-16 Thread Miroslav Åulc
Just update - the system is Fedora Core 2, but the PostgreSQL is compiled from sources. Miroslav Åulc wrote: Hi all, I have problem on one of our potentional client's linux server with data encoding. I have played with this for some time but with no success. Here is the problem: I have dump fi

[GENERAL] psql file restore - problem with encoding

2005-03-16 Thread Miroslav Åulc
Hi all, I have problem on one of our potentional client's linux server with data encoding. I have played with this for some time but with no success. Here is the problem: I have dump file created with pg_dump on my dev linux machine (PostgreSQL 8.0.1). When I upload the file to the client's ser

Re: [GENERAL] New user: Windows, Postgresql, Python

2005-03-16 Thread Michael Fuhr
On Wed, Mar 16, 2005 at 01:46:23PM +0100, Marco Colombo wrote: > > It seems python documentation is plain wrong, or I'm not able to > read it at all: > > http://docs.python.org/ref/physical.html > > "A physical line ends in whatever the current platform's convention is for > terminating lines. O

Re: [GENERAL] prelimiary performance comparison pgsql vs mysql

2005-03-16 Thread Doug McNaught
"Joshua D. Drake" <[EMAIL PROTECTED]> writes: >> Also, a 32-bit machine can only hold so much RAM. If I'm correct, there >> are ways to address more memory than that on a 32 bit machine, but I >> wonder at what cost? In other words, is it a good idea to address more >> than 4GB on a 32 bit machine

[GENERAL] plPerl subroutine

2005-03-16 Thread FERREIRA William (COFRAMI)
Title: RE: [GENERAL] Convert Cursor to array hi   is it possible to create subroutines with plPerl ?   i tried this : CREATE OR REPLACE FUNCTION adoc.CREATE_XML_FILE(docId int4, eleId int4, evo int4, fileName text, fileRelativeDir text)  RETURNS int4 AS$BODY$ my $theClob='';  my $params = '

Re: [GENERAL] 2 questions about types

2005-03-16 Thread Jason Tesser
OK here is an example of a function where I had to create a type called login. How could I have written this function without having to create a type. CREATE OR REPLACE FUNCTION "public"."loginbyindidget" (integer) RETURNS SETOF "public"."login" AS' declare iindid alias for $1; returnRec RECORD;

[GENERAL] generating statistics

2005-03-16 Thread vinita bansal
Hi, I have set the following variables in postgresql.conf to true: stats_start_collector,stats_command_string, stats_row_level, stats_reset_on_server_start. I am trying to get a list of all used indices and referenced tables in the database for a particular run. According to the doc. the follow

Re: [GENERAL] 2 questions about types

2005-03-16 Thread Richard Huxton
Jason Tesser wrote: 1. i have a few funcions that depend on a type. i don't want to have to srop every function just so I can drop the type and recreat everything. Is there a better way to do this in Postgres? Not really - if you're redefining the type then the functions really have to be recrea

Re: [GENERAL] plpython function problem workaround

2005-03-16 Thread David
On Tue, Mar 15, 2005 at 03:41:37PM +, Ragnar Hafstað wrote: > On Tue, 2005-03-15 at 07:33 -0600, David wrote: > > > [about the line-termination problem in plpython] > > > I'd like to insert one note here. While I'm not particularly familiar > > with either perl or python, when I encountered

Re: [GENERAL] plpython function problem workaround

2005-03-16 Thread David
On Tue, Mar 15, 2005 at 02:50:06PM -0700, Michael Fuhr wrote: > On Tue, Mar 15, 2005 at 03:41:37PM +, Ragnar Hafstað wrote: > > > actually, perl scripts with \r\n line endings will run just fine in > > unix/linux. > > Indeed, and PL/Perl doesn't care. I just tested several PLs with > Postgre

Re: [GENERAL] Installation on XP - Permissions

2005-03-16 Thread John DeSoi
On Mar 15, 2005, at 6:14 PM, Glenn Sullivan wrote: When running the installer on XP, I get to the "Service Configuration" panel. When I enter the password and click OK, I get: Failed to open local computer policy. Unable to determine user account rights(5). If I click OK to that, the

[GENERAL] 2 questions about types

2005-03-16 Thread Jason Tesser
1. i have a few funcions that depend on a type. i don't want to have to srop every function just so I can drop the type and recreat everything. Is there a better way to do this in Postgres? 2. The reason I had to create my own type was because record didn't ork for me when I was selecting data

Re: [GENERAL] pg/plsql question

2005-03-16 Thread Fred Blaise
that worked :) thanks for your input fred On Tue, 2005-03-15 at 18:00 +, Ragnar Hafstað wrote: > On Tue, 2005-03-15 at 18:18 +0100, Fred Blaise wrote: > > While I have accomplished what I needed with the pgedit script given by > > John, I am still curious as to why mine is not working... > >