[GENERAL] How to dump data from database?

2005-04-04 Thread go
Hi! Tell me please is there any way to dump data from current session (instead of using pg_dump) ? igor mailto:[EMAIL PROTECTED] ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an

Re: [GENERAL] Empty date

2005-04-04 Thread Karsten Hilbert
On Sun, Apr 03, 2005 at 08:54:12PM -0400, Tom Lane wrote: area= select 'infinity'::timestamp::date is null; ?column? -- t (1 row) Ah, thanks. I think this is a bug BTW. If we can't convert the value correctly, we ought to raise an error not return NULL. Which is *why* I

[GENERAL] field definitions in view results?

2005-04-04 Thread Klint Gore
I'm having a problem that when I do a view with union between 2 tables that have varchar(8) fields, that the (8) seems to be missing from the result. e.g. create table t1 (astr varchar(8)); create table t2 (astr varchar(8)); create view v1 as select * from t1 union select * from t2;

Re: [GENERAL] How to dump data from database?

2005-04-04 Thread Michael Fuhr
On Mon, Apr 04, 2005 at 11:18:08AM +0400, go wrote: Tell me please is there any way to dump data from current session (instead of using pg_dump) ? What exactly are you trying to do? Will COPY (or psql's \copy) do what you want? -- Michael Fuhr http://www.fuhr.org/~mfuhr/

Re: [GENERAL] How to dump data from database?

2005-04-04 Thread go
I would like to pg_dump -Fc MyDataBasearchiv.dat ( maybe there is any SQL command or something else) . in case with COPY command I have to copy each table one by one. And pls one small question - what query will return me a list of tables in database ( \l - works only in psql)? Thanks! MF

[GENERAL]

2005-04-04 Thread pck
Hi, I've got PgSQL 7.4 on FreeBSD 4. When I try to dump database: /usr/local/bin/pg_dump database --username=user -d database.sql It shows me these errors and stops: pg_dump: dumpClasses(): SQL command failed pg_dump: Error message from server: ERROR: invalid page header in block 9869 of

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Marco Colombo
[Cc: list purged a bit] On Sun, 3 Apr 2005, Jim C. Nasby wrote: On Sun, Apr 03, 2005 at 08:41:15PM -0700, Joshua D. Drake wrote: None on the server side (except PostgreSQL) which makes the argument all that more powerful :) So what you're saying is that no database sounds complete because no

Re: [GENERAL] ERROR: invalid page header in block 9869

2005-04-04 Thread pck
Sorry, i've forgot the subject... On Apr 4, 2005 11:14 AM, pck [EMAIL PROTECTED] wrote: Hi, I've got PgSQL 7.4 on FreeBSD 4. When I try to dump database: /usr/local/bin/pg_dump database --username=user -d database.sql It shows me these errors and stops: pg_dump: dumpClasses(): SQL

[GENERAL] stored procedures / C-Language

2005-04-04 Thread FERREIRA William (COFRAMI)
Title: stored procedures / C-Language hi, i'm trying to find some documentation about writing stored procedures with C-language. i found description in postgresql's documentation but i don't understand everything. Aat present, i have a pl/perl stored procedure but it isn't fast enough, so

[GENERAL] Raise Exception

2005-04-04 Thread Mario Reis
Dear Sir, I' ve recently join to PostGreSql community. I'm testing it on a local network and I'm very found of it . However there are a few things that I'd like to understand better. As far as i realise, every time the Server validates a wrong value for an input it Raises an Exception with

Re: [GENERAL] stored procedures / C-Language

2005-04-04 Thread Magnus Hagander
Title: stored procedures / C-Language hi, i'm trying to find some documentation about writing stored procedures with C-language. i found description in postgresql's documentation but i don't understand everything. Aat present, i have a pl/perl stored procedure but it isn't

[GENERAL] Time

2005-04-04 Thread Rob Kirkbride
Hi, I'm trying to fetch out the epoch value of a time, the data type is 'timestamp with time zone'. When I do select extract(epoch from time) it returns a fractional part as well. Am I doing this the correct way? Is the fractional part microseconds? Thanks for any help, Rob

Re: [GENERAL] Time

2005-04-04 Thread Ragnar HafstaĆ°
On Mon, 2005-04-04 at 13:49 +0100, Rob Kirkbride wrote: Hi, I'm trying to fetch out the epoch value of a time, the data type is 'timestamp with time zone'. When I do select extract(epoch from time) it returns a fractional part as well. Am I doing this the correct way? Is the fractional

Re: [GENERAL] Strange plpgsql performance -- arithmetic, numeric()

2005-04-04 Thread Karl O. Pinc
On 04/03/2005 08:04:27 PM, Tom Lane wrote: Karl O. Pinc [EMAIL PROTECTED] writes: Incrementing the loop counter by a factor of 10, from 1000 to 1 makes the process take more than 100 times longer. (I only saw this happen when I happened upon using a numeric() datatype and then dividing

Re: [GENERAL] Crazy Multiplication Issue

2005-04-04 Thread John Burger
Howdy Gents- Howdy to everyone else. I am multiplying two columns it doesn't matter what their data type is not does it seem to matter if I explicitly cast these values to some other data type every time they are multiplied I am getting an incorrect result. col1 = 213.1086 col2 = 0.833 If I

Re: [GENERAL] Vacuum time degrading

2005-04-04 Thread Wes
On 3/2/05 10:50 PM, Tom Lane [EMAIL PROTECTED] wrote: It wouldn't be easy --- there are some locking considerations that say btbulkdelete needs to scan the index in the same order that an ordinary scan would do. See the nbtree README for details. Just a follow-up on this.. The vacuum time

[GENERAL] Vacuum, statistics, trigger/procedure query plan caching

2005-04-04 Thread Karl O. Pinc
Hi, IIRC I once figured out that, for triggers at least, query plans are cached with the connection. This means that vacuuming and thus alterations in the statistics do not take effect until a connection is broken and re-established. Mostly. At least for triggers. I think. (In 7.4?) I can't seem

Re: [GENERAL] Vacuum time degrading

2005-04-04 Thread Tom Lane
Wes [EMAIL PROTECTED] writes: On 3/2/05 10:50 PM, Tom Lane [EMAIL PROTECTED] wrote: It wouldn't be easy --- there are some locking considerations that say btbulkdelete needs to scan the index in the same order that an ordinary scan would do. See the nbtree README for details. Just a

[GENERAL] invalid input syntax for type bytea

2005-04-04 Thread Janning Vygen
Hi, i have a databse in postgresql 7.4 with some pdf files in a bytea column. everything works fine but sometimes when i dump and restore i get psql:../tmp/dump.sql:704022: ERROR: invalid input syntax for type bytea CONTEXT: COPY dk_dokument, line 127, column dk_content:

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Joshua D. Drake
Sorry, but I don't buy it. I do. Actually I think no database is complete because no one includes LISP as a procedural language (pun on procedural intented). (BTW, I have no idea if a pl/LISP module ever existed.) O.k. this is just a little sick ;0... Module-2 here I come. Sincerely, Joshua D.

Re: [GENERAL] How to query pgsql from a BASH script ?

2005-04-04 Thread Martijn van Oosterhout
On Sun, Apr 03, 2005 at 11:17:41PM +0200, Pavel Stehule wrote: test=# select * from foo; a | b + 10 | 10 10 | 20 pgbash retval=`select a,b from foo;` pgbash echo $retval a | b + 10 | 10 10 | 20 (2 rows) The way I usually do it in scripts is: psql '-Ftab' -A -t -c

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Joshua D. Drake
Honestly, I think if we're going to spend time worrying about languages as features then we should be doing more to advertise the fact that perl/PHP/python/ruby/etc programmers can program in the database in their native language. I agree with you completely. This is something that makes

Re: [GENERAL] field definitions in view results?

2005-04-04 Thread Tom Lane
Klint Gore [EMAIL PROTECTED] writes: Is there any way to get the (8) limit on the view result without doing create view v1 as select cast(v2.astr as varchar(8)) as astr from (select * from t1 union select * from t2) v2 No. This is an open issue for 8.1, see

Re: [GENERAL] How to query pgsql from a BASH script ?

2005-04-04 Thread Michelle Konzack
Am 2005-04-03 23:17:41, schrieb Pavel Stehule: I remeber other project http://www.edlsystems.com/shellsql Thanks I will heck it out immediatly... pgbash is a real killer but I can not apply the patches becasue it ends in a error. bye Pavel Stehule Greetings Michelle -- Linux-User

[GENERAL] UNICODE encoding and jdbc related issues

2005-04-04 Thread Chris Kratz
Our production database was created with the default SQL_ASCII encoding. It appears that some of our users have entered characters into the system with characters above 127 (accented vowels, etc). None of the tools we use currently have had a problem with this behavior until recently,

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Andrew Dunstan
Tom Lane wrote: Marc G. Fournier [EMAIL PROTECTED] writes: On Fri, 1 Apr 2005, Joshua D. Drake wrote: Are we interested in having plPHP in core? Is there a reason why it can no longer operate as a standalone language out of pgfoundry, like pl/java and pl/perl? I have said

Re: [GENERAL] invalid input syntax for type bytea

2005-04-04 Thread Tom Lane
Janning Vygen [EMAIL PROTECTED] writes: i have a databse in postgresql 7.4 with some pdf files in a bytea column. everything works fine but sometimes when i dump and restore i get psql:../tmp/dump.sql:704022: ERROR: invalid input syntax for type bytea CONTEXT: COPY dk_dokument, line 127,

Re: [GENERAL] Recovering real disk space

2005-04-04 Thread Thomas F . O'Connell
Isn't this also a symptom of inappropriate FSM settings? Try running a VACUUM VERBOSE and check the FSM settings at the end. -tfo -- Thomas F. O'Connell Co-Founder, Information Architect Sitening, LLC Strategic Open Source Open Your i http://www.sitening.com/ 110 30th Avenue North, Suite 6

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: ... If there are no license or build issues I'm in favor. Peter has pointed out that the problem of circular dependencies is a showstopper for integrating plPHP. The build order has to be Postgres PHP (since its existing DB support

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan [EMAIL PROTECTED] writes: ... If there are no license or build issues I'm in favor. Peter has pointed out that the problem of circular dependencies is a showstopper for integrating plPHP. The build order has to be Postgres PHP (since its

Re: [GENERAL] Raise Exception

2005-04-04 Thread Alvaro Herrera
On Mon, Apr 04, 2005 at 09:24:17AM -, Mario Reis wrote: [Cc: to pgsql-hackers dropped] As far as i realise, every time the Server validates a wrong value for an input it Raises an Exception with the check failure for each input for each record For example, for each invalid foreing

Re: [GENERAL] How to query pgsql from a BASH script ?

2005-04-04 Thread Pavel Stehule
Thanks I will heck it out immediatly... pgbash is a real killer but I can not apply the patches becasue it ends in a error. pgbash is nice, but without actualisation. You have to use good version of bash, [EMAIL PROTECTED] stehule]$ pgbash --version GNU bash, version

[GENERAL] Checking cursor's state in plpgsql

2005-04-04 Thread Sibtay Abbas
Hello all Can we check whether a cursor is OPEN or not in plpgsql. Like in oracle you can check a CURSOR'S state with CURSOR_VAR%ISOPEN After navigating the documentation i was not able to find an equivalent in plpgsql. Do we have an alternative to this in plpgsql? Thankz

[GENERAL] Regarding niladic functions

2005-04-04 Thread Chandra Sekhar Surapaneni
Hi All, Can we write our own niladic functions in 8.0.0? I want to write a niladic function similar to current_timestamp, but I did not find any information in the documentation. Thank you for your time Regards chandu ---(end of broadcast)--- TIP

Re: [GENERAL] How to dump data from database?

2005-04-04 Thread John DeSoi
On Apr 4, 2005, at 5:11 AM, go wrote: And pls one small question - what query will return me a list of tables in database ( \l - works only in psql)? Startup of psql with the -E option (or use \set ECHO_HIDDEN 1). Then psql will show you the query it uses for \l or any other \ command. John

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Joshua D. Drake
Tom Lane wrote: Andrew Dunstan [EMAIL PROTECTED] writes: ... If there are no license or build issues I'm in favor. Peter has pointed out that the problem of circular dependencies is a showstopper for integrating plPHP. The build order has to be Postgres PHP (since its existing DB

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Andrew Dunstan
Robert Treat wrote: On Monday 04 April 2005 12:01, Tom Lane wrote: Andrew Dunstan [EMAIL PROTECTED] writes: ... If there are no license or build issues I'm in favor. Peter has pointed out that the problem of circular dependencies is a showstopper for integrating plPHP. The build

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Tom Lane
Robert Treat [EMAIL PROTECTED] writes: On Monday 04 April 2005 12:01, Tom Lane wrote: Peter has pointed out that the problem of circular dependencies is a showstopper for integrating plPHP. AFAICT Peter's claim is false. You can install plphp in the order of PHP, PostgreSQL,plPHP which is

[GENERAL] about allow reporting of which objects are in which tablespace?

2005-04-04 Thread Ying Lu
Hello, I just want to know is the following item in the TODO list available now? If it is ready, may I know the commands or functions to retrieve objects in a specific tablespace please? * Allow reporting of which objects are in which tablespaces Thanks a lot, Emi

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Tom Lane
Joshua D. Drake [EMAIL PROTECTED] writes: Maybe I am just dense, but the argument seems to be completely moot. PHP is no different than Perl or Python in this case. Perl and Python don't have BuildPrereq: postgresql-devel in their rpmspecs. PHP does. regards, tom lane

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Joshua D. Drake
I am told that the difference is that PHP gives you a choice of statically or dynamically linked db support. By contrast, in Perl, for example, DBD::Pg is always built dynamically (AFAIK). Your assessment appears to be true for the (very common) case where PHP's client side db support is

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Robert Treat
On Mon, 2005-04-04 at 16:17, Tom Lane wrote: Robert Treat [EMAIL PROTECTED] writes: On Monday 04 April 2005 12:01, Tom Lane wrote: Peter has pointed out that the problem of circular dependencies is a showstopper for integrating plPHP. AFAICT Peter's claim is false. You can install

Re: [GENERAL] about allow reporting of which objects are in which tablespace?

2005-04-04 Thread elein
There is a new project on pgfoundry, newsysviews, that is addressing this and similar reporting issues. --elein [EMAIL PROTECTED]Varlena, LLCwww.varlena.com PostgreSQL Consulting, Support Training

Re: [GENERAL] diskspace usage recovered on db rebuild

2005-04-04 Thread David Link
Thank you Scott and Lonni for your replies ... On Fri, 2005-04-01 at 11:21, David Link wrote: I have a question regarding filesystem disk space usage. We have a production database containing 5 years of sales data. Linux 2.6.5; Postgresq 7.4.7. VACUUM ANALZYE the entire database everynight

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Joshua D. Drake
Tom Lane wrote: Joshua D. Drake [EMAIL PROTECTED] writes: Maybe I am just dense, but the argument seems to be completely moot. PHP is no different than Perl or Python in this case. Perl and Python don't have BuildPrereq: postgresql-devel in their rpmspecs. PHP does. That makes perfect

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Doug McNaught
Robert Treat [EMAIL PROTECTED] writes: If by stripped down you mean without postgresql database support then I'll grant you that, but it is no different than other any other pl whose parent language requires postgresql to be installed. If packagers are able to handle those languages than why

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Alvaro Herrera
On Mon, Apr 04, 2005 at 04:48:50PM -0400, Robert Treat wrote: If by stripped down you mean without postgresql database support then I'll grant you that, but it is no different than other any other pl whose parent language requires postgresql to be installed. If packagers are able to handle

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Robert Treat
On Mon, 2005-04-04 at 17:00, Doug McNaught wrote: Robert Treat [EMAIL PROTECTED] writes: If by stripped down you mean without postgresql database support then I'll grant you that, but it is no different than other any other pl whose parent language requires postgresql to be installed. If

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Robert Treat
On Mon, 2005-04-04 at 17:03, Alvaro Herrera wrote: On Mon, Apr 04, 2005 at 04:48:50PM -0400, Robert Treat wrote: If by stripped down you mean without postgresql database support then I'll grant you that, but it is no different than other any other pl whose parent language requires

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Joshua D. Drake
Alvaro Herrera wrote: On Mon, Apr 04, 2005 at 04:48:50PM -0400, Robert Treat wrote: The problem is that even if you could build a Postgres support package for PHP without building the whole PHP (which you _can_ do AFAIK), it means that you need to make a second pass at the PHP source RPM, which

[GENERAL] cygwin and psql

2005-04-04 Thread YL
I'm installing psql to my laptop where cygwin is installed. I got the warning for removing the cygwin\bin from the path and re-start the installer. It's not hard to remove cygwin from the path. Does qsql need to remove cygwin permanently? Thanks No virus found in this outgoing message.

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Paul Tillotson
Joshua D. Drake wrote: Honestly, I think if we're going to spend time worrying about languages as features then we should be doing more to advertise the fact that perl/PHP/python/ruby/etc programmers can program in the database in their native language. I agree with you completely. Although

Re: [GENERAL] [HACKERS] plPHP in core?

2005-04-04 Thread Tom Lane
Paul Tillotson [EMAIL PROTECTED] writes: Thus, even though I know very little about Ruby or TCL, I would gladly learn one of those if I knew that plruby or pltcl did all the stuff that a pl should (wasn't missing functionality such as writing triggers, set-returning functions), was

Re: [GENERAL] How to dump data from database?

2005-04-04 Thread Michael Fuhr
On Mon, Apr 04, 2005 at 01:11:20PM +0400, go wrote: I would like to pg_dump -Fc MyDataBasearchiv.dat ( maybe there is any SQL command or something else) . in case with COPY command I have to copy each table one by one. I suppose you could write a function in a procedural language like

Re: [GENERAL] How to dump data from database?

2005-04-04 Thread Michael Fuhr
[Please copy the mailing list on replies.] On Tue, Apr 05, 2005 at 08:07:47AM +0400, go wrote: MF On Mon, Apr 04, 2005 at 01:11:20PM +0400, go wrote: I would like to pg_dump -Fc MyDataBasearchiv.dat ( maybe there is any SQL command or something else) . in case with COPY command I have

Re: [GENERAL] Regarding niladic functions

2005-04-04 Thread Neil Conway
Chandra Sekhar Surapaneni wrote: Can we write our own niladic functions in 8.0.0? I want to write a niladic function similar to current_timestamp, but I did not find any information in the documentation. If you mean a function without any arguments, it is trivial: CREATE FUNCTION foo() RETURNS

Re: [GENERAL] How to dump data from database?

2005-04-04 Thread go
Hi, Michael. I would like to add the possibility of archiving database from application. I cannt add archiving in schedule - because there is no server running all day round . And in the end of day any user can dump database when neccesary. (there is some problems with running script which

Re: [GENERAL] Regarding niladic functions

2005-04-04 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] writes: If you mean a function that doesn't take any arguments and can be invoked without an empty set of parentheses (like current_timestamp), there isn't a way to define such a function via SQL. You could probably hack the SQL parser to add support for