On Tue, 9 Jun 2009, G. Allegri wrote:
> Hello list.
> I'm a newbie with plpgsql, so I'm sorry for doing stupid questions...
> I have a situation whit one table where items are related to two other
> tables through a common id (unique in the first table) and the table
> name. Whenever the user exec
Stephan, you're rigth. It was just a first try. In the real situation
"seconda" and "terza" have a prima_id column. So the right one is:
execute 'UPDATE '|| NEW.tabella ||' SET nome='||
quote_literal(NEW.nome) ||' WEHERE prima_id=' || NEW.id || ';';
I though that double apices would quote. That w
Great, quote_literal() solved it! It was so easy :)
Thx Richard
2009/6/9 Richard Huxton :
> G. Allegri wrote:
>>
>> ERROR: Column 'lets_try' does not exist
>> LINE 1: INSERT INTO seconda (nome) VALUES ('lets_try')
>>
>> My function and trigger are:
>>
>> CREATE OR REPLACE FUNCTION fun1() RETURNS
G. Allegri wrote:
ERROR: Column 'lets_try' does not exist
LINE 1: INSERT INTO seconda (nome) VALUES ('lets_try')
My function and trigger are:
CREATE OR REPLACE FUNCTION fun1() RETURNS TRIGGER AS
$primaprova$
DECLARE
nome varchar;
BEGIN
IF (TG_OP='INSERT') THEN
execute 'INSERT INTO ' || NEW.tab
Hello list.
I'm a newbie with plpgsql, so I'm sorry for doing stupid questions...
I have a situation whit one table where items are related to two other
tables through a common id (unique in the first table) and the table
name. Whenever the user execute an operation on an item of the first
one ("pr
Thanks a lot Raymond it works well.
On Sat, Feb 7, 2009 at 3:32 PM, Raymond O'Donnell wrote:
> On 07/02/2009 14:26, Alain Roger wrote:
>
> > i have a table which can be altered with several additional column. How
> can
> > i test under plpgsql if a particular column already exists ?
>
> select 1
On 07/02/2009 14:26, Alain Roger wrote:
> i have a table which can be altered with several additional column. How can
> i test under plpgsql if a particular column already exists ?
select 1 from information_schema.columns
where table_name = 'your_table_name_here'
and column_name = 'your_colum
information_schema is the keyword here.
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Hi,
i have a table which can be altered with several additional column. How can
i test under plpgsql if a particular column already exists ?
thx.
--
Alain
---
Windows XP x64 SP2 / Fedora 10 KDE 4.2
PostgreSQL 8.3.5 / MS SQL server 2005
Apac
On Thu, Dec 4, 2008 at 1:27 PM, Pavel Stehule <[EMAIL PROTECTED]> wrote:
> p.s. you can try use stored procedure for generating these statements
yeah, I ended up generating it using:
select array_to_string(ARRAY(select column_name::text FROM
information_schema.columns where table_name='foo'), '
2008/12/4 Grzegorz Jaśkiewicz <[EMAIL PROTECTED]>:
> to answer myself, and also make matter a bit more complicated.
> the table has like 20 columns, so - yes, I can probably name all of
> them one by one, but - is there any way to do it without need to name
> all of them ?
>
no,
regards
Pavel Ste
to answer myself, and also make matter a bit more complicated.
the table has like 20 columns, so - yes, I can probably name all of
them one by one, but - is there any way to do it without need to name
all of them ?
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make chan
hey,
it looks , as if when I have two tables, say
create table foo(
a int,
b varchar,
c float
);
and :
create table bar(
b varchar,
a int,
c float
);
migration of data from one to the other using
insert into foo select * from bar; will fail.
How can I walk around that please ?
--
> I tried to install phpopenchat but I can't create this table:
>
> poc=> CREATE TABLE poc_user_account (
> poc(> USER varchar(255) NOT NULL,
Thanks everyone!
Creating the database with quoted USER column worked fine, now I have to
resolve the other problems.
I'd like to see one application de
Hi,
I tried to install phpopenchat but I can't create this table:
poc=> CREATE TABLE poc_user_account (
poc(> USER varchar(255) NOT NULL,
poc(> PASSWORD varchar(255),
poc(> CONFIRM_CODE char(32),
poc(> DISABLED int NOT NULL DEFAULT '0',
poc(> KICKED int NOT NULL DEFAULT '0',
poc(> PAS
Hi,
I am trying to do a 2 joins between 3 tables.
ie)
select , coalesce(TRR.ABC, SOC.ABC) as newABC, ...
from A join (B join C on (..)) on (..)) as TRR
left join
(D join E on (..)) as SOC on (TRR.Field1=SOC.Field2)
When I run this it says that there is an ambiguous field. Yes after
Sorry I didn't respond sooner -- lost the thread. :(
Yeah, I can see where you're seeing this now. Not so much
in the queries as in the code that needs to access the
results.
Your suggestion would work (theoretically the server could do
something similar in reverse (store a real name and low
Hello,
I'm getting strange length results for columns with UNICODE data.
I entered following string into database:
abcüäöèæ
First three characters are ASCII, second three are German and third three
are Croatian.
When I execute:
select name, length(name), character_length(name), octet_length(na
Neither 16, nor 32, but 31 !
This is also true for table name.
Al.
On Thu, 20 Aug 1998, Rostislav Matl wrote:
>
> I'm not sure if column name length limit is 16 or 32,
> can somebody tell me ?
>
> +-+
> | ROSTISLAV M
I'm not sure if column name length limit is 16 or 32,
can somebody tell me ?
+-+
| ROSTISLAV MATL, student of Masaryk University - Faculty of Informatics |
| e-mail: [EMAIL PROTECTED] WWW: http://www.fi.muni.c
20 matches
Mail list logo