I need to create some nearly identical copies of rows in a complicated
table.
Is there a handy syntax that would let me copy a existing row, 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
Is it possible to issue an SQL query that lists column names, types (int,
varchar, boolean, etc.), properties (like NOT NULL or UNIQUE)
for a given table name ?
Start psql with the -E option. Then "\d yourtable". It will print out
the queries that are run internally to show you the table info
At least I think that would do it.
On 8/31/05, Philip Hallstrom <[EMAIL PROTECTED]> wrote:
On Wed, 2005-08-31 at 12:49 -0400, Henry Ortega wrote:
Ok. Here's TABLE A
emp date hours type
JSMITH 08-15-2005 5 WORK
JSMITH 08-15-2005 3 WORK
JSMITH 08-25-2005 6 WORK
I want to in
On Wed, 2005-08-31 at 12:49 -0400, Henry Ortega wrote:
Ok. Here's TABLE A
empdate hours type
JSMITH 08-15-2005 5 WORK
JSMITH 08-15-2005 3 WORK
JSMITH 08-25-2005 6 WORK
I want to insert the ff:
1.) JSMITH
I want to update a column in myTable. The value this column is set to depends
on a
nested select statement which sometimes returns 0 rows instead of 1. This is a
problem since the column I'm trying to update is set to refuse nulls. Here's a
sample:
update myTable set myColumn = (Select altColum
how do i get a dump of a postgresql database without the data?
% pg_dump --help
pg_dump dumps a database as a text file or to other formats.
Usage:
pg_dump [OPTION]... [DBNAME]
.
-s, --schema-onlydump only the schema, no data
-philip
---(end of broadcast
Looks to be windows based, but...
http://www.techno-kitten.com/PBL_Peeper/Online_Manual/SQL_Formatter/sql_formatter.html
first hit when searching on google for "sql formatter". there were a lot
of other options...
You might look at how some of those C code indenter's work. Seems like
some of
This worked for us in 7.something (don't need it anymore, but it should
still work).
You'll want to create one for INT8, INT2, etc.. if you are going to use
those as well...
CREATE AGGREGATE aggr_bitand ( BASETYPE = INT4, SFUNC1 = int4and, STYPE1 =
INT4);
On Thu, 1 Nov 2001, James Orr wrote:
>
Hi -
http://www.us.postgresql.org/sites.html
has a whole list of them...
On Mon, 1 Oct 2001, [iso-8859-1] Miguel González wrote:
> Does anyone where there is a web site or ftp site where i can download the
> latest release of PostgreSQL? I have been trying to use the
> ftp://ftp.postgresql.org
Not that this is the best solution, but I read in a book (SQL for smarties
I think) the following (maybe I'm wrong, but this is what I remember :)
Create a holidays table. Put in all the holidays. Do the math yourself
and just put them in there manually for the next 10 years or so (and then
rem
Just drop the table using "DROP TABLE mytable;" and ignore the error...
I'm sure there are fancy ways of doing it by accessing system tables, but
the above works for me.
On Tue, 3 Jul 2001, Jason Watkins wrote:
> How can I duplicate the behavior of:
>
> DROP TABLE IF EXISTS mytable;
>
> CREATE T
In 7.1 it's there... using the |(or) &(and), etc.. operators. In 7.0.3
it's not although can be added easily.
example:
test=> select 2 | 1;
?column?
--
3
(1 row)
test=> select 2 & 1;
?column?
--
0
(1 row)
test=> select 3 & 1;
?column?
--
1
(1
Take a look at the SERIAL datatype as well as sequences (CREATE SEQUENCE,
NEXTVAL, CURRVAL).
good luck!
On Mon, 14 May 2001, Sylte wrote:
> How do I construct a datatype that autoincrement in postgreSQL?
>
> Thanks
> Sylte
>
>
>
>
> ---(end of broadcast)-
There's probably a way to get that serial number.
I think I remember reading that when you specify it as SERIAL,
postgresql actually creates a separate sequence. If that's the case
then you could do "SELECT currval('mysequence')" -- although I'm not
sure what "mysequence" should be set to.
The ot
14 matches
Mail list logo