Re: [GENERAL] Is Postgres good for large Applications

2006-10-18 Thread Berend Tober
Sandeep Kumar Jakkaraju wrote: Is Postgres good for large Applications ?? Yes. cf., e.g., "http://www.computerworld.com.au/index.php?id=760310963"; "... Vice president of operations at Afilias, Ram Mohan said the .ORG database will be based on a standard implementation of PostgreSQL versi

Re: [GENERAL] [SQL] Can we convert from Postgres to Oracle !!???

2006-10-21 Thread Berend Tober
Devrim GUNDUZ wrote: On Tue, 2006-10-17 at 14:21 +0530, Sandeep Kumar Jakkaraju wrote: Can we convert from Postgres to Oracle !!??? Yes!!??? But of course, that begs the question: Why on earth would you want to!!??? ---(end of broadcast)--

Re: [GENERAL] chop off non-meaningful digits

2006-11-14 Thread Berend Tober
A. Kretschmer wrote: am Tue, dem 14.11.2006, um 0:58:56 -0500 mailte Tom Lane folgendes: "SunWuKung" <[EMAIL PROTECTED]> writes: Yep, I think this is it: select trim(trailing '0.' from 1.020) Um, I think not: regression=# select trim(trailing '0.' from 1000.000); rtrim

Re: [GENERAL] Separation of clients' data within a database

2006-12-01 Thread Berend Tober
John McCawley wrote: Oh, I see, so there's one master schema, and one customer schema, and the customer schema views are automatically filtered based on login...Makes sense...I will definitely try to implement this, thanks! I've on-and-off toyed with the idea of accomplishing a similar objecti

Re: [GENERAL] PG Admin

2006-12-04 Thread Berend Tober
Bob Pawley wrote: Your missing the point. I am creating a design system for industrial control. The control devices need to be numbered. The numbers need to be sequential. If the user deletes a device the numbers need to regenerate to again become sequential and gapless. Could you explain wha

Re: [GENERAL] Male/female

2006-12-08 Thread Berend Tober
Raymond O'Donnell wrote: 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, something like: CREATE DOMAIN g

Re: [GENERAL] Male/female

2006-12-08 Thread Berend Tober
Joshua D. Drake wrote: On Fri, 2006-12-08 at 09:31 -0700, John Meyer wrote: COPY gender (gender_pk, gender) FROM stdin; 0(unknown) 1Male 2Female 3Trans \. Not to take this completely off track, but isn't transgendered not so much a gender as it is a process of moving f

Re: [GENERAL] Male/female

2006-12-08 Thread Berend Tober
Scott Marlowe wrote: On Fri, 2006-12-08 at 10:44, John Meyer wrote: David Fetter wrote: On Fri, Dec 08, 2006 at 03:23:11PM -, Raymond O'Donnell wrote: Just wondering.how do list member represent gender when storing details of people in a database? I usually use

Re: [GENERAL] resetting sequence to cur max value

2006-12-13 Thread Berend Tober
nt4) RETURNS int4 AS ' DECLARE l_sequence_name ALIAS FOR $1; l_last_value ALIAS FOR $2; BEGIN IF l_last_value = 0 THEN PERFORM setval(l_sequence_name,1, False); ELSE PERFORM setval(l_sequence_name,l_last_value); END IF; RETURN 1; END;' LANGUAGE 'plpgsql' VOLATILE; Regards,

Re: [GENERAL] Timestamp/Timezone - does this make sense?

2007-02-14 Thread Berend Tober
Mike Harding wrote: mvh=> set time zone 'UTC'; SET mvh=> select now(); now --- 2007-02-13 03:37:35.660652+00 (1 row) "+00" says your database thinks you are in Greenwich. mvh=> select timestamp with time zone '2007-01-01' at time zone 'America/Los_Angeles'; timezon

Re: [GENERAL] How to capture and handle failed INSERT

2007-03-04 Thread Berend Tober
Postgres User wrote: I'm using this code to increment a counter table: IF Exists (SELECT keyfld FROM counter_tbl WHERE key_fld = 'key_val') THEN UPDATE counter_tbl SET counter_fld = counter_fld + 1 WHERE key_fld = 'key_val'; ELSE INSERT INTO counter_tbl(key_fld, counter_fld) VAL

Re: [GENERAL] How to enforce uniqueness when NULL values are present?

2007-03-10 Thread Berend Tober
Christian Schröder wrote: Peter Eisentraut wrote: A first step in that direction would be to rethink the apparently troublesome use of null values. Some of the limits are only valid after a given date, whereas other limits are valid all the time. How would you put this information

Re: [GENERAL] How to enforce uniqueness when NULL values are present?

2007-03-11 Thread Berend Tober
Christian Schröder wrote: Berend Tober wrote: Christian Schröder wrote: Peter Eisentraut wrote: A first step in that direction would be to rethink the apparently troublesome use of null values. Some of the limits are only valid after a given date, whereas

Re: [GENERAL] Rules

2004-12-02 Thread Berend Tober
> Planning on witting a rule for a view, and i was wondering if anyone > could suggest a good Internet resource? http://www.postgresql.org (Sorry, couldn't resist.) ---(end of broadcast)--- TIP 7: don't forget to increase your free space map sett

Re: [GENERAL] Rules

2004-12-02 Thread Berend Tober
>> Planning on witting a rule for a view, and i was wondering if anyone >> could suggest a good Internet resource? > > http://www.postgresql.org > > (Sorry, couldn't resist.) > But here is a simple working example of making a view updatable: CREATE TABLE consumable ( consumable_pk serial NOT

Re: [GENERAL] table inheritance and DB design

2004-12-02 Thread Berend Tober
> I am trying to create a database, which allows me to store appointment > information. ... > > Now, I want to have several tables, say Car and Driver, which INHERIT from > the Resource table. I also want AppRes table can enforce a ref. constraint > on the Resource table. So, in the future I can ad

Re: [GENERAL] table inheritance and DB design

2004-12-03 Thread Berend Tober
> On Thu, Dec 02, 2004 at 10:53:37PM -0500, Berend Tober wrote: > >> I learned that the unusual behavior (or at least the behavior that >> seems weird to me) regarding relational integrity and uniquness >> constraints as been around for a while, and some people actually th

Re: [GENERAL] table inheritance and DB design

2004-12-03 Thread Berend Tober
> ...have a Resource table and a Car table > and a ResCar many-to-many relation. I don't think you need the ResCar table. The Car table defines a many-to-many relation with Appointment. As does the Resource table. The Car table contains a subset of rows from the Resource table. > ...it's not exte

Re: [GENERAL] pgplsql SELECT INTO ... FOR UPDATE

2004-12-15 Thread Berend Tober
> I'm trying to write a stored procedure in plpgsql that selects a row > and possibly increments one of its fields. I thought I would do SELECT > INTO my_record * FROM my_table FOR UPDATE WHERE ..., but apparently > plpgsql doesn't like the FOR UPDATE in a stored procedure. Does plpgsql > automatic

Re: [GENERAL] When is a blank not a null or ''

2005-02-02 Thread Berend Tober
>>anyone any ideas > If yes you should you have to use. > > SELECT first_name,work_email FROM tb_contacts WHERE > tb_contacts.work_email <>'' > AND > tb_contacts.work_email IS NOT NULL; > See what happens with SELECT first_name, work_email, LENGTH(COALESCE(work_email, '')) FROM tb_contacts W

[GENERAL] Sorting when "*" is the initial character

2005-02-07 Thread Berend Tober
I encountered what looks like unusually sorting behavior, and I'm wondering if anyone can tell me if this is supposted to happen (and then if so, why) or if this is a bug: CREATE TABLE sample_table ( account_id varchar(4), account_name varchar(25) ) WITHOUT OIDS; INSERT INTO sample_table VALU

Re: [GENERAL] Problem performing a restore of a data schema in Wi

2005-02-08 Thread Berend Tober
> -Original Message- > From: John DeSoi [mailto:[EMAIL PROTECTED] > Sent: 07 February 2005 04:21 PM > To: Shaun Clements > Cc: 'PgSql General' > Subject: Re: [GENERAL] Problem performing a restore of a data schema in > Windows > > > > On Feb 7, 2005, at 8:22 AM, Shaun Clements wrote: > >> p

Re: [GENERAL] Sorting when '*' is the initial character - solved

2005-02-08 Thread Berend Tober
> On Tue, 8 Feb 2005 01:10 pm, CoL wrote: >> hi, >> >> Berend Tober wrote, On 2/7/2005 22:20: >> > I encountered what looks like unusually sorting behavior, and I'm >> wondering if >> > anyone can tell me if this is supposted to happen

Re: [GENERAL] Help with sorting (ie. ORDER BY expression)

2005-02-08 Thread Berend Tober
> This can be easily done with pl/pgsql, visit the documentation at > http://www.postgresql.org/docs/7.3/interactive/programmer-pl.html > OT: seems like this is a questionnaire/survey application, yes? > - - > Jonel Rienton FWIW, given the signature: "Reuben D. Budiardja, Dept. Physics and As

Re: [GENERAL] create aggregates to concatenate

2005-02-08 Thread Berend Tober
> i just wanted to share this with you, i wanted to do something like > this for a long time but just recently found out about "create > aggregate" reading old posts, so here it is, using user-defined > aggregate functions to concatenate results. > > when it's numbers i usually use SUM to compute t

Re: [GENERAL] create aggregates to concatenate

2005-02-08 Thread Berend Tober
>> i just wanted to share this with you, i wanted to do something like >> this for a long time but just recently found out about "create >> aggregate" reading old posts, so here it is, using user-defined >> aggregate functions to concatenate results. >> >> when it's numbers i usually use SUM to com

Re: [GENERAL] is there anyway to get the backends IP address from

2005-02-12 Thread Berend Tober
> Tony Caduto wrote: >> Hi, >> Does anyone know if there is a way to get the backends IP address from >> the PID? >> I am using the view pg_stat_activity and it would be nice if it would >> also display the IP address along with the PID. >> >> I can see the IP address when I do a ps -ef but it woul

Re: [GENERAL] change user password

2005-02-17 Thread Berend Tober
> hi, is it possible to change the current user's password from a > function/stored procedure , I mean, is there a system function/stored > procedure to do it? like the dbo.sp_password found in adaptive server > anywhere. > CREATE OR REPLACE FUNCTION public.alter_password(name, name) RETURNS "

Re: [GENERAL] Multi-parameter aggregates.

2005-11-25 Thread Berend Tober
Michael Fuhr wrote: On Mon, Nov 21, 2005 at 11:03:22AM -0500, Berend Tober wrote: I'm interested in defining a covariance aggregate function. (As a ...aggregates must take a single value, so the above won't work as written. However, in PostgreSQL 8.0 or later you could

Re: [GENERAL] Question

2005-11-29 Thread Berend Tober
Peter Futaro wrote: I need to make a documentation for my database. The documentation I want is almost exactly like the result of "\d" command. I want to make the report using a database manager application, and it requires me to make my own report by typing the SQL command in it. Can you

Re: [GENERAL] Reordering columns in a table

2006-01-06 Thread Berend Tober
might not be feasible depending on circumstances, like dropping and recreating the table and reloading data, but you have to deal with foreign key and other dependencies and so it is probably more work than justifiable for something that makes no practical difference. Regards, Berend Tober

Re: [GENERAL] Reordering columns in a table

2006-01-06 Thread Berend Tober
ould think, although the transaction block prehaps provides appropriate protection. Regards, Berend Tober ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Image in postgresql 7.3

2006-01-18 Thread Berend Tober
Peerri (sent by Nabble.com) wrote: I'm with problems to record images in database in field type bytea. I'm using visual basic 6.0 and object ado stream to convert binary. They say me if another way exists to record the images in the data base. This may not be for the faint of heart, but what

Re: [GENERAL] NULL values and string

2006-02-02 Thread Berend Tober
= text, RIGHTARG = text); This goes against proper form, considering what NULL is designed for, but it sure is convenient. Regards, Berend Tober ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] multi-column aggregates

2006-03-09 Thread Berend Tober
last_bln_agg)).value as last_boolean, (first((cur_date, boolean_column)::last_bln_agg)).value as first_boolean from test_agg_last group by grouping order by grouping ; -- cleanup test data drop table test_agg_last; ---(end of broadcast)--- TIP 5: don&

Re: [GENERAL] multi-column aggregates

2006-03-13 Thread Berend Tober
hile at first I was a bit dissatisfied with having to cast my data pairs as POINT data type, once I got confortable with that it made a lot of sense. Regards, Berend Tober ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] How to idenity duplicate rows

2006-03-19 Thread Berend Tober
Peter Eisentraut wrote: David Inglis wrote: Can anybody assist with this problem I have a table that has some duplicated rows of data, I want to place a unique constraint on the columns userid and procno to eliminate this problem in the future but how do I identify and get rid of the exist

Re: [GENERAL] Advantages of PostgreSQL over MySQL 5.0

2006-03-22 Thread Berend Tober
Tony Caduto wrote: Jimbo1 wrote: "With MySQL, customers across all industries are finding ... If any PostgreSQL devotees on this group can comment on the above and its accuracy/inaccuracy, I'd really appreciate it. That's exactly what it is "propoganda", I can think of two really high

Re: [GENERAL] Backup method

2006-04-05 Thread Berend Tober
Bob Powell wrote: I have a systems admin that is backing up our Linux computers (postgres) by backing up the directory structure. This of course includes all the files that pertain to my postgres databases. I maintain that using pgdump and creating a file of SQL commands for restore is a bett

Re: [GENERAL] How to replace rows in table so that foreign key rows

2006-04-20 Thread Berend Tober
unt(*) FROM pg_catalog.pg_trigger where pg_class.oid = tgrelid) WHERE oid = 'country'::pg_catalog.regclass; Regards, Berend Tober ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Feature-Request: Login-Procedure

2006-05-11 Thread Berend Tober
in to the data base. Or maybe even use it to update their password expiration date to NOW()+30 DAYS, so that the data base automatically expires accounts that aren't being used. Regards, Berend Tober begin:vcard fn:Berend Tober n:Tober;Berend org:Seaworthy Systems, Inc. adr:;;22 Main Str

Re: [GENERAL] Age function

2006-05-17 Thread Berend Tober
l), age(now() + '01:30:00'::interval, current_date), age(now() + '01:30:00'::interval, now()) might help, as would RTFM ("http://www.postgresql.org/docs/8.1/static/functions-datetime.html";, Table 9-26. Date/Time Functions). Regards, Berend Tober be

Re: [GENERAL] What is the point of create or replace view command

2006-06-04 Thread Berend Tober
Chris Velevitch wrote: What is the point of the create or replace view command if you can't change the column and data types ? You could have a calculated column and change the calcuation. You could change the sort order, selection, or grouping clauses. Just to name two. ---

Re: [GENERAL] What is the point of create or replace view command

2006-06-05 Thread Berend Tober
Chris Velevitch wrote: > On 6/5/06, Berend Tober wrote: > >> Chris Velevitch wrote: >> > What is the point of the create or replace view command if you can't >> > change the column and data types ? >> >> You could have a calculated column and change

Re: [GENERAL] Null and Void() - Or, Abandon All Hope Ye Who allow

2006-06-28 Thread Berend Tober
social security number, and other information, but as a practical matter those columns can certainly be committed NULL initially. Regards, Berend Tober 860-767-0700 x118 ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] How to read cleartext user password from pgsql database

2006-07-14 Thread Berend Tober
ow WHERE ''md5''||encode(digest(ls_passwd||ls_usename , ''md5''), ''hex'') = passwd); END;' LANGUAGE 'plpgsql' VOLATILE; So, you can see that pg_shadow.passwd stores the md5 hash of the concatinated plaintext pa

Re: [GENERAL] Disabling and enabling constraints and triggers to

2006-08-07 Thread Berend Tober
Ken Winter wrote: It's a basic bit of database administration work. I'm trying to establish two (or if necessary more) instances of the same database - a production instance and a development instance - and a change management process for coordinating them. As you can probably guess: You ne

Re: [GENERAL] Best approach for a "gap-less" sequence

2006-08-14 Thread Berend Tober
if an UPDATE, DELETE, or SELECT FOR UPDATE from another transaction has already locked a selected row or rows, SELECT FOR UPDATE will wait for the other transaction to complete, and will then lock and return the updated row (or no row, if the row was deleted). ..." Regards, Berend Tober --

Re: [GENERAL] Best approach for a "gap-less" sequence

2006-08-14 Thread Berend Tober
Brad Nicholson wrote: On Mon, 2006-08-14 at 16:08 -0400, Berend Tober wrote: Jorge Godoy wrote: Chris <[EMAIL PROTECTED]> writes: I'm not sure what type of lock you'd need to make sure no other transactions updated the table (see http://www.postgresql.org/docs/8.1

Re: [GENERAL] Best approach for a "gap-less" sequence

2006-08-16 Thread Berend Tober
elein wrote: On Mon, Aug 14, 2006 at 02:46:17PM -0700, Adrian Klaver wrote: On Monday 14 August 2006 01:59 pm, Brad Nicholson wrote: On Mon, 2006-08-14 at 16:08 -0400, Berend Tober wrote: Wouldn't SELECT ... FOR UPDATE give you the row lock you need without locking the table? If th

Re: [GENERAL] Best approach for a "gap-less" sequence

2006-08-17 Thread Berend Tober
Jorge Godoy wrote: Berend Tober <[EMAIL PROTECTED]> writes: A business requirement is to generate table rows that have uniformly increasing, whole number sequences, i.e., the "gap-less" sequence. This is something that I'll also have to code ;-) But the sequence for &

Re: [GENERAL] Cast null string '' to integer 0

2006-08-19 Thread Berend Tober
Guy Rouillier wrote: Dwight Emmons wrote: I am upgrading from Postgres 7.2 to 8.1. We have multiple systems already in place that took advantage of the implicit cast of a null '' string to an integer of '0'. It is not financially feasible for us to modify all the instances. Does anyone kn

Re: [GENERAL] Template1 oops

2006-09-13 Thread Berend Tober
On Wed, Sep 13, 2006 at 10:56:41AM +0200, Alban Hertroys wrote: I found an oops in one of our template1 databases; tables and stuff were apparently loaded into the wrong database (namely template1). I found this page describing a solution: http://techdocs.postgresql.org/techdocs/pgsqladventure

Re: [GENERAL] remote duplicate rows

2006-09-14 Thread Berend Tober
ld be lost. But I suppose one can make the point that your suggestion is a great solution, given the contrived example and insufficient problem understanding presented by the OP -- I really think he needs more help than he realizes. Regards, Berend Tober ---(end of

Re: [GENERAL] PostgreSQL slammed by PHP creator

2006-09-14 Thread Berend Tober
AgentM wrote: On Sep 14, 2006, at 11:27 , Arturo Perez wrote: One performance enhancement that Lerdorf suggested based on code analysis was to use MySQL instead of PostgreSQL for the database. ...If you give up A, C, I, and D, of course you get better performance- just like you can ge

<    1   2