Re: [SQL] Bizarreness at A2 Hosting

2011-03-17 Thread John DeSoi
back and I'd like to lead him to the answer so he can fix the problem. I think you are right -- they likely have some one's stuff in the template database. On your account that does not have the problem -- is it on the same host? John DeSoi, Ph.D. -- Sent via pgsql-sql mailing list

Re: [SQL] pl/pgsql or control structures outside of a function?

2009-04-03 Thread John DeSoi
work for you. http://www.postgresql.org/docs/8.3/interactive/functions-conditional.html John DeSoi, Ph.D. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] simple text parsing function

2008-11-22 Thread John DeSoi
') like '%CURNCY'; -- true select rtrim('BPZ8 CURNCY ')::char(25) like '%CURNCY'; -- false Interestingly, it works if you make your comparison using ~ '.*CURNCY' John DeSoi, Ph.D. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] doubt

2007-05-19 Thread John DeSoi
+--+--+--- public | barcode | table| user1 public | foo | table| user1 public | foo_a_seq| sequence | user1 (3 rows) John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL

Re: [SQL] PL/PGSQL Record type question

2007-05-11 Thread John DeSoi
parameters so you don't need the CREATE TYPE statement. On May 11, 2007, at 10:42 AM, Gábriel Ákos wrote: You might be looking for PostgreSQL RECORD data type. Thanks. Give me an example please. I saw the documentation already. John DeSoi, Ph.D. http://pgedit.com/ Power Tools

Re: [SQL] plpgsql array looping

2007-04-25 Thread John DeSoi
: for idxptr in 1 .. array_upper(p_idxarray, 1) loop exit when p_idxarray[idxptr] = p_idx; idxptr := idxptr +1; raise notice 'idx ptr: %', idxptr; end loop; John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL

Re: [SQL] plpgsql function question

2007-04-04 Thread John DeSoi
, 2007, at 1:01 AM, A. Kretschmer wrote: Because your function expects one parameter of your new type, you have to CAST your data into this type: test=# select * from my_a((1, 'foo', current_date)::a); my_a -- 1 (1 row) John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL

Re: [SQL] plpgsql function question

2007-04-03 Thread John DeSoi
On Apr 3, 2007, at 2:33 PM, Karthikeyan Sundaram wrote: What I want is something like this create or replace functinon a_func (in a%rowtype) returns int as $$ do the validation $$ language 'plpgsql'; execute a_func(1, 'good','04/02/2007'); John DeSoi, Ph.D. http://pgedit.com/ Power

Re: [SQL] How to store a password encripted in a user defined table

2007-03-01 Thread John DeSoi
Andrej. But how can I use such algoritms in postgresql? arey they defined in a function that I can call? Or, do I have to code one of those algorithm to use it in my application? John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast

Re: [SQL] Seeking quick way to clone a row, but give it a new pk.

2007-02-08 Thread John DeSoi
, but get a new primary key for the copy? I'd then go in an edit the 1 or 2 additional columns that differ. The duplicate would be in the same table as the original. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast

Re: [SQL] Some help with functions-syntax

2007-01-18 Thread John DeSoi
...' _sql := _sql + ' where ...' But using the form without execute is much better. PostgreSQL will only have to plan the query the first time it is called. Using EXECUTE is much less efficient. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end

Re: [SQL] Some help with functions-syntax

2007-01-17 Thread John DeSoi
, Jan Meyland Andersen wrote: I have some problem with writing a function. I have made this function which I can't get it to work. This is probaly a triviel question but i'm new to plsql, so this is a showstopper for me. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL

Re: [SQL] ERROR: SELECT query has no destination for result data

2006-08-31 Thread John DeSoi
base.emissor_ponto_venda where id = PontoVenda_Emissor; See http://www.postgresql.org/docs/8.1/interactive/plpgsql- statements.html#PLPGSQL-SELECT-INTO John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast

Re: [SQL] ERROR: SELECT query has no destination for result data

2006-08-31 Thread John DeSoi
inserirpontos line 30 at if Thank you John. I think I should stay with the record type. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] [PHP] PL/pgSQL and PHP 5

2006-08-10 Thread John DeSoi
']); John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] [PHP] PL/pgSQL and PHP 5

2006-08-09 Thread John DeSoi
capitalization. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] Triggers using PL/pgSQL

2006-07-31 Thread John DeSoi
( '' || '''' || NEW.my_table_id || '', '' || '''' || NEW.my_value || '', '' || ''now() '' || '');'' ; RETURN NEW; END IF; END; ' LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER; John DeSoi, Ph.D. http://pgedit.com/ Power

Re: [SQL] Triggers using PL/pgSQL

2006-07-31 Thread John DeSoi
On Jul 31, 2006, at 10:59 AM, Aaron Bono wrote: On 7/31/06, John DeSoi [EMAIL PROTECTED] wrote: Is it really necessary to build a SQL string and use execute? It seems you could just issue the INSERT statement. I don't think so but there was some discussion a week or two ago about mixing

Re: [SQL] sessions and prepared statements

2006-06-16 Thread John DeSoi
expertise there. Best, John John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [SQL] global variables in plpgsql?

2006-04-10 Thread John DeSoi
variables. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] Problem using set-returning functions

2006-03-27 Thread John DeSoi
(bar)) from test; John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] Problem using set-returning functions

2006-03-27 Thread John DeSoi
it. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] Copying a row within table

2006-03-14 Thread John DeSoi
:= nextval(pg_get_serial_sequence('test', 'id')); insert into test values (tt.*); return tt.id; end; $$ language plpgsql; John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 4: Have you searched

Re: [SQL] Executing plpgsql scripts using psql, is that possible?

2006-01-16 Thread John DeSoi
'); AddObjectProperty(V_MyObjectID, 'a string'); AddObjectProperty(V_MyObjectID, 'another string'); END; $$ language plpgsql; SELECT my_function(1); and then psql -f script.sql my_db John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast

Re: [SQL] Executing plpgsql scripts using psql, is that possible?

2006-01-16 Thread John DeSoi
. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

[SQL] info is a reserved word?

2006-01-12 Thread John DeSoi
info.a := 'hi'; info.b := 'there'; return info; end; $$ language plpgsql; Evaluating this definition gives: psql:16: ERROR: syntax error at or near info at character 71 psql:16: LINE 4: info my_info; psql:16: ^ pg 8.1.1, OS X 10.4.3 John DeSoi, Ph.D. http

Re: [SQL] catching errors in function

2005-10-06 Thread John DeSoi
://www.postgresql.org/docs/8.0/interactive/plpgsql-control- structures.html#PLPGSQL-ERROR-TRAPPING John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send

Re: [SQL] Please help, can't figure out what's wrong with this function...

2005-09-12 Thread John DeSoi
ty_stadtlandflussentry; Maybe it needs to be: declare objReturn public.ty_stadtlandflussentry%rowtype; John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 5: don't forget to increase your free space map

Re: [SQL] Number of rows in a cursor ?

2005-08-24 Thread John DeSoi
/interactive/sql-move.html John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] incorrect syntax for 'plpgsql' function to test boolean values

2005-08-06 Thread John DeSoi
function trigger_insert_update_registration_and_attendance line 13 at if What is wrong with my syntax above? Too much C programming :). You just want a single equal sign. select true = true; ?column? -- t (1 row) John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL

Re: [SQL] echo/printf function in plpgsql

2005-07-19 Thread John DeSoi
correctly, the values to be inserted into the format string can only be variables, not expressions. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your

Re: [SQL] Error on dynamic code.

2005-07-15 Thread John DeSoi
is to use a cursor with OPEN-FOR- EXECUTE, as described in Section 35.8.2. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] How do I quit in the middle of a SQL script?

2005-05-20 Thread John DeSoi
that the following large chunk is supposed to do) Can I do that? Put this at the start of the file to make psql stop if there is an error: \set ON_ERROR_STOP 1 And is it a good idea to add arbitrary code to the database dump sql script? No problem if you know what you are doing and/or have good backups :) John

Re: [SQL] php wrapper

2005-04-24 Thread John DeSoi
to support other databases, what other systems do you need to support? PEAR seems to have a nice databases abstraction layer (DB.php). Drupal uses this to support PostgreSQL and MySQL. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast

Re: [SQL] getting count for a specific querry

2005-04-09 Thread John DeSoi
, the table OID and column number values are 0 in the row description. If I execute the same query directly without a cursor, the row description has the correct values for table OID and column number. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end

Re: [SQL] getting count for a specific querry

2005-04-09 Thread John DeSoi
changing the rows you are viewing. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so

Re: [SQL] Question on triggers and plpgsql

2005-04-08 Thread John DeSoi
to happen? I did not notice any problems. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Question on triggers and plpgsql

2005-04-08 Thread John DeSoi
for this. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Question on triggers and plpgsql

2005-04-08 Thread John DeSoi
(since the triggering event state has to be saved and then recalled) so I could see making that tradeoff if performance is critical. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 5: Have you checked our

Re: [SQL] pl/pgsql problem with return types

2005-03-11 Thread John DeSoi
On Mar 11, 2005, at 5:54 AM, Juris Zeltins wrote: FOR P IN select pageid from pages This way you are only getting the pageid column. I think what you want is FOR P in select * from pages so that P contains the complete pages record. John DeSoi, Ph.D. http://pgedit.com/ Power Tools

Re: [SQL] [ADMIN] Postgres schema comparison.

2005-03-07 Thread John DeSoi
to determine if there is a mismatch. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send unregister YourEmailAddressHere to [EMAIL PROTECTED])

Re: [SQL] [ADMIN] Postgres schema comparison.

2005-03-07 Thread John DeSoi
with the -E option it will show you all the SQL it is using to run the \d command. It should be fairly easy to get the strings you need from the results of running a similar query. The psql source is a good place to look also. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL

Re: [SQL] RE: [SQL] trrouble inserting stuff like é

2005-02-18 Thread John DeSoi
On Feb 18, 2005, at 11:15 AM, Joel Fradkin wrote: How do I tell the connection to use Unicode? Try SET client_encoding TO 'UNICODE'; http://www.postgresql.org/docs/8.0/interactive/sql-set.html But it should default to the database encoding, so I'm not sure if that is the problem. John DeSoi

Re: [SQL] How to iterate through arrays?

2005-02-09 Thread John DeSoi
in the format string. Try it like: myTextVar := update_query_params[1]; NOTICE '% ...',myTextVar; John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] Updating selected record

2005-02-08 Thread John DeSoi
; This locks the row for the remainder of the transaction. See http://www.postgresql.org/docs/8.0/interactive/sql-select.html#SQL-FOR- UPDATE John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 5: Have you checked

Re: [SQL] error in function!!

2005-01-31 Thread John DeSoi
directly. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

[SQL] plpgsql select into with multiple target variables

2005-01-28 Thread John DeSoi
, varz, colx, coly, colz, FROM I've tried parens and various other things but no luck. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 6: Have you searched our list archives? http

Re: [SQL] Moving from Transact SQL to PL/pgsql

2005-01-25 Thread John DeSoi
, but there is a porting section in the documentation: http://www.postgresql.org/docs/8.0/interactive/plpgsql-porting.html John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 9: the planner will ignore your

Re: [SQL] editors with colum positioning for debugging?

2005-01-22 Thread John DeSoi
offset in the file. I hope to have something better in the near future to automatically move the cursor for you when an error is detected. John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 3: if posting

Re: [SQL] Problems with Quotes

2005-01-12 Thread John DeSoi
an ASCII character code in order to get rid of a quote? If so which one, and if not, is there a better solution? Try '' as in select replace('this is it', '', ''); replace this is it (1 row) John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL

Re: [SQL] Problems with Quotes

2005-01-12 Thread John DeSoi
/docs/7.4/static/plpgsql-development-tips.html John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Table History

2004-12-17 Thread John DeSoi
trigger examples other than what is in the documentation, there is a test file in the distribution with quite a few: src/test/regress/sql/plpgsql.sql Best, John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 3

Re: [SQL] Hide schemas and tables

2004-12-13 Thread John DeSoi
foreign schemas and relations from beeing seen. Yes, you are correct. I'm not aware of any way to hide this information. Best, John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL ---(end of broadcast)--- TIP 5: Have you checked our

Re: [SQL] Postgres Doubt

2004-10-03 Thread John DeSoi
://www.postgresql.org/docs/current/interactive/app-createlang.html http://www.postgresql.org/docs/current/interactive/sql- createlanguage.html You generally want to do this for template1 so it will be available in any new database you create. Best, John DeSoi, Ph.D. http://pgedit.com/ Power Tools

Re: [SQL] colored PL with emacs

2004-09-01 Thread John DeSoi
. The estimated price for this product is $65. Send me an email if you are interested in beta testing the Mac OS X version. Best, John DeSoi, Ph.D. ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [SQL] sleep function

2004-08-23 Thread John DeSoi
languages), but I assume there will be additional installation and configuration issues to use them. But thanks for the example, it will be helpful if I need something more processor friendly. Best, John DeSoi, Ph.D. ---(end of broadcast)--- TIP 4

Re: [SQL] sleep function

2004-08-11 Thread John DeSoi
On Aug 10, 2004, at 10:57 AM, Bruce Momjian wrote: I can't think of one, no. I think you will have to use one of the server-side languages and call a sleep in there. This is no good in the real world since it pounds the CPU, but it worked well enough for my testing purposes. Best, John DeSoi

[SQL] sleep function

2004-08-10 Thread John DeSoi
Is there a sleep function of some kind? I wanted to simulate a query taking a long time to execute for testing purposes. Thanks, John DeSoi, Ph.D. ---(end of broadcast)--- TIP 6: Have you searched our list archives? http

Re: [SQL] Object-relational features

2004-03-15 Thread John DeSoi
custom type and you can process the content accordingly. From reading the docs (and asking on the list) I did not think this was possible either without writing external code in C. But a post about something else finally provided the clues I needed to get it working. Best, John DeSoi, Ph.D

Re: [SQL] A simple way to Create type ...?

2003-09-16 Thread John DeSoi
information returned by SELECT. All columns just look like varchar(50). It would be nice if there was something as easy as CREATE DOMAIN but worked more like CREATE TYPE. Best, John DeSoi, Ph.D. ---(end of broadcast)--- TIP 9: the planner