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
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
') 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
+--+--+---
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
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
:
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
, 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
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
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
, 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
...'
_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
, 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
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
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
']);
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
capitalization.
John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL
---(end of broadcast)---
TIP 6: explain analyze is your friend
( '' ||
'''' || 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
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
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
variables.
John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL
---(end of broadcast)---
TIP 6: explain analyze is your friend
(bar)) from test;
John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL
---(end of broadcast)---
TIP 6: explain analyze is your friend
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
:= 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
');
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
.
John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL
---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster
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
://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
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
/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
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
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
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
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
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
, 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
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
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
for
this.
John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL
---(end of broadcast)---
TIP 8: explain analyze is your friend
(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
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
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])
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
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
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]
;
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
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
, 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
, 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
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
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
/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
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
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
://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
. 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
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
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
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
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
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
60 matches
Mail list logo