Hi people,
testing=# INSERT INTO foo (SELECT * FROM foo WHERE foo_id = 2);
ERROR: duplicate key violates unique constraint "foo_pkey"
testing=#
testing=# INSERT INTO foo (foo_1, foo_2, foo_3 ...) (SELECT foo_1, foo_2,
foo_3 ... FROM message_table WHERE foo_id = 10);
INSERT 717286 1
testing=#
I
Eugene E. wrote:
PFC wrote:
What information can be retrieved from a structure by being able to
update all rows?
Write a plpgsql function snoop(x) which inserts x into a table
'log' created by you, and also returns x.
UPDATE users SET password=snoop(password).
Read log tab
PFC wrote:
What information can be retrieved from a structure by being able to
update all rows?
Write a plpgsql function snoop(x) which inserts x into a table
'log' created by you, and also returns x.
UPDATE users SET password=snoop(password).
Read log table.
Done.
This
Tom Lane wrote:
"Eugene E." <[EMAIL PROTECTED]> writes:
db=# REVOKE all ON t FROM u;
db=# GRANT update,insert,delete ON t TO u;
db=# \c - u
db=> INSERT INTO t VALUES (1,'x');
INSERT
db=> UPDATE t SET a='y' WHERE i=1;
ERROR: Permission denied for relation t;
db=> UPDATE t SET a='y';
UPDATE
unsubscribe
This message is intended only for the use of the individual(s) or entity to which it is addressed and may contain information that is privileged, confidential, and/or proprietary to RealPage and its affiliated companies. If the reader of this message is not the intended recip
unsubscribe
unsubscribe
__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your
On Mon, Mar 13, 2006 at 07:29:44PM -0500, Daniel Caune wrote:
> > > Replace "$libdir" by "/usr/lib/postgresql/8.1/lib/tablefunc.so" (I
> > > suggest to modifying only a copy of this file).
> >
> > That shouldn't be necessary unless the package installed the shared
> > objects somewhere other than
> -Message d'origine-
> De : Michael Fuhr [mailto:[EMAIL PROTECTED]
> Envoyé : lundi, mars 13, 2006 19:26
> À : Daniel Caune
> Cc : [EMAIL PROTECTED]; postgresql sql list
> Objet : Re: [SQL] connectby documentation
>
> On Mon, Mar 13, 2006 at 06:38:14PM -0500, Daniel Caune wrote:
> > I p
On Mon, Mar 13, 2006 at 06:38:14PM -0500, Daniel Caune wrote:
> I provide hereafter a description about how to install the function
> connectby (I didn't find such documentation and I don't know where to
> write this documentation):
README.tablefunc contains instructions on how to load the module
> > > Sorry, this is not my day: "apt-get install
postgresql-contrib-8.1"
> > > works fine... Just a link on the documentation that fully
explains
> how
> > > connectby() works would be great! :-)
> >
> > The contrib package should have installed a file named
> README.tablefunc.
> >
>
> You are
> > Sorry, this is not my day: "apt-get install postgresql-contrib-8.1"
> > works fine... Just a link on the documentation that fully explains
how
> > connectby() works would be great! :-)
>
> The contrib package should have installed a file named
README.tablefunc.
>
You are right. The documen
I saw it from the docs as well. Thank you Alvaro :)
Alvaro Herrera wrote:
Emi Lu wrote:
Hello all,
Does anyone have available plpgsql codes to update all capital letters
in a column to "the first character is capital and the rest is small" ?
I don't know about plpgsql codes, but
On Mon, Mar 13, 2006 at 04:56:39PM -0500, Daniel Caune wrote:
> Sorry, this is not my day: "apt-get install postgresql-contrib-8.1"
> works fine... Just a link on the documentation that fully explains how
> connectby() works would be great! :-)
The contrib package should have installed a file nam
I got the answer from the docs. |initcap|(text)
thanks anyway,
Ying
Hello all,
Does anyone have available plpgsql codes to update all capital letters
in a column to "the first character is capital and the rest is small" ?
For example, in tableA(id, description)
001, 'ZHANG ZHE XIN'
Emi Lu wrote:
> Hello all,
>
> Does anyone have available plpgsql codes to update all capital letters
> in a column to "the first character is capital and the rest is small" ?
I don't know about plpgsql codes, but there is a function initcap() that
you can use for that.
alvherre=# select initca
Hello all,
Does anyone have available plpgsql codes to update all capital letters
in a column to "the first character is capital and the rest is small" ?
For example, in tableA(id, description)
001, 'ZHANG ZHE XIN' =>
'Zhang Zhe Xin'
002, 'LIU
> "outdated" packets is unfortunately a big issue on Debian. If you want
> to have up-to-date apt-packages try
>
> www.backports.org
>
> Add one of the mirrors from the list to your sources.list, then run
> apt-get update and then try to install again ...
> :-) And you'll see, that you can instal
7.4?! Huh... Is there any sources.list a bit more updated? Where can I
download PostgreSQL contrib modules. The documentation 8.1 doesn't help
so much. Where can I find more documentation on available contrib.
modules?
gentoo automatically compiles and installs the contribs (you just
> -Message d'origine-
> De : Michael Fuhr [mailto:[EMAIL PROTECTED]
> Envoyé : lundi, mars 13, 2006 11:12
> À : Daniel Caune
> Cc : postgresql sql list
> Objet : Re: [SQL] connectby documentation
>
> On Mon, Mar 13, 2006 at 10:37:37AM -0500, Daniel Caune wrote:
> > I'm searching for an O
What information can be retrieved from a structure by being able to
update all rows?
Write a plpgsql function snoop(x) which inserts x into a table 'log'
created by you, and also returns x.
UPDATE users SET password=snoop(password).
Read log table.
Done.
If you h
Christian Paul B. Cosinas wrote:
Then I have a program that insert 1(one) million times like this:
Insert into unique_items(item_id) values('Item001)
Ofcourse we all know that it will fail because there is already a record in
the database.
Would there be any bad effect on the database or none
On Mon, Mar 13, 2006 at 10:37:37AM -0500, Daniel Caune wrote:
> I'm searching for an Oracle START WITH ... CONNECT BY PRIOR ...
> equivalence. It seems that PostgreSQL (version >= 7.4) supports a
> function connectby that provides similar feature. Unfortunately I don't
> find any documentation on
Achilleus Mantzios <[EMAIL PROTECTED]> writes:
> O Robert Urban Ýãñáøå óôéò Mar 13, 2006 :
>> how can I get rid of the "not null" modifier on status_id?
> ALTER TABLE event ALTER status_id DROP NOT NULL;
I don't think 7.2 has that. Of course, there are many excellent reasons
why Robert needs t
Hi,
I'm searching for an Oracle START WITH ... CONNECT BY PRIOR ...
equivalence. It seems that PostgreSQL (version >= 7.4) supports a
function connectby that provides similar feature. Unfortunately I don't
find any documentation on that function. Could you please give me a
link on such document
"Eugene E." <[EMAIL PROTECTED]> writes:
> db=# REVOKE all ON t FROM u;
> db=# GRANT update,insert,delete ON t TO u;
> db=# \c - u
> db=> INSERT INTO t VALUES (1,'x');
> INSERT
> db=> UPDATE t SET a='y' WHERE i=1;
> ERROR: Permission denied for relation t;
> db=> UPDATE t SET a='y';
> UPDATE
This
On Mon, 2006-03-13 at 10:46 -0400, Alvaro Herrera wrote:
> Rod Taylor wrote:
>
> > By allowing the user a where clause you grant them select privileges.
> > You will find that delete works the same way.
> >
> > This is one of those times when per column permissions are useful. You
> > could grant
Markus Schaber <[EMAIL PROTECTED]> writes:
> Tom Lane wrote:
>> The fact that the other form is even allowed is more of a holdover from
>> PostQUEL than something we have consciously decided is a good idea.
>> (IMHO it's actually a fairly *bad* idea, because it does not work nicely
>> when there's
Rod Taylor wrote:
> By allowing the user a where clause you grant them select privileges.
> You will find that delete works the same way.
>
> This is one of those times when per column permissions are useful. You
> could grant them select access on the "name" column but not the "salary"
> column.
On Mon, 2006-03-13 at 12:51 +0300, Eugene E. wrote:
> Hi all
> the serious problem with permissions is encountered
>
> NOTE: the following example is really useful but there is no room to
> describe it's use.
>
>
> db=# CREATE USER u;
> db=# CREATE TABLE t (i int, a text);
> db=# REVOKE all ON
> Objet : Re: [SQL] Ask a PostgreSql question (about select )
>
> Please post questions to the list. I'm forwarding this to the SQL
> list, as I think it's probably most applicable. I don't know much
> about the Oracle syntax you've used. Hopefully someone will be able
> to help you.
>
> On Mar 1
O Robert Urban έγραψε στις Mar 13, 2006 :
> Hello,
>
> let's say I have created a postgresql-7.2.2 db using the following cmds:
>
> CREATE TABLE status
> (
> id SERIAL NOT NULL PRIMARY KEY,
> name VARCHAR(32)
> );
>
> CREATE TABLE event
>
Hello,
let's say I have created a postgresql-7.2.2 db using the following cmds:
CREATE TABLE status
(
id SERIAL NOT NULL PRIMARY KEY,
name VARCHAR(32)
);
CREATE TABLE event
(
id SERIAL NOT NULL PRIMARY KEY,
Hi, Tom,
Tom Lane wrote:
> The behavior of the subquery expression is dictated by the SQL spec:
>
> 1) If the cardinality of a or a is
> greater than 1, then an exception condition is raised: cardinal-
> ity violation.
That's interesting to know, and it seems
On Monday 13 March 2006 03:03, Richard Huxton wrote:
> Robert Paulsen wrote:
> > This still requires me to modify the overall database structure but not
> > the original item table. As my reward :) I get to use any type I choose
> > for each new attribute.
>
> The whole point of the database struct
Hi Fellow PostgreSQL users,
Just a question here.
Is there any bad effect on the PostgreSQL performance If I encounter many
fails on inserting records to database with primary key column.
For example I have this table
CREATE TABLE unique_items
(
item_id text NOT NULL,
CONSTRAINT unique_item
Hi all
the serious problem with permissions is encountered
NOTE: the following example is really useful but there is no room to
describe it's use.
db=# CREATE USER u;
db=# CREATE TABLE t (i int, a text);
db=# REVOKE all ON t FROM u;
db=# GRANT update,insert,delete ON t TO u;
db=# \c - u
db=>
Robert Paulsen wrote:
This still requires me to modify the overall database structure but not the
original item table. As my reward :) I get to use any type I choose for each
new attribute.
The whole point of the database structure is to accurately reflect the
requirements of your data. If yo
38 matches
Mail list logo