Lane [mailto:t...@sss.pgh.pa.us]
Sent: Wednesday, August 05, 2009 6:46 AM
To: Venkateswara Rao Bondada
Cc: Rob Sargent; pgsql-sql@postgresql.org
Subject: Re: [SQL] Create table command fails with permission denied
Venkateswara Rao Bondada writes:
> camd=# \c cms postgres
> You are now c
Venkateswara Rao Bondada writes:
> camd=# \c cms postgres
> You are now connected to database "cms" as user "postgres".
> cms=# create table test(id character varying(80));
> ERROR: could not create relation "test": Permission denied
Actually, what that is complaining about is that the operating
mission denied
cms=#
==
Thanks,
Venkat
-Original Message-
From: Rob Sargent [mailto:robjsarg...@gmail.com]
Sent: Tuesday, August 04, 2009 3:33 AM
To: Venkateswara Rao Bondada
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Create table command f
---Original Message-
From: Rob Sargent [mailto:robjsarg...@gmail.com]
Sent: Tuesday, August 04, 2009 3:33 AM
To: Venkateswara Rao Bondada
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Create table command fails with permission denied
Looks to me as though you are not the owner of the schema
Looks to me as though you are not the owner of the schema nor superuser
nor in a role with permission to create tables in said schema. See the
DBA if it's not you. If it is sign on as postgres (superuser) and grant
yourself some access rights.
Venkateswara Rao Bondada wrote:
Hi,
I’m new t
Hi,
I'm new to PostgreSQL, and currently facing an issue with PostgreSQL 7.4
database. I'm getting the following error when tried to create a table. Please
let me know the steps (with queries) that I should take care to resolve this
issue.
cms=# create table test(id character varying(80));
ERRO
' text' from foo),', ')||');';
not pretty, but you get the idea.
> -Original Message-
> From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-
> ow...@postgresql.org] On Behalf Of Marco Lechner
> Sent: Monday, December 15, 2008 1:42 PM
> To: p
Hi list,
I try to create a table using plpgsql or plpythonu. I'm starting with
programming in postgresql therfore I'm a little bit confused. I know a
little bit of python and a little bit of SQL. May be some hints could
help me gettin into it:
My problem is:
I'm having a table with a column a and
"Shavonne Marietta Wijesinghe" <[EMAIL PROTECTED]> writes:
> IF (table not found) THEN
> CREATE TABLE distributors (
> did integer,
> namevarchar(40),
> UNIQUE(name)
> );
> END IF
Assuming you're in a procedure (above code snippet looks to be executed
within
Hello
I'm having some trouble checking if a table exist before i create it.
Example:
SELECT * FROM distributors
IF (table not found) THEN
CREATE TABLE distributors (
did integer,
namevarchar(40),
UNIQUE(name)
);
END IF
If i have a table like the above h
Considering how related Created Types and
Tables are (at least conceptually)
it seems like a good idea to allow
Created Types to be used in the Like clause.
At least it would help me and make maintaining
my db easier and cleaner.
TJ O'Donnell
http://www.gnova.com/
> "TJ O'Donnell" <[EMAIL PROTECT
"TJ O'Donnell" <[EMAIL PROTECTED]> writes:
> Create Type xtype As (a Integer, b Text);
> Create Table xtest (Like xtype);
> ERROR: "xtype" is a composite type
Hmmm ... as you see, that's disallowed, but offhand it seems like it
wouldn't be very hard to allow it. It might be as simple as relaxing
I know I can create a table using names and types from an existing
table.
Create Table xtable (a Integer, b Text);
Create Table xtest (Like xtable);
This works just fine.
I want to create a table having the same column names and types as
an existing new datatype.
Create Type xtype As (a Intege
Because being consistent is easily overlooked I would advise not to quote the
table names
Instead of calling your table thisTableIsBig call it this_table_is_big
>>> Andrew Sullivan <[EMAIL PROTECTED]> 2007-03-09 15:21 >>>
On Fri, Mar 09, 2007 at 02:56:06PM +0100, Shavonne Marietta Wijesinghe wr
On Fri, Mar 09, 2007 at 03:15:54PM +0100, Shavonne Marietta Wijesinghe wrote:
> The problem i'm having is i can't pass them in the strSQL string. coz when
> i write " i close the string :\
You likely need to escape the double-quotes. How you do it in your
environment is a topic for the manuals f
On Fri, Mar 09, 2007 at 02:56:06PM +0100, Shavonne Marietta Wijesinghe wrote:
>
> But the problem i have is that when i go and open my database in
> pgadmin the table name and coloumn name is written in lowercase :(
Unquoted identifiers in PostgreSQL are folded to lower case. This is
contrary to
Shavonne Marietta Wijesinghe wrote:
> Hello
>
> From my asp page i create a table
>
> TableName = "CON01"
> strSQL = "CREATE TABLE " & TableName & " ( ID text, N_GEN serial not
> null);"
>
> But the problem i have is that when i go and open my database in pgadmin the
> table name and colou
c: "Shavonne Marietta Wijesinghe" <[EMAIL PROTECTED]>
Sent: Friday, March 09, 2007 3:09 PM
Subject: Re: [SQL] CREATE TABLE
On 3/9/07, Shavonne Marietta Wijesinghe <[EMAIL PROTECTED]>
wrote:
Hello
From my asp page i create a table
TableName = "CON01"
strSQL = "C
León" <[EMAIL PROTECTED]>
To:
Cc: "Shavonne Marietta Wijesinghe" <[EMAIL PROTECTED]>
Sent: Friday, March 09, 2007 3:09 PM
Subject: Re: [SQL] CREATE TABLE
On 3/9/07, Shavonne Marietta Wijesinghe <[EMAIL PROTECTED]>
wrote:
Hello
From my asp page i create a
On 3/9/07, Shavonne Marietta Wijesinghe <[EMAIL PROTECTED]> wrote:
Hello
From my asp page i create a table
TableName = "CON01"
strSQL = "CREATE TABLE " & TableName & " ( ID text, N_GEN serial not
null);"
But the problem i have is that when i go and open my database in pgadmin the
table nam
Hello
>From my asp page i create a table
TableName = "CON01"
strSQL = "CREATE TABLE " & TableName & " ( ID text, N_GEN serial not null);"
But the problem i have is that when i go and open my database in pgadmin the
table name and coloumn name is written in lowercase :(
How do i ask it to
On Mon, 24 Jul 2006, Kevin Nikiforuk wrote:
> So, I've changed my code as Erik suggested:
>
> CREATE OR REPLACE FUNCTION rgio() RETURNS INTEGER as $$
> DECLARE
> lv RECORD;
>
> BEGIN
> FOR lv IN SELECT DISTINCT rg
> FROM ldevrg
> LOOP
>
>
near line 23
psql:rgio.sql:32: LINE 1: SELECT 'CREATE TABLE rgio_' || $ $1 || ' AS
psql:rgio.sql:32:
^
From: [EMAIL PROTECTED] on behalf of Erik Jones
Sent: Fri 7/21/2006 3:04 PM
To:
Rodrigo De Leon wrote:
On 7/21/06, Kevin Nikiforuk <[EMAIL PROTECTED]> wrote:
So now that I've got my loops working, on to my next newbie
question. I've created my function and in it, I want to loop through
the results of a select and for each value of my loop counter, I want
to create a new
On 7/21/06, Kevin Nikiforuk <[EMAIL PROTECTED]> wrote:
So now that I've got my loops working, on to my next newbie question. I've
created my function and in it, I want to loop through the results of a select
and for each value of my loop counter, I want to create a new table, but I
can't figu
So now that I've got my loops working, on to my next newbie question. I've
created my function and in it, I want to loop through the results of a select
and for each value of my loop counter, I want to create a new table, but I
can't figure out how to use a variable in the name of the new table
Markus Schaber wrote:
> Hello,
>
> Recently, I wanted to create a table from a complex query in a specific
> tablespace, but CREATE TABLE name AS SELECT ... does not accept a
> tablespace argument.
>
> I worked around it by CREATE TABLE name AS SELECT ... LIMIT 0, then
> moving the generated tabl
Hello,
Recently, I wanted to create a table from a complex query in a specific
tablespace, but CREATE TABLE name AS SELECT ... does not accept a
tablespace argument.
I worked around it by CREATE TABLE name AS SELECT ... LIMIT 0, then
moving the generated table to the other tablespace using ALTER
On Tue, 2006-02-14 at 22:12 +0100, Maciej Piekielniak wrote: (snipped)
>Is anybody know how create field in a new table with data type accuiring
>from a field in other table?
>For example:
> create table new_table ( name other_table.name%TYPE);
On Wed, 15 Feb 2006 09:42, Ken Hill wrote: (snipped)
On Tue, 2006-02-14 at 23:03 +0100, Maciej Piekielniak wrote:
Hello Ken,
Tuesday, February 14, 2006, 10:30:34 PM, you wrote:
KH> On Tue, 2006-02-14 at 22:12 +0100, Maciej Piekielniak wrote:
>> Hello pgsql-sql,
>>
>> Is anybody know how create field in a new table with data type accuiring
Maciej Piekielniak <[EMAIL PROTECTED]> writes:
> Is anybody know how create field in a new table with data type accuiring
> from a field in other table?
Sorry, the %TYPE syntax only works in function declarations at the
moment.
It could possibly be made to work in table declarations --- there
Hello Ken,
Tuesday, February 14, 2006, 10:30:34 PM, you wrote:
KH> On Tue, 2006-02-14 at 22:12 +0100, Maciej Piekielniak wrote:
>> Hello pgsql-sql,
>>
>> Is anybody know how create field in a new table with data type accuiring
>> from a field in other table?
>> For example:
>>
>> create ta
On Tue, 2006-02-14 at 22:12 +0100, Maciej Piekielniak wrote:
Hello pgsql-sql,
Is anybody know how create field in a new table with data type accuiring from a field in other table?
For example:
create table new_table
(
name other_table.name%TYPE
);
Have you tried inheritance from o
Hello pgsql-sql,
Is anybody know how create field in a new table with data type accuiring from
a field in other table?
For example:
create table new_table
(
name other_table.name%TYPE
);
--
Best regards,
Maciej mailto:[EMAIL PROTECTED]
---
JB> Offered up because I have no explanation, and curiosity overwhelms me:
JB> I was attempting to create a table from a SELECT statement against
JB> another table:
JB> create table foo
JB> as select
JB> a,
JB> f(b)
JB> from xxx;
In this command table foo populated after the select statement
Offered up because I have no explanation, and curiosity overwhelms me:
I was attempting to create a table from a SELECT statement against
another table:
create table foo
as select
a,
f(b)
from xxx;
The function f() attempts to make a unique value based on its argument
(it's actually a "usernam
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Arash Zaryoun wrote:
| Hi All,
|
| I have a table which has 'SERIAL' datatype. When I use 'create table X
| as select * from my-table' , it creates the table but without serial
| datatype. I mean without implicit sequence.
|
| test=> \d qptuser
|
Hi All,
I have a table which has 'SERIAL' datatype. When I use 'create table X
as select * from my-table' , it creates the table but without serial
datatype. I mean without implicit sequence.
test=> \d qptuser
Table "public.qptuser"
Column | Type
On 28 Aug 2001, satish rao wrote:
> Entered below is the SQL create table syntax:
>
> CREATE TABLE lists (
> [listid] [int] IDENTITY (1, 1) NOT NULL ,
> [listname] [varchar] (200) NULL ,
> [listcreator] [varchar] (200) NULL ,
> [listdesc] [text
Hi
Entered below is the SQL create table syntax:
CREATE TABLE lists (
[listid] [int] IDENTITY (1, 1) NOT NULL ,
[listname] [varchar] (200) NULL ,
[listcreator] [varchar] (200) NULL ,
[listdesc] [text] NULL)
We need to know that this syntax will work properly in
On Sun, Apr 29, 2001 at 09:34:29PM +0200, LeoDeBeo wrote:
> can anybody explain me the syntax of Create Table documentation??
...
> i also don't understand what the [ ... ] and [, ... ] means. I do know that
> brackets denote options and | alternatives.
I guess:
``[ ... ]'' means that you may
On Dom 29 Abr 2001 22:34, LeoDeBeo wrote:
> can anybody explain me the syntax of Create Table documentation??
>
> CREATE [ TEMPORARY | TEMP ] TABLE table (
> column type
> [ NULL | NOT NULL ] [ UNIQUE ] [ DEFAULT value ]
> [ column_constraint_clause | PRIMARY KEY } [ ... ]
LeoDeBeo <[EMAIL PROTECTED]> writes:
> i don't understand what the curly brace means after PRIMARY KEY (where is
> the other matching brace?
Typo. Try more recent versions of the docs. 7.1 says
CREATE [ TEMPORARY | TEMP ] TABLE table_name (
{ column_name type [ column_constraint [ ... ]
can anybody explain me the syntax of Create Table documentation??
CREATE [ TEMPORARY | TEMP ] TABLE table (
column type
[ NULL | NOT NULL ] [ UNIQUE ] [ DEFAULT value ]
[ column_constraint_clause | PRIMARY KEY } [ ... ] ]
[ , ... ]
[ , PRIMARY KEY ( column
"Joy Chuang" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I tried to use CREATE TABLE AS and ORDER BY. The query is as followed:
>
> create table freshhr21 as
> select e.studentid, u.hoursxfer
> from enrollmentstatus e, undergradclass u
> where e.st
Hey,
Try:
select e.studentid, u.hoursxfer into freshhr21
from enrollmentstatus e, undergradclass u
where e.studentid = u.studentid and e.classtd = '1'
order by u.hoursxfer
Jie LIANG
Internet Products Inc.
10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873
[EMAIL
Joy Chuang <[EMAIL PROTECTED]> writes:
> But, it returns error message "ERROR: parser: parse error at or near
> "order"". Does "create table as" support "order by" inside of it?
Evidently not.
> I am using PostgreSQL 6.5.3.
It seems to work in 7.0 and later.
regards,
Hi,
I tried to use CREATE TABLE AS and ORDER BY. The query is as followed:
create table freshhr21 as
select e.studentid, u.hoursxfer
from enrollmentstatus e, undergradclass u
where e.studentid = u.studentid and e.classtd = '1'
order by u.hoursxfer
But, it returns error message "ERROR: parser:
I believe a couple of months back... a EXECUTE command was added to plpgsql
to allow users to dynamic sql statements.
So if you get the current development version you should be able to call
EXECUTE CREATE TABLE
or whatever sql you like. (I think this is still not in 7.03, not sure though
I believe (although I haven't tried it) that pltcl will allow
you to do things such as this.
On Thu, 21 Dec 2000, Volker Paul wrote:
> Hi,
>
> > I don't think you can use DDL(data definition language) in PL/SQL.
> > create table is not DML(data munipulation lang
> Can this be done using tcl or perl?
I'll try them and report what I find out.
V.Paul
ECTED]
www.ipinc.com
On Thu, 21 Dec 2000, Volker Paul wrote:
> Hi,
>
> > I don't think you can use DDL(data definition language) in PL/SQL.
> > create table is not DML(data munipulation language) instead
> > it's a DDL.
> Thanks, but that leaves me with a proble
On Thu, Dec 21, 2000 at 11:51:38AM +0100, Volker Paul wrote:
> select famname || ', ' || givname from person where id=1234;
> I know it's possible by building the select e.g. in bash
> and calling psql with it as an argument, but do you see a possibility
> that is closer to Postgres, e.g. in plpgs
Hi,
> I don't think you can use DDL(data definition language) in PL/SQL.
> create table is not DML(data munipulation language) instead
> it's a DDL.
Thanks, but that leaves me with a problem.
What I really want to do is something like
select str from person where id=1234;
wh
Hi,there,
I don't think you can use DDL(data definition language) in PL/SQL.
create table is not DML(data munipulation language) instead
it's a DDL.
Jie LIANG
Internet Products Inc.
10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873
[EMAIL
Hi,
can I do some table manipulation in plpgsql?
Look at only the "create table" line and the error message:
create function plural (text) returns text as '
begin
create table tmp (num int4);
return $1 || ''s'';
end;' language 'plpgsql';
select plural('test');
CREATE
ERROR: cop
Andreas Tille wrote:
> What does this mean? The ERROR is caused by the Create Table statement
> (when I removed it from my complex function it worked well).
> So why doesn't this work and what copy function fails here??
Maybe you can create your table using a select into statement :
something l
> -Original Message-
> From: Tom Lane
>
> "Hiroshi Inoue" <[EMAIL PROTECTED]> writes:
> > Hmm,Andreas's original function seems to contain other statements.
> > If the function contains DML statements for the table Temp_Num_Table,
> > it wouldn't work properly. i.e 1st call would work but
"Hiroshi Inoue" <[EMAIL PROTECTED]> writes:
> Hmm,Andreas's original function seems to contain other statements.
> If the function contains DML statements for the table Temp_Num_Table,
> it wouldn't work properly. i.e 1st call would work but 2nd call woudn't.
Are you thinking about plpgsql's cach
> -Original Message-
> From: Tom Lane
>
> Andreas Tille <[EMAIL PROTECTED]> writes:
> > web=# create function pHelpTable( )
> > web-# returns int
> > web-# As '
> > web'# Begin
> > web'# Create Table Temp_NumTable ( Num int ) ;
> > web'#
> > web'# return 17 ;
> > we
Hi, there,
I don't think that you can use DDL in PL/pgSQL, normally say , you can
only use DML in PL/pgSQL.
i.e. you can use select into,update,delete,insert ... , but you cannot use
create, alter, grant ...
Andreas Tille wrote:
> Hello,
>
> I striped down my function up to a strange thing:
>
Andreas Tille <[EMAIL PROTECTED]> writes:
> web=# create function pHelpTable( )
> web-# returns int
> web-# As '
> web'# Begin
> web'# Create Table Temp_NumTable ( Num int ) ;
> web'#
> web'# return 17 ;
> web'# End; '
> web-# language 'plpgsql' ;
> CREATE
The majori
Hello,
I striped down my function up to a strange thing:
web=# create function pHelpTable( )
web-# returns int
web-# As '
web'# Begin
web'# Create Table Temp_NumTable ( Num int ) ;
web'#
web'# return 17 ;
web'# End; '
web-# language 'plpgsql' ;
CREATE
web=#
web=# s
"Paulo Roberto Siqueira" wrote:
>ufgvirtual=# create table matricula (
>ufgvirtual(# id_aluno char(15) references pessoa,
>ufgvirtual(# id_curso int4 references curso_polo,
>ufgvirtual(# id_polo int2 references curso_polo,
>ufgvirtual(# local_prova varchar(50) not null,
>ufgvirtual(# a
I'm trying to create a table that has three fields as primary key. These
fields must exist in two other tables. id_aluno is primary key in table
pessoa, id_curso and id_polo are primary key in table curso_polo. But it
seems it won't work. What am I doing wrong? See definitions below.
Speci
65 matches
Mail list logo