Re: [GENERAL] hi, what is wrong with my newbie sql?

2006-09-27 Thread Andreas Kretschmer
Ronin [EMAIL PROTECTED] schrieb: Hi, the following sql returns 10 and not 20 as would be expected. Where is the error? This would for sure work in any programming language, why is this different? CREATE FUNCTION test () RETURNS INTEGER AS ' DECLARE k integer;

Re: [GENERAL] Advantages of postgresql

2006-10-02 Thread Andreas Kretschmer
Iulian Manea [EMAIL PROTECTED] schrieb: Hello everybody, So far I have only been working with MySQL. Today I was talking to a friend and he was suggesting I migrated to postgreSQL, as it is way better My question is why? I mean could someone pls tell me some advantages and

Re: [GENERAL] PostgreSQL Database Transfer between machines(again)

2006-10-05 Thread Andreas Kretschmer
Brian J. Erickson [EMAIL PROTECTED] schrieb: I appologize for duplicate posting, but I am not sure if this is getting posted to the news group. Problem: PostgreSQL Service is not runing on a Linux Box, Why not? but I have a database on the Linux Box, that I want to relocate to another

Re: [GENERAL] Is it possible to return custom type as proper ROW?

2006-10-11 Thread Andreas Kretschmer
Joe Kramer [EMAIL PROTECTED] schrieb: I want to get: item_id | last_update - 32 | 1234-12-12 12:12:12 Untested: SELECT item_id, last_update from public.new_item(3,2); HTH, Andreas -- Really, I'm not out to destroy Microsoft. That will

Re: [GENERAL] Resetting Serial Column Sequence Number

2006-10-14 Thread Andreas Kretschmer
Adam [EMAIL PROTECTED] schrieb: I just emptied my table and I want all my new inserts to start with a 'location_id' of '1'. The table is named locations with a SERIAL column location_id I tried the below SQL to rest the sequence ID but it's not working. What am I doing wrong?

Re: [GENERAL] Resetting Serial Column Sequence Number

2006-10-14 Thread Andreas Kretschmer
Andreas Kretschmer [EMAIL PROTECTED] schrieb: Adam [EMAIL PROTECTED] schrieb: I just emptied my table and I want all my new inserts to start with a 'location_id' of '1'. The table is named locations with a SERIAL column location_id I tried the below SQL to rest the sequence ID

Re: [GENERAL] Dates rejected

2006-10-16 Thread Andreas Kretschmer
Carlos H. Reimer [EMAIL PROTECTED] schrieb: Hi, WeŽve a simple insert that is not working. The strange thing is that all kind of date are working with the exception of 15/10 (DD/MM) dates. create table tt_teste (datfis timestamp without time zone not null CHECK (datfis =

Re: [GENERAL] Dates rejected

2006-10-16 Thread Andreas Kretschmer
Martijn van Oosterhout kleptog@svana.org schrieb: create table tt_teste (datfis timestamp without time zone not null CHECK (datfis = trunc(datfis::timestamp without time zone))); What are you trying to do here? If you only want a date, why not just use a date type? This is an other

Re: [GENERAL] Real time query analyzer

2006-10-16 Thread Andreas Kretschmer
Adrian Suciu [EMAIL PROTECTED] schrieb: Hi everybody! I ask you for your help on a problem I have. I have a postgresql 7.4 running on a dual 4 GB RAM server, but I have some VERY memory intense queries, that put processor up to 40%. I see all this info in unix top command or ps -aux

Re: [GENERAL] How to split a table?

2006-10-17 Thread Andreas Kretschmer
Felix Zhang [EMAIL PROTECTED] schrieb: Hi, I want to split a table to 2 small tables. The 1st one contains 60% records which are randomly selected from the source table. How to do it? Why do you want to do this? Andreas -- Really, I'm not out to destroy Microsoft. That will just be a

Re: [GENERAL] Any documatation about porting from Oracle to PostgreSQL

2006-10-17 Thread Andreas Kretschmer
Felix Zhang [EMAIL PROTECTED] schrieb: Hi all, I'm a newbie of PostgreSQL. I'm searching materials about porting from Oracle to PostgreSQL. Anyone can share with me some good documatations? http://techdocs.postgresql.org/#convertfrom Andreas -- Really, I'm not out to destroy Microsoft.

Re: [GENERAL] limit left join rows to 1

2006-10-31 Thread Andreas Kretschmer
Jure Ložar [EMAIL PROTECTED] schrieb: Hi. Is it possible to limit number of left join rows that match condition to 1? I don't want to have hits from first table multiplied when more then 1 row matches on left join condition. I'm not sure if i understand you correctly, but perhaps this is

Re: [GENERAL] pg_dump question

2006-11-02 Thread Andreas Kretschmer
Alvaro Herrera [EMAIL PROTECTED] schrieb: I would like to use pg_dump to backup a list of tables to one file, but it looks like the -t option only supports one file. So, pg_dump gives you the option of backing up and entire database or one file, but nothing in between. Am I

Re: [GENERAL] Is there anyway to...

2006-11-02 Thread Andreas Kretschmer
louis gonzales [EMAIL PROTECTED] schrieb: Hey Brian, Yeah I had considered this, using cron, I just feel like that is too dirty. Why? Actually I didn't see Andreas' post, can someone forward that? Sorry, i posted to the list, and i can see my mail. I'm running this application on

Re: [GENERAL] Is there anyway to...

2006-11-02 Thread Andreas Kretschmer
Ron Johnson [EMAIL PROTECTED] schrieb: Take a look at http://pgfoundry.org/projects/pgjob/ I did. Latest File Releases Package Version DateNotes / Monitor Download This Project Has Not Released Any Files OMG. Sorry. Andreas -- Really, I'm not out to destroy

Re: [GENERAL] problem accessing a database

2006-11-03 Thread Andreas Kretschmer
Luca Ferrari [EMAIL PROTECTED] schrieb: On Friday 03 November 2006 16:17 A. Kretschmer's cat, walking on the keyboard, wrote: Yes, this is okay. Do you have an other line with host all all ... below this line? Have you restart/reload the database after editing? Of course I've a

Re: [GENERAL] Can PostgreSQL reside on the same server as MSDE?

2006-11-03 Thread Andreas Kretschmer
[EMAIL PROTECTED] [EMAIL PROTECTED] schrieb: Any issues with running PostgreSQL on a Windows 2003 server that already has Microsoft SQL Server Desktop Engine? What about with MS SQL Server? You can do this without problems. Andreas -- Really, I'm not out to destroy Microsoft. That will

Re: [GENERAL] creating a dumpfile from a view

2006-11-03 Thread Andreas Kretschmer
[EMAIL PROTECTED] [EMAIL PROTECTED] schrieb: Hi, I'm trying to create a dumpfile for a client. The data is gathered from about 7 tables, and I need to output all the columns as the client wishes. I figure the best way to this is to collect data from multiple tables and putting them into a

Re: [GENERAL] Odd dump/restore question

2006-11-03 Thread Andreas Kretschmer
numb3rs [EMAIL PROTECTED] schrieb: I have Postgresql DB on a local machine that is updated periodically. I could have a script that would run pg_dump and then ftp it up to the host machine each 15 minutes say. Would I then be able to run pg_restore each time autonomously on the host

Re: [GENERAL] Converting a timestamp to a time

2006-11-05 Thread Andreas Kretschmer
Mark Morgan Lloyd [EMAIL PROTECTED] schrieb: What is the correct (or even any :-) way of converting a timestamp into a time (without timezone etc.)? You can CAST it: test=# select now(); now --- 2006-11-05 11:16:05.205235+01 (1 row) test=# select

Re: [GENERAL] help with a query

2006-11-05 Thread Andreas Kretschmer
Pedro Doria Meunier [EMAIL PROTECTED] schrieb: Hi all! This is most certainly a lame question but perhaps someone is gracious enough to lend me a hand ;-) I have the following setup in a table: The first record which is to be found (ok easy enough :D) with a timestamp meets a

Re: [GENERAL] max_fsm_pages

2006-11-05 Thread Andreas Kretschmer
Naz Gassiep [EMAIL PROTECTED] schrieb: NOTICE: number of page slots needed (27056) exceeds max_fsm_pages (2) HINT: Consider increasing the configuration parameter max_fsm_pages to a value over 27056. VACUUM conwatchlive=# What does this mean? I assume it has nothing to do with the

Re: [GENERAL] Converting a timestamp to a time

2006-11-05 Thread Andreas Kretschmer
Mark Morgan Lloyd [EMAIL PROTECTED] schrieb: test=# select now()::time; now 11:16:18.22527 (1 row) Thanks Andreas, I've ended up using CAST( ... AS TIME). I think the :: notation might be fragile in this instance because of the machine-generated SQL which

Re: [GENERAL] running external programs

2006-11-07 Thread Andreas Kretschmer
km [EMAIL PROTECTED] schrieb: Hi all, Is it possible in a PLSQL function to call an external program/script residing at /usr/bin and return the result ? No, because plsql is a trusted language. You can't run external commands from such a language. are there any workarounds for this

Re: [GENERAL] Problem with pg_dump

2006-11-10 Thread Andreas Kretschmer
Alex Turner [EMAIL PROTECTED] schrieb: Sure thing, I hope it's as simple as user error! #!/bin/sh export DATE=`date +%Y%m%d` /usr/local/pgsql/bin/pg_dump -Upostgres -hlocalhost trend /backup/ trend.dump.$DATE Thats pretty much it repeated for each database. I just upgraded to 8.1.5

Re: [GENERAL] FK pointing to a VIEW

2006-11-10 Thread Andreas Kretschmer
Sandro Dentella [EMAIL PROTECTED] schrieb: Do I understad correctly that i cannot point a Foreign Key to a view? Which is the rationale of this? A VIEW is simply a regular SELECT ..., a string that contains a SELECT. Question: How can you add a FK to a string? You can add a FK to a table, no

Re: [GENERAL] specify whitch index to use

2006-11-12 Thread Andreas Kretschmer
[EMAIL PROTECTED] [EMAIL PROTECTED] schrieb: I have two indexes on a table on cols col1 and col2, the table has ~10M rows on pg v8.1.4 when I use where col1 = val1 the query is fast and returns 0 rows when I use where col2 val2 the query is slow and returns ~1M rows in both cases the

Re: [GENERAL] log database changes - a design problem?

2006-11-23 Thread Andreas Kretschmer
Luca Ferrari [EMAIL PROTECTED] schrieb: Here comes my question: how can I catch user changes to each record in the database without be bored with user/date details? Anyone can suggest me a smart solution and/or database design? Anyone has already found such kind of problem? Perhaps is

Re: [GENERAL] Ident authentication failed for user - URGENT

2006-12-05 Thread Andreas Kretschmer
Marina Olhovsky [EMAIL PROTECTED] schrieb: Hello, I'm trying to assign a password for a postgres user. I've logged in as postgres, issued alter user my_user with password 'my_passwd'. Doing select * from pg_users shows the new user with password assigned. However, when I try to

Re: [GENERAL] Male/female

2006-12-08 Thread Andreas Kretschmer
Raymond O'Donnell [EMAIL PROTECTED] schrieb: Just wondering.how do list member represent gender when storing details of people in a database? I've done it two ways: * A bool column, with the understanding that true/false represents one gender or the other. * Create a domain,

Re: [GENERAL] Tricky join question

2006-12-22 Thread Andreas Kretschmer
Tim Tassonis [EMAIL PROTECTED] schrieb: This is absolutely not what I want. I want a row for every person and every course, regardless whether the person has taken the course or not. If the person has not taken the course, I want a null value in the person id column: test=# select c.id,

Re: [GENERAL] permission denied for relation

2007-01-01 Thread Andreas Kretschmer
Armon Ezra [EMAIL PROTECTED] schrieb: while browsing a web site (which I am trying to handle), I get an error message like this: * Warning*: pg_query() [function.pg-query]: Query failed: ERROR: permission denied for relation -table name- in... on line 45 I believe it has a

Re: [GENERAL] Deleting From View?

2007-01-05 Thread Andreas Kretschmer
Jeanna Geier [EMAIL PROTECTED] schrieb: Hello List! I'm having an issue with my program; it's inserting into one record into a view (named 'measurement') twice ,which it's not supposed to be - so, I'm You can't insert data into a view. My guess: you have a RULE for this VIEW to handle

Re: [GENERAL] Sorting

2007-01-08 Thread Andreas Kretschmer
Ragnar [EMAIL PROTECTED] schrieb: test=*# select w, case when w ~ '^[0-9]*$' then w::int else 1 end from foo order by 2,1; possible improvements: a) w ~ '^[0-9]+$' b) use NULL instead of 1 Thanks, right. Andreas -- Really, I'm not out to destroy Microsoft. That will just

Re: [GENERAL] SQL problem..

2007-06-30 Thread Andreas Kretschmer
Bauhaus [EMAIL PROTECTED] schrieb: Hello, I'm an Access/SQL novice and I have an sql problem: I have the following table Price: FuelID PriceDate Price LPG1/05/2007 0,2 LPG13/05/2007 0,21 SPS 2/05/2007 1,1 SPS 15/05/2007 1,08 And I have to make the following

Re: [GENERAL] serial grows on failed requests

2007-08-17 Thread Andreas Kretschmer
rihad [EMAIL PROTECTED] schrieb: When I do an insert that fails (like FK inconsistency, illegal value, etc.) the users.id grows nonetheless... This is unacceptable for my current normal behavior. needs. Any way to prevent that while still maintaining ease of use? Using PostgreSQL 8.2.4

Re: [GENERAL] creating/dropping tables inside functions?

2007-09-11 Thread Andreas Kretschmer
George Pavlov [EMAIL PROTECTED] schrieb: foo= select * from f(); ERROR: relation with OID 1469396 does not exist CONTEXT: SQL statement SELECT a from t PL/pgSQL function f line 4 at select into variables the second invocation does not see the newly created temp table... Right, normal

Re: [GENERAL] Request: Anyone using bogus / humorous X-Message-Flag headers, could we please turn them off

2007-10-05 Thread Andreas Kretschmer
Bill Bartlett [EMAIL PROTECTED] schrieb: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of A. Kretschmer Sent: Friday, October 05, 2007 10:57 AM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] Request: Anyone using bogus /

Re: [GENERAL] drop table cascade doesn't drop manual sequences

2007-10-14 Thread Andreas Kretschmer
Tom Lane [EMAIL PROTECTED] schrieb: Scott Marlowe [EMAIL PROTECTED] writes: On 10/10/07, Guilherme [EMAIL PROTECTED] wrote: If I insert a sequence later on table creation with alter table, drop table cascade simply doesn't drop this sequence even when I specify CASCADE. This is

Re: [GENERAL] pg_dump SERIAL and SEQUENCE

2007-10-18 Thread Andreas Kretschmer
Laurent ROCHE [EMAIL PROTECTED] schrieb: Then when I drop tab_b, the SEQUENCE tab_b_colb1_seq is not dropped, however when I drop tab_a, the SEQUENCE tab_a_cola1_seq is dropped too ! I am using PG 8.1 and ALTER SEQUENCE ... OWNED BY does not exist ! ! ! Read this message: [EMAIL PROTECTED]

Re: [GENERAL] INDEX and JOINs

2007-10-27 Thread Andreas Kretschmer
Reg Me Please [EMAIL PROTECTED] schrieb: How can I Increasing the statistics target for the larger table? I'ìm sorry for asking, but I'm not that deep into RDBMS. alter table table alter column column SET STATISTICS value; Andreas -- Really, I'm not out to destroy Microsoft. That will just

Re: [GENERAL] INDEX and JOINs

2007-10-27 Thread Andreas Kretschmer
Reg Me Please [EMAIL PROTECTED] schrieb: Il Saturday 27 October 2007 08:51:09 Andreas Kretschmer ha scritto: Reg Me Please [EMAIL PROTECTED] schrieb: How can I Increasing the statistics target for the larger table? I'ìm sorry for asking, but I'm not that deep into RDBMS. alter table

Re: [GENERAL] active connections

2007-10-31 Thread Andreas Kretschmer
João Paulo Zavanela [EMAIL PROTECTED] schrieb: I don't understand, where I do it? A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? Please no top-posting, it's hard to

Re: [despammed] Re: [GENERAL] ~/pgpass

2005-08-15 Thread Andreas Kretschmer
Oluwatope Akinniyi [EMAIL PROTECTED] schrieb: Martijn van Oosterhout kleptog@svana.org wrote: It's ~/.pgpass the dot is important. Thanks. Just a typo error in the mail. I did put the dot in the file name. The file on Fedora is ~/.pgpass and on Windows it is in

Re: [GENERAL] Set autocommit to off

2005-08-17 Thread Andreas Kretschmer
Aliomar Mariano Rego [EMAIL PROTECTED] schrieb: Does somebody knows why the Postgresql 7.4.8 or later doesn't supports the option SET AUTOCOMMIT TO OFF? \set AUTOCOMMIT off works fine in 8.0.3 Regards, Andreas -- Diese Message wurde erstellt mit freundlicher Unterstützung eines freilau-

Re: [GENERAL] Function to test for Valid Date

2005-09-11 Thread Andreas Kretschmer
Alex [EMAIL PROTECTED] schrieb: Hi, is there a way to use postgres to check if a date provided is valid and would return true or false. http://www.postgresql.org/docs/8.0/interactive/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT There is a user comment with a example. Regards,

Re: [GENERAL] Multiple database queries

2005-10-02 Thread Andreas Kretschmer
Cosmopo [EMAIL PROTECTED] schrieb: Does the new version 8.0.x ofter this feature? We need to create several databases based on our customer's specs... but we need our own customer, permission, history, etc database. We want to be able to query 2 database that would have share customer's ID and

Re: [GENERAL] Portable PostgreSQL

2005-10-02 Thread Andreas Kretschmer
Samik Raychaudhuri [EMAIL PROTECTED] schrieb: Hello Group: Is there any 'portable' version of PostgreSQL for Windows? By 'portable' I mean, I can just unzip files, run the initdb and then run the postmaster and I get a temporary database server running on port 5432 and accepting

Re: [GENERAL] Oracle buys Innobase

2005-10-08 Thread Andreas Kretschmer
Bruce Momjian pgman@candle.pha.pa.us schrieb: Ultimately, MySQL should drop InnoDB. http://forums.mysql.com/read.php?3,48400,48400#msg-48400 InnoDB is GPL. But, i'm also confused. My guess: a fork in the future. Regards, Andreas -- Really, I'm not out to destroy Microsoft. That will just

Re: [GENERAL] getting around---division by zero on numeric

2005-10-19 Thread Andreas Kretschmer
Tim Nelson [EMAIL PROTECTED] schrieb: I am getting division by zero on a calculated field ( sum(sales) is 0 ) and I can't find a way around this. I figured out you can't use an aggregate in a where, and using having the parser must (obviously) evaluate the select fields before considering

Re: [GENERAL] pg_dump with low priority?

2005-10-22 Thread Andreas Kretschmer
Bryan Field-Elliot [EMAIL PROTECTED] schrieb: Is there any mechanism for running pg_dump with a lower priority? I don't mind if the backup takes two hours instead of half an hour, as long as other processes were getting their fair share of cycles. You can use 'nice', see see the man-page.

Re: [GENERAL] Dump only functions...

2005-10-26 Thread Andreas Kretschmer
Cristian Prieto [EMAIL PROTECTED] schrieb: Any of you knows is there is any way in pg_dump or anything to dump just the functions from a database? Net really a solution, but your defined functions are stored in information_schema.routines HTH, Andreas -- Really, I'm not out to destroy

Re: [GENERAL] Looking for a command to list schemas

2005-10-26 Thread Andreas Kretschmer
Cosmopo [EMAIL PROTECTED] schrieb: It seems that once we created the schema and created a table with this schema, if we forget about it, the is no way to list the schema or to have the tables/sequence with it's associated schema... Can someone tell us how we can get this important info? \dn

Re: [GENERAL] Learning server programming

2005-10-28 Thread Andreas Kretschmer
Michael Schuerig [EMAIL PROTECTED] schrieb: I'm looking for information on learning how to write stored procedures and server-side programming in general. The docs provide a reference, Falls Du in der Nähe von Dresden wohnst: dort ist morgen Linux-Info-Tag und ein paar Leute der deutschen

Re: [GENERAL] Postgresql connection on suse 10

2005-11-05 Thread Andreas Kretschmer
Michal Hlavac [EMAIL PROTECTED] schrieb: Leonel Nunez wrote: edit your postgresql.conf and set the listen_address variable to your needs thanks Leonel, it is possible to setup subnet mask for postgresql through listen_address?? Yes, of course, in CIDR-Notation. HTH,

Re: [GENERAL] How to create a virtual column

2005-11-06 Thread Andreas Kretschmer
Chris [EMAIL PROTECTED] schrieb: How do I create a virtaul column? A virtual column is accessible like any other column except that there is no physical column associated with it (unless it's indexed). The data for the column is derived from other columns in the table. For example, in a

Re: [GENERAL] some ports closed in Fedora

2007-02-03 Thread Andreas Kretschmer
Harpreet Dhaliwal [EMAIL PROTECTED] schrieb: Hi, though this is not directly related to postgres, but i was wondering why are most of the ports seen closed when one does nmap scan of these ports. Whats reason can we attribute to the fact that most of the ports in an OS are in closed state.

Re: [GENERAL] some ports closed in Fedora

2007-02-03 Thread Andreas Kretschmer
Harpreet Dhaliwal [EMAIL PROTECTED] schrieb: Is there any fedora mailinglist? Never knew if there was one Yes, more then one, ask google. Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. (Linus

Re: [GENERAL] trigger for pg_authid

2007-02-09 Thread Andreas Kretschmer
Diego de Blas [EMAIL PROTECTED] schrieb: Hello, I'm trying to set a new trigger for pg_authid connected as postgres but system returns always the same error Permission denied: pg_authid is a system catalog... I have checked privileges and I can teorically add new triggers. I don't know

Re: [GENERAL] drop table if exists mytable;

2007-02-10 Thread Andreas Kretschmer
Anton Melser [EMAIL PROTECTED] schrieb: Hi, I need to do a drop table if exists type thing. I realise I can Install 8.2 or use this function, posted by David Fetter: -- -- posted by David Fetter -- CREATE OR REPLACE FUNCTION drop_table(TEXT) RETURNS VOID STRICT LANGUAGE plpgsql AS $$ BEGIN

Re: [GENERAL] [ADMIN] Priorities for users or queries?

2007-02-11 Thread Andreas Kretschmer
Edwin Eyan Moragas [EMAIL PROTECTED] schrieb: On 2/11/07, Benjamin Arai [EMAIL PROTECTED] wrote: Hi, Is there a way to give priorities to queries or users? Something similar to NICE in Linux. My goal is to give the updating (backend) application a very low priority and give the web

Re: [GENERAL] rule creating infinite recursion not sure why

2007-02-16 Thread Andreas Kretschmer
Gene [EMAIL PROTECTED] schrieb: I was trying to create a rule to set a column to false whenever another column was changed: CREATE RULE... ON UPDATE TO criterion WHERE new.pattern::text old.pattern::text DO UPDATE table SET flag = false WHERE id = _o_l_d_._i_d pattern | id

Re: [GENERAL] Inserting a new column in between.

2007-02-25 Thread Andreas Kretschmer
RPK [EMAIL PROTECTED] schrieb: Andreas, I am talking about inserting a field or changing their order in the structure itself. In MS Access and SQL Server we have this facility. Some times I need to shift the less important field to the last so that when I query using: Select * from

Re: [GENERAL] Best way to store and retrieve photo from PostGreSQL

2007-02-25 Thread Andreas Kretschmer
Alain Roger [EMAIL PROTECTED] schrieb: Hi, I would like to store picture in my DB and after to display them on my PHP pages. What is the best solution for that ? Store the pictures in the filesystem and only the path, description and other metadata in the database. My suggestion ;-)

Re: [GENERAL] Best way to store and retrieve photo from PostGreSQL

2007-02-25 Thread Andreas Kretschmer
Tomas Vondra [EMAIL PROTECTED] schrieb: Store the pictures in the filesystem and only the path, description and other metadata in the database. My suggestion ;-) Andreas Don't do that - the filesystems are not transactional (at least not the usual ones), so you'll lose the ability to

Re: [GENERAL] pg_dump and restore problem with function as DEFAULT-Constraint

2007-02-27 Thread Andreas Kretschmer
Markus Schulz [EMAIL PROTECTED] schrieb: You can use pg_restore with -l to generate a listfile for all objects in the database. Then you can reorder this ($EDITOR) and then use -L to use this ordered listfile to enforce the right order of objects. I hope this helps you. thanks, nice

Re: [GENERAL] How to write a function that manipulates a set of results

2007-03-14 Thread Andreas Kretschmer
Ashley Moran [EMAIL PROTECTED] schrieb: The closest I've come from reading the docs is functions that return SETOF. However I can't see any way to query the result set like a table. Right. Can anyone offer any hints/links? select * from insert_your_srf-function_here. For instance, if

Re: [GENERAL] How to write a function that manipulates a set of results

2007-03-14 Thread Andreas Kretschmer
Ashley Moran [EMAIL PROTECTED] schrieb: On Mar 14, 2007, at 6:02 pm, Andreas Kretschmer wrote: select * from insert_your_srf-function_here. For instance, if your SRF-function is called foo(), do: select * from foo(); Andreas, It's more complicated than that. What we need to do

Re: [GENERAL] Matrix (linear algebra) operations and types in PG?

2007-03-25 Thread Andreas Kretschmer
Webb Sprague [EMAIL PROTECTED] schrieb: Hi all, This is just a random question/idea (I tried googling, but couldn't get an answer quickly): Has anyone written a library to effect linear algebra types and operations through Postgres? E.G., convert a float 2-d array to a matrix, convert

Re: [GENERAL] Wrong increments of Sequence

2007-04-02 Thread Andreas Kretschmer
RPK [EMAIL PROTECTED] schrieb: I have created a sequence with minimum value=1 and increment=1. But whenever I enter a record in a table and use nextval('seqstudentmaster') to insert new studentid, it is incremented by 20. How to set it to increment by 1? Can you show us an example and the

Re: [GENERAL] Schema relationship diagram

2007-04-20 Thread Andreas Kretschmer
RPK [EMAIL PROTECTED] schrieb: Where I can find this? Do you mean postgresql-autodoc? Depends on your distribition, i have Debian and can do a simple 'apt-get install postgresql-autodoc', if i want to install this. Andreas -- Really, I'm not out to destroy Microsoft. That will just be a

Re: [GENERAL] Spliting a string in plpgsql

2007-05-08 Thread Andreas Kretschmer
Jasbinder Singh Bali [EMAIL PROTECTED] schrieb: Hi, I'm writing a function in plpgsql and i need to do the following: I have a string in the following format. _m_a_i_l_._y_a_h_o_o_._c_o_m In this string, i need to figure out the number of dots in it and split the Number

Re: [GENERAL] How to install Postgresql on MS Vista?

2007-06-21 Thread Andreas Kretschmer
dfx [EMAIL PROTECTED] schrieb: I tryied it but get errors on create user postgres. Is there some workaround? I'm not familiar with this crappy OS, but maybe you should disable UAC. Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side

Re: [GENERAL] How to install Postgresql on MS Vista?

2007-06-21 Thread Andreas Kretschmer
Joshua D. Drake [EMAIL PROTECTED] schrieb: I tryied it but get errors on create user postgres. Is there some workaround? I'm not familiar with this crappy OS, but maybe you should disable UAC. In your mind, it may be crappy but it is indeed an officially supported operating system by this

Re: [GENERAL] Timestamp comparison with string in some special cases

2007-11-19 Thread Andreas Kretschmer
Dragan Matic [EMAIL PROTECTED] schrieb: I have just found out that when comparing timestamp with time value where time value is represented in 24h format + AM/PM sign doesn't work always. for instance, the following query works in this format: select * from table where timestamp_column

Re: [GENERAL] loading a funtion script from a file

2007-11-21 Thread Andreas Kretschmer
Pau Marc Munoz Torres [EMAIL PROTECTED] schrieb: Hi I've written a sql function in a text file, and now, i would like to upload into postgresql an execute, is there any command to do it? as far as I know in mysql exist source command, is there something similar in postgresql? Of course.

Re: [GENERAL] reformatting floats ?

2007-12-06 Thread Andreas Kretschmer
Gauthier, Dave [EMAIL PROTECTED] schrieb: Hi: if... create table coords (id int, x float, y float); then... insert into coords (id,x,y) values (1,1.000,2.001) and then... select * from coords i get... 1,1,2.001 i want... 1.1.000,2.001

Re: [GENERAL] data type change on a view

2007-12-12 Thread Andreas Kretschmer
Scott Marlowe [EMAIL PROTECTED] schrieb: On Dec 12, 2007 12:11 PM, A. Kretschmer [EMAIL PROTECTED] wrote: Hello @all, i have a question (rot really for myself, a member of ther german forum asks): i have two tables, contains a varchar(N)-column. Now i create a VIEW based on this

Re: [GENERAL] data type change on a view

2007-12-13 Thread Andreas Kretschmer
Tom Lane [EMAIL PROTECTED] schrieb: Andreas Kretschmer [EMAIL PROTECTED] writes: cast it to varchar(8): As i said in a private mail to Scott (sorry): the suggested way don't work, at least with 8.1. Maybe this works better in more recent versions. Yes, it works a lot better in 8.2

Re: [GENERAL] setting and using variables in PSQL ????

2007-12-15 Thread Andreas Kretschmer
Gauthier, Dave [EMAIL PROTECTED] schrieb: Hi: At the PSQL prompt, I want to set some variables based upon query results, or via static assignment, then insert a record with those values. Sort of like... You can use this: - define in your postgresql.conf: custom_variable_classes =

Re: [GENERAL] change owner to all object in a schema

2007-12-21 Thread Andreas Kretschmer
Nicola Benaglia [EMAIL PROTECTED] schrieb: Hi! I searched a lot on the net, but I haven't found a quick way to change owner to all objects in a schema. Could you please suggest me a tool or an existing script to do that ? There are any scripts, for instance: 13:38 akretschmer ??grantall

Re: [GENERAL] batch insert/update

2007-12-26 Thread Andreas Kretschmer
blackwater dev [EMAIL PROTECTED] schrieb: I have some php code that will be pulling in a file via ftp. This file will contain 20,000+ records that I then need to pump into the postgres db. These records will represent a subset of the records in a certain table. I basically need an

Re: [GENERAL] Is there something like MySQL enterprise monitor for Postgres?

2007-12-29 Thread Andreas Kretschmer
Ivan Sergio Borgonovo [EMAIL PROTECTED] schrieb: or/and is there something to spot what are the most critical sql queries/function behind an application? You can set log_min_duration_statement in your postgresql.conf to log all querys with a duration highter than that value. Andreas --

Re: [GENERAL] quick question abt pg_dump and restore

2008-01-09 Thread Andreas Kretschmer
Josh Harrison [EMAIL PROTECTED] schrieb: My questions 1. I pg_dumped dummy and Shuffled_dummy (from database1) to another database (database2) When I issued the query in both database (database1 and database2) select * from dummy limit 1000 ( the planner chooses seq scan for this query)

Re: [GENERAL] Table size

2008-03-21 Thread Andreas Kretschmer
Pavan Deolasee [EMAIL PROTECTED] schrieb: On Fri, Mar 21, 2008 at 3:03 PM, lak [EMAIL PROTECTED] wrote: I have two questions. How can I enter comments into a table? Where the comments are stored? What do you mean by comments in a table ? Comments on a table or a column or on other

Re: [GENERAL] postgreSQL multithreading

2008-03-30 Thread Andreas Kretschmer
[EMAIL PROTECTED] [EMAIL PROTECTED] schrieb: Hi all, I was trying to find some way to implement multithreading into my postgreSQL stored functions. The thing is, that I have data stored in multiple tables - for each day one table - and I want to write a function which selects data

Re: [GENERAL] A good postgresql book

2005-11-11 Thread Andreas Kretschmer
Robert Treat [EMAIL PROTECTED] schrieb: Anyway I am open to some good recommendations. I think I would recommend Beginning Databases with PostgreSQL, 2nd Edition from Apress, as it's aimed toward beginers. (full disclosure, I did the technical review for the book, though I get no money if

Re: [GENERAL] Bug with index-usage?

2005-11-14 Thread Andreas Kretschmer
Sebastian Böck [EMAIL PROTECTED] schrieb: Hello, I get unpredictibale results selecting from a view depending on index-usage. [ snipp ] SELECT * from test WHERE type = 'a'; unfortunately, no result. What Du you expect? Andreas -- Really, I'm not out to destroy Microsoft. That will

Re: [GENERAL] Restore a PG database in Windows

2005-11-15 Thread Andreas Kretschmer
[EMAIL PROTECTED] [EMAIL PROTECTED] schrieb: I am having an extremely difficult time restoring the backup.gz I have on my Desktop. How is this backup.gz created? So, I tried using PSQL, but I'm still not having any luck. Can anyone direct me to a good resource that explains how to go

Re: [GENERAL] how to get size of array in function

2005-11-28 Thread Andreas Kretschmer
Amit Soni [EMAIL PROTECTED] schrieb: Hi list, i made one function and the argument of that function is string array, now how can i get the size of that array?? Please read http://www.postgresql.org/docs/8.1/interactive/functions-array.html You can use array_lower/array_upper or

Re: [GENERAL] New.* and old.* as function arguments within rules

2005-12-02 Thread Andreas Kretschmer
Karl O. Pinc [EMAIL PROTECTED] schrieb: Hi, I'm trying to make sure I understand what I'm doing. Where is new.* and old.* documented, as regards using them as arguments to functions called from rules? If it's not documented then can I rely

Re: [GENERAL] beginne' - inserting a record

2005-12-03 Thread Andreas Kretschmer
Andrew Toth [EMAIL PROTECTED] schrieb: thx, it's working! And the last question - today: how can i change the orter of the fields in a table? If you have a table with field1, field2, field3, and you want to see this table as field3, field2, field1, simple do 'select field3, field2,

Re: [GENERAL] convert integer to bool implicitly

2005-12-18 Thread Andreas Kretschmer
Sim Zacks [EMAIL PROTECTED] schrieb: How easy would it be to write a small type extension to have integer automatically convert to bool? For example, I want an implicit conversion that 0 is false and everything else is true. test=# \d foo; Table public.foo Column | Type |

Re: [GENERAL] who is connected to the database ??

2006-01-03 Thread Andreas Kretschmer
Hugo [EMAIL PROTECTED] schrieb: hello , is there a way to answer that question ? Try this: select * from pg_stat_activity ; But some fields are only available with 8.1. thanks in advance Please, no HTML. HTH, Andreas -- Really, I'm not out to destroy Microsoft. That will just be a

Re: [GENERAL] generic way to retrieve array as rowset

2006-01-03 Thread Andreas Kretschmer
Tino Wildenhain [EMAIL PROTECTED] schrieb: *wink* ;) Tino hehe ;-) Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. (Linus Torvalds) Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°

Re: [GENERAL] Reordering columns in a table

2006-01-06 Thread Andreas Kretschmer
John McCawley [EMAIL PROTECTED] schrieb: I believe that it makes a lot of practical difference, just like organizing related code into files, classes etc. is important for clarity. This isn't a trivial thing, and the other (sarcastic?) suggestion that I reorder my select misses the point.

Re: [GENERAL] Reordering columns in a table

2006-01-06 Thread Andreas Kretschmer
John McCawley [EMAIL PROTECTED] schrieb: However, in the real world, columns are often added willy-nilly as they are needed, and it is not immediately obvious which, if any, of the columns will be related. Later, solely for visual clarity, it is desirable to have the ability to reorder the

Re: [GENERAL] Reordering columns in a table

2006-01-06 Thread Andreas Kretschmer
, this may be a problem. I don't know a practicable solution. As i said, attach new columns at the end and formulate useful SELECT's and INSERT's. Or, see also Joshua D. Drake, create VIEWS. Andreas Kretschmer wrote: Btw.: Top Posting with Fullquote Below (german: TOFU) are silly... (- http

Re: [GENERAL] COPY to

2006-01-07 Thread Andreas Kretschmer
Angshu Kar [EMAIL PROTECTED] schrieb: Thanks Andreas. But how can I run this from the pgAdmin III Query tool in a WinXP m/c? Sorry, i don't using pgAdmin nor windows... I mean, use the CLI-Interface psql. Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely

Re: [GENERAL] Replicating a remote database (backuping)

2006-01-19 Thread Andreas Kretschmer
Silas Justiniano [EMAIL PROTECTED] schrieb: I was looking for ways to backup my remote database in a local computer. I was talking to #postgresql folks, who said me to try sloty. Is sloty the best choice? Is there anything different? Only backup? I think, you can use pg_dump or pg_dumpall.

  1   2   3   4   5   >